/* ==========================================================================
   MallOps V4 — Design system
   Thème sombre par défaut, clair via [data-theme="light"]. Mobile-first.
   ========================================================================== */

:root {
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;

  --bg: #0c0d11;
  --bg-2: #111318;
  --surface: #161920;
  --surface-2: #1c2029;
  --surface-3: #242936;
  --border: rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.14);
  --text: #e8ebf2;
  --text-2: #b4bccd;
  --muted: #7f889c;
  --muted-2: #5c657a;

  --accent: #d6423b;
  --accent-2: #9e241f;
  --accent-bg: rgba(214, 66, 59, 0.14);
  --accent-text: #f29a94;
  --success: #22c55e; --success-bg: rgba(34, 197, 94, 0.14); --success-text: #6ee7a0;
  --warning: #f59e0b; --warning-bg: rgba(245, 158, 11, 0.14); --warning-text: #fbbf24;
  --danger: #f43f5e; --danger-bg: rgba(244, 63, 94, 0.14); --danger-text: #fb7185;
  --info: #38bdf8; --info-bg: rgba(56, 189, 248, 0.14); --info-text: #7dd3fc;

  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
  --shadow-lg: 0 24px 60px -20px rgba(0,0,0,.7);
  --ring: 0 0 0 3px rgba(214, 66, 59, 0.35);

  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px;
  --sidebar: 264px;
  --topbar: 64px;
  --ease: cubic-bezier(.2,.8,.2,1);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f3f5f9;
  --bg-2: #eceff5;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --surface-3: #eef0f5;
  --border: rgba(15, 23, 42, 0.08);
  --border-2: rgba(15, 23, 42, 0.16);
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --accent: #c22f29;
  --accent-2: #8f1f1a;
  --accent-bg: rgba(194, 47, 41, 0.10);
  --accent-text: #a8261f;
  --success-bg: rgba(34, 197, 94, 0.12); --success-text: #15803d;
  --warning-bg: rgba(245, 158, 11, 0.14); --warning-text: #b45309;
  --danger-bg: rgba(244, 63, 94, 0.10); --danger-text: #be123c;
  --info-bg: rgba(56, 189, 248, 0.14); --info-text: #0369a1;
  --shadow: 0 1px 2px rgba(15,23,42,.06), 0 8px 24px -12px rgba(15,23,42,.12);
  --shadow-lg: 0 24px 60px -20px rgba(15,23,42,.25);
  --ring: 0 0 0 3px rgba(194, 47, 41, 0.25);
  color-scheme: light;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14.5px; line-height: 1.55; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.015em; line-height: 1.25; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; } h4 { font-size: .9rem; }
p { margin: 0 0 .75rem; } p:last-child { margin-bottom: 0; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
code, kbd, .mono { font-family: var(--mono); font-size: .86em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.25rem 0; }
.icon { width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -0.18em; }   /* en ligne avec le texte : la remise à zéro met les svg en bloc, ce qui renvoyait l'icône seule sur sa ligne hors d'un conteneur flex */
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }
.muted { color: var(--muted); } .small { font-size: .85rem; } .xs { font-size: .78rem; }
.text-2 { color: var(--text-2); }
.strong { font-weight: 600; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[x-cloak] { display: none !important; }

/* ---------- Layout admin ---------- */
.app { display: flex; min-height: 100dvh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: var(--bg-2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 50; transform: translateX(-100%); transition: transform .3s var(--ease);
}
.sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
.sidebar-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 49; backdrop-filter: blur(2px); }
.brand { display: flex; align-items: center; gap: .7rem; padding: 1.1rem 1.25rem; height: var(--topbar); border-bottom: 1px solid var(--border); }
.brand-logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 800; box-shadow: 0 6px 16px -6px var(--accent); }
.logo-img { height: 40px; width: auto; display: block; }
.logo-img.lg { height: 64px; }
.only-light { display: none; } [data-theme="light"] .only-light { display: block; } [data-theme="light"] .only-dark { display: none; }
.entity-logo { max-height: 56px; max-width: 200px; width: auto; object-fit: contain; }
.brand-name { font-weight: 700; letter-spacing: -.02em; font-size: 1.05rem; }
.brand-name small { display: block; font-size: .7rem; color: var(--muted); font-weight: 500; letter-spacing: .04em; text-transform: uppercase; }
.nav { padding: .9rem .75rem; flex: 1; overflow-y: auto; }
.nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); padding: .9rem .75rem .4rem; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: .7rem; padding: .6rem .75rem; border-radius: var(--r-sm); color: var(--text-2); font-weight: 500; transition: .15s; }
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-bg); color: var(--accent-text); }
.nav a .icon { width: 18px; height: 18px; opacity: .85; }
.nav a .count { margin-left: auto; font-size: .72rem; font-weight: 600; background: var(--surface-3); padding: .1rem .5rem; border-radius: 99px; color: var(--text-2); }
.nav a.active .count { background: var(--accent); color: #fff; }
.sidebar-footer { border-top: 1px solid var(--border); padding: .75rem; }
.userchip { display: flex; align-items: center; gap: .65rem; padding: .5rem .6rem; border-radius: var(--r-sm); }
.userchip:hover { background: var(--surface-2); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 700; background: var(--surface-3); color: var(--text-2); flex: none; }
.avatar.sm { width: 28px; height: 28px; font-size: .7rem; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar); display: flex; align-items: center; gap: .75rem; padding: 0 1rem;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 1.1rem; }
.topbar .spacer { flex: 1; }
.content { padding: 1.25rem 1rem 3rem; max-width: 1400px; width: 100%; margin: 0 auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.page-head p { color: var(--muted); margin: .25rem 0 0; }
.breadcrumb { display: flex; gap: .4rem; align-items: center; font-size: .8rem; color: var(--muted); margin-bottom: .4rem; }
.breadcrumb a { color: var(--muted); }

@media (min-width: 1024px) {
  .sidebar { transform: none; }
  .sidebar-backdrop { display: none; }
  .main { margin-left: var(--sidebar); }
  .topbar { padding: 0 1.75rem; }
  .content { padding: 1.75rem 1.75rem 4rem; }
  .topbar .menu-btn { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .55rem .95rem; border-radius: var(--r-sm);
  border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text); font-weight: 560; font-size: .88rem; cursor: pointer;
  transition: .15s var(--ease); white-space: nowrap; line-height: 1.2; text-decoration: none !important;
}
.btn:hover { background: var(--surface-3); border-color: var(--border-2); transform: translateY(-1px); }
.btn:active { transform: none; }
.btn:disabled, .btn[aria-disabled="true"], .btn.disabled { opacity: .55; pointer-events: none; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; box-shadow: 0 8px 20px -10px var(--accent); }
.btn-primary:hover { filter: brightness(1.08); background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger-bg); border-color: transparent; color: var(--danger-text); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-success { background: var(--success-bg); border-color: transparent; color: var(--success-text); }
.btn-success:hover { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning-bg); border-color: transparent; color: var(--warning-text); }
.btn-sm { padding: .35rem .65rem; font-size: .8rem; }
.btn-lg { padding: .8rem 1.4rem; font-size: 1rem; border-radius: var(--r); }
.btn-icon { padding: .5rem; width: 36px; height: 36px; }
.btn-icon.btn-sm { width: 30px; height: 30px; padding: .3rem; }
.btn-block { width: 100%; }
.btn .icon { width: 1.1em; height: 1.1em; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { display: flex; align-items: center; gap: .5rem; }
.card-head .icon { color: var(--accent-text); }
.card-body { padding: 1.25rem; }
.card-body + .card-body { border-top: 1px solid var(--border); }
.card-foot { padding: .9rem 1.25rem; border-top: 1px solid var(--border); display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.card.flat { box-shadow: none; }
.card.soft { background: var(--surface-2); }
.stack { display: grid; gap: 1.25rem; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.cols-main { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 1100px) { .cols-main { grid-template-columns: minmax(0, 1fr) minmax(0, 360px); } .cols-main.wide { grid-template-columns: minmax(0, 1fr) minmax(0, 420px); } }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.gap-sm { gap: .35rem; }

/* ---------- KPI ---------- */
.kpi { padding: 1.1rem 1.25rem; display: flex; flex-direction: column; gap: .4rem; position: relative; overflow: hidden; }
.kpi .label { font-size: .8rem; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: .4rem; padding-right: 46px; line-height: 1.3; }
.kpi .value { font-size: 1.85rem; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.kpi .sub { font-size: .78rem; color: var(--muted); }
.kpi .kpi-icon { position: absolute; right: 1rem; top: 1rem; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-bg); color: var(--accent-text); }
.kpi .kpi-icon .icon { width: 20px; height: 20px; }
.kpi.warn .kpi-icon { background: var(--warning-bg); color: var(--warning-text); }
.kpi.ok .kpi-icon { background: var(--success-bg); color: var(--success-text); }
.kpi.danger .kpi-icon { background: var(--danger-bg); color: var(--danger-text); }
.kpi.info .kpi-icon { background: var(--info-bg); color: var(--info-text); }

/* ---------- Badges / pills ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .55rem; border-radius: 99px; font-size: .74rem; font-weight: 600; letter-spacing: .01em; line-height: 1.4; white-space: nowrap; }
.badge .icon { width: .9em; height: .9em; }
.badge-muted { background: var(--surface-3); color: var(--text-2); }
.badge-accent { background: var(--accent-bg); color: var(--accent-text); }
.badge-success { background: var(--success-bg); color: var(--success-text); }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); }
.badge-danger { background: var(--danger-bg); color: var(--danger-text); }
.badge-info { background: var(--info-bg); color: var(--info-text); }
.badge-outline { background: transparent; border: 1px solid var(--border-2); color: var(--text-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: currentColor; }
.pulse { animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.field label, .label { font-size: .84rem; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: .35rem; }
.field label .req { color: var(--danger-text); }
.help { font-size: .78rem; color: var(--muted); line-height: 1.45; }
.input, .select, .textarea {
  width: 100%; padding: .62rem .8rem; border-radius: var(--r-sm); border: 1px solid var(--border-2); background: var(--bg-2); color: var(--text);
  transition: .15s; min-height: 40px;
}
[data-theme="light"] .input, [data-theme="light"] .select, [data-theme="light"] .textarea { background: #fff; }
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: var(--ring); outline: none; }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--danger); }
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%237f889c' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .7rem center; padding-right: 2.2rem; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.input-group .addon { display: flex; align-items: center; padding: 0 .8rem; border: 1px solid var(--border-2); border-left: 0; border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--surface-2); color: var(--muted); font-size: .85rem; white-space: nowrap; }
.error { color: var(--danger-text); font-size: .8rem; display: flex; gap: .3rem; align-items: center; }
.form-grid { display: grid; gap: 1rem 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .full { grid-column: 1 / -1; } }
.form-grid .half { grid-column: span 1; }
.form-actions { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; margin-top: 1.25rem; }

.check { display: flex; gap: .6rem; align-items: flex-start; cursor: pointer; font-weight: 500; color: var(--text); }
.check input { margin-top: .2rem; width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.check .help { font-weight: 400; }
.switch { position: relative; display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; font-weight: 500; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 42px; height: 24px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--border-2); position: relative; transition: .2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .2s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }

/* Choix en tuiles (radio/checkbox visuels) */
.tiles { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.tiles.lg { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tile { position: relative; display: flex; flex-direction: column; gap: .35rem; padding: .9rem; border: 1px solid var(--border-2); border-radius: var(--r); background: var(--surface-2); cursor: pointer; transition: .15s var(--ease); }
.tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.tile input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.tile .icon { width: 22px; height: 22px; color: var(--accent-text); }
.tile .t { font-weight: 600; font-size: .9rem; }
.tile .d { font-size: .78rem; color: var(--muted); line-height: 1.4; }
.tile:has(input:checked), .tile.selected { border-color: var(--accent); background: var(--accent-bg); box-shadow: inset 0 0 0 1px var(--accent); }
.tile:has(input:focus-visible) { box-shadow: var(--ring); }
.yesno { display: inline-flex; border: 1px solid var(--border-2); border-radius: var(--r-sm); overflow: hidden; }
.yesno label { padding: .55rem 1.1rem; cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--muted); position: relative; background: var(--bg-2); }
.yesno label + label { border-left: 1px solid var(--border-2); }
.yesno input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.yesno label:has(input:checked) { background: var(--accent); color: #fff; }
.yesno label:has(input:focus-visible) { box-shadow: inset var(--ring); }
.radios { display: flex; flex-wrap: wrap; gap: .5rem; }
.radios label { padding: .5rem .9rem; border: 1px solid var(--border-2); border-radius: 99px; cursor: pointer; position: relative; font-weight: 500; font-size: .88rem; background: var(--bg-2); }
.radios input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.radios label:has(input:checked) { background: var(--accent-bg); border-color: var(--accent); color: var(--accent-text); }

/* ---------- Alerts ---------- */
.alert { display: flex; gap: .7rem; padding: .85rem 1rem; border-radius: var(--r); border: 1px solid; font-size: .88rem; line-height: 1.5; align-items: flex-start; }
.alert .icon { width: 18px; height: 18px; flex: none; margin-top: .1rem; }
.alert strong { display: block; margin-bottom: .1rem; }
.alert-info { background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 40%, transparent); color: var(--info-text); }
.alert-success { background: var(--success-bg); border-color: color-mix(in srgb, var(--success) 40%, transparent); color: var(--success-text); }
.alert-warning { background: var(--warning-bg); border-color: color-mix(in srgb, var(--warning) 40%, transparent); color: var(--warning-text); }
.alert-danger, .alert-block { background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger-text); }
.alert-muted { background: var(--surface-2); border-color: var(--border); color: var(--text-2); }
.alert .alert-body { flex: 1; min-width: 0; }
.alert a { color: inherit; text-decoration: underline; }

/* Toasts */
.toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 200; display: grid; gap: .5rem; max-width: min(420px, calc(100vw - 2rem)); }
.toast { display: flex; gap: .6rem; align-items: flex-start; padding: .8rem 1rem; border-radius: var(--r); background: var(--surface-3); color: var(--text); border: 1px solid var(--border-2); box-shadow: var(--shadow-lg); animation: toast-in .3s var(--ease); font-size: .88rem; }
.toast .icon { width: 18px; height: 18px; flex: none; margin-top: .1rem; }
.toast.success .icon { color: var(--success-text); } .toast.error .icon { color: var(--danger-text); } .toast.info .icon { color: var(--info-text); } .toast.warning .icon { color: var(--warning-text); }
.toast button { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) } }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: .7rem 1rem; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); }
.table td { padding: .8rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tr.clickable { cursor: pointer; }
.table td > .row { flex-wrap: nowrap; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-cards { display: grid; gap: .75rem; }
/* sur ordinateur, un tableau trop large défile dans sa carte au lieu d'en sortir */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 767px) {
  .table-responsive table, .table-responsive thead, .table-responsive tbody, .table-responsive tr, .table-responsive td { display: block; }
  .table-responsive thead { display: none; }
  .table-responsive tr { border: 1px solid var(--border); border-radius: var(--r); margin-bottom: .7rem; background: var(--surface); padding: .35rem 0; }
  .table-responsive td { border: 0; padding: .35rem 1rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .2rem .8rem; align-items: baseline; }
  /* le libellé garde sa place ; la valeur prend le reste et passe à la ligne entière quand elle ne tient pas,
     sans jamais être écrasée sous la largeur de ses mots (sinon les codes et badges se cassent lettre par lettre) */
  .table-responsive td::before { flex: 0 0 auto; max-width: 45%; }
  .table-responsive td > * { flex: 1 1 62%; text-align: right; }
  .table-responsive td > details, .table-responsive td > .doc-one, .table-responsive td > .doc-group { text-align: left; max-width: 100%; }
  .table-responsive .doc-group summary { flex-wrap: wrap; }
  .table-responsive td::before { content: attr(data-label); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
  .table-responsive td.no-label::before { display: none; }
  .table-responsive td.no-label { justify-content: flex-start; }
}
.pagination { display: flex; gap: .3rem; justify-content: center; padding: 1rem; flex-wrap: wrap; }
.pagination a, .pagination span { padding: .4rem .7rem; border-radius: var(--r-sm); font-size: .85rem; border: 1px solid var(--border); color: var(--text-2); }
.pagination .current { background: var(--accent); color: #fff; border-color: transparent; }

/* ---------- Lists / timeline ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: .9rem; align-items: center; padding: .8rem 1.25rem; border-bottom: 1px solid var(--border); transition: background .12s; color: inherit; }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover { background: var(--surface-2); text-decoration: none; }
.list-item .body { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.list-item .meta { font-size: .8rem; color: var(--muted); }
.timeline { position: relative; padding-left: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline-item { position: relative; }
.timeline-item::before { content: ""; position: absolute; left: -1.5rem; top: .35rem; width: 16px; height: 16px; border-radius: 50%; background: var(--surface-3); border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--border-2); }
.timeline-item.status::before { background: var(--accent); }
.timeline-item.ai::before { background: var(--accent-2); }
.timeline-item.alert::before { background: var(--warning); }
.timeline-item.ai_error::before, .timeline-item.danger::before { background: var(--danger); }
.timeline-item.mail::before { background: var(--info); }
.timeline-item .when { font-size: .76rem; color: var(--muted); }
.empty { text-align: center; padding: 2.5rem 1.5rem; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.empty .icon { width: 40px; height: 40px; opacity: .5; }
.empty h3 { color: var(--text-2); }

/* ---------- Tabs / segmented ---------- */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs a { padding: .7rem .9rem; color: var(--muted); font-weight: 560; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-size: .9rem; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--accent-text); border-color: var(--accent); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.seg a, .seg button { padding: .35rem .75rem; border-radius: 6px; font-size: .82rem; font-weight: 560; color: var(--muted); border: 0; background: none; cursor: pointer; white-space: nowrap; }
.seg .active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---------- Dropdown / modal / drawer ---------- */
.dropdown { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; background: var(--surface-3); border: 1px solid var(--border-2); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: .35rem; z-index: 60; }
.menu a, .menu button { display: flex; gap: .6rem; align-items: center; width: 100%; text-align: left; padding: .55rem .7rem; border-radius: var(--r-sm); color: var(--text-2); background: none; border: 0; cursor: pointer; font-size: .88rem; font-weight: 500; }
.menu a:hover, .menu button:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.menu .danger { color: var(--danger-text); }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(4px); z-index: 100; display: flex; align-items: flex-end; justify-content: center; padding: 0; }
@media (min-width: 640px) { .modal-backdrop { align-items: center; padding: 1.5rem; } }
.modal { background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-xl) var(--r-xl) 0 0; width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto; box-shadow: var(--shadow-lg); animation: modal-in .25s var(--ease); }
@media (min-width: 640px) { .modal { border-radius: var(--r-xl); } }
.modal.lg { max-width: 900px; } .modal.xl { max-width: 1140px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(16px) scale(.98) } }
.modal-head { display: flex; align-items: center; gap: .7rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-head h3 { flex: 1; }
.modal-body { padding: 1.25rem; }
.modal-foot { padding: .9rem 1.25rem; border-top: 1px solid var(--border); display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; position: sticky; bottom: 0; background: var(--surface); }

/* ---------- Wizard ---------- */
.wizard-steps { display: flex; gap: .35rem; flex-wrap: wrap; }
.wizard-steps .ws { display: flex; align-items: center; gap: .45rem; font-size: .8rem; padding: .35rem .65rem; border-radius: 99px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); }
.wizard-steps .ws .n { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .7rem; font-weight: 700; background: var(--surface-3); }
.wizard-steps .ws.done { color: var(--success-text); border-color: color-mix(in srgb, var(--success) 35%, transparent); }
.wizard-steps .ws.done .n { background: var(--success); color: #fff; }
.wizard-steps .ws.current { color: var(--accent-text); border-color: var(--accent); background: var(--accent-bg); }
.wizard-steps .ws.current .n { background: var(--accent); color: #fff; }
.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; transition: width .4s var(--ease); }
.effects { display: flex; flex-direction: column; gap: .35rem; margin-top: .5rem; }
.effects li { list-style: none; display: flex; gap: .45rem; align-items: flex-start; font-size: .8rem; color: var(--text-2); }
.effects li .icon { width: 14px; height: 14px; color: var(--accent-text); margin-top: .2rem; flex: none; }
.qcard { padding: 1.1rem 1.25rem; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); display: grid; gap: .6rem; }
.qcard .q { font-weight: 600; line-height: 1.4; }
.qcard.active { border-color: var(--accent); }
details.effects-box { border-top: 1px dashed var(--border); padding-top: .5rem; }
details.effects-box summary { cursor: pointer; font-size: .78rem; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: .3rem; list-style: none; }
details.effects-box summary::-webkit-details-marker { display: none; }
details.effects-box ul { margin: .4rem 0 0; padding: 0; }

/* ---------- Form builder ---------- */
.builder-field { display: flex; gap: .8rem; align-items: center; padding: .8rem 1rem; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); transition: .15s; }
.builder-field:hover { border-color: var(--border-2); }
.builder-field.dragging { opacity: .4; }
.builder-field.over { border-color: var(--accent); box-shadow: var(--ring); }
.builder-field .handle { color: var(--muted-2); cursor: grab; }
.builder-field .ftype { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-bg); color: var(--accent-text); flex: none; }
.builder-field .ftype .icon { width: 18px; height: 18px; }
.builder-field.site .ftype { background: var(--info-bg); color: var(--info-text); }
.builder-field.static .ftype { background: var(--surface-3); color: var(--muted); }
.builder-field .fbody { flex: 1; min-width: 0; }
.builder-field .fbody .t { font-weight: 600; }
.builder-field .fbody .m { font-size: .76rem; color: var(--muted); display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .15rem; }
.builder-field.inactive { opacity: .55; }
.builder-field.half { border-left: 3px solid var(--accent); }
.preview-field { display: flex; flex-direction: column; gap: .35rem; }
.preview-frame { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg-2); padding: 1.25rem; }
.wz-q { font-size: 1.05rem; font-weight: 650; margin-bottom: .25rem; }
.wz-sub { color: var(--muted); font-size: .86rem; margin-bottom: 1rem; }
.type-grid { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.type-grid .tile { padding: .75rem; }

/* ---------- Public ---------- */
.public { min-height: 100dvh; display: flex; flex-direction: column; background: radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%), var(--bg); }
/* Pages publiques (portails, suivi) : le logo du centre mène, MallOps se fait discret */
body.public { background: radial-gradient(ellipse 70% 40% at 85% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%), var(--bg); background-attachment: fixed; }
body.public .public-head .logo-img { height: 30px; width: auto; }
body.public .public-head .brand-name { font-size: .95rem; color: var(--text); }
body.public .public-head .brand-name small { color: var(--accent-text); }
body.public .section-title { color: var(--accent-text); }
body.public .choice-card { border-radius: 18px; padding: 1.4rem; }
body.public .choice-card .ci { border-radius: 14px; }
body.public .card { border-radius: 18px; }
body.public .btn-lg { border-radius: 999px; padding-left: 1.5rem; padding-right: 1.5rem; }
body.public .btn-primary { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 88%, #fff), var(--accent) 55%, var(--accent-2)); border-color: transparent; box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 28%, transparent); }
.public-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; max-width: 960px; width: 100%; margin: 0 auto; }
.public-main { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 0 1rem 3rem; }
.public-foot { text-align: center; color: var(--muted-2); font-size: .78rem; padding: 1.5rem; }
.hero { text-align: center; padding: 1.5rem 0 2rem; }
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); margin-bottom: .5rem; }
.hero p { color: var(--muted); max-width: 560px; margin: 0 auto; font-size: 1rem; }
.choice-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.choice-card { display: flex; flex-direction: column; gap: .6rem; padding: 1.25rem; border: 1px solid var(--border-2); border-radius: var(--r-lg); background: var(--surface); color: inherit; transition: .2s var(--ease); text-decoration: none !important; position: relative; overflow: hidden; }
.choice-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-lg); }
.choice-card .ci { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-bg); color: var(--accent-text); }
.choice-card .ci .icon { width: 22px; height: 22px; }
.choice-card h3 { font-size: 1.02rem; }
.choice-card p { color: var(--muted); font-size: .86rem; }
.choice-card .go { margin-top: auto; color: var(--accent-text); font-weight: 600; font-size: .85rem; display: flex; align-items: center; gap: .3rem; }
.section-title { display: flex; align-items: center; gap: .6rem; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin: 1.75rem 0 .9rem; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.section-title:first-child { margin-top: 0; }
.live-alerts { display: grid; gap: .5rem; margin-top: .5rem; }
.file-drop { border: 1.5px dashed var(--border-2); border-radius: var(--r); padding: .9rem 1rem; display: flex; gap: .8rem; align-items: center; background: var(--bg-2); cursor: pointer; transition: .15s; }
.file-drop:hover { border-color: var(--accent); }
.file-drop input { display: none; }
.file-drop .fn { font-size: .84rem; color: var(--muted); flex: 1; min-width: 0; }
.file-drop.has .fn { color: var(--text); font-weight: 500; }
.summary-box { border-left: 3px solid var(--accent); padding: .6rem 1rem; background: var(--surface-2); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.ref { font-family: var(--mono); font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.score-ring { --p: 0; width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 1.05rem; background: conic-gradient(var(--c, var(--accent)) calc(var(--p) * 1%), var(--surface-3) 0); position: relative; }
.score-ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--surface); }
.score-ring span { position: relative; }
.verdict-conforme { --c: var(--success); color: var(--success-text); }
.verdict-reserves { --c: var(--warning); color: var(--warning-text); }
.verdict-non_conforme { --c: var(--danger); color: var(--danger-text); }
.issue { display: flex; gap: .7rem; padding: .8rem 0; border-bottom: 1px solid var(--border); }
.issue:last-child { border-bottom: 0; }
.issue .sev { flex: none; }
.issue .rule { font-size: .78rem; color: var(--muted); }
.issue .fix { font-size: .84rem; color: var(--text-2); margin-top: .25rem; }
.desc-box { white-space: pre-wrap; line-height: 1.6; }
.kv { display: grid; grid-template-columns: minmax(120px, 36%) 1fr; gap: .35rem 1rem; font-size: .88rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 500; word-break: break-word; }
.chart-bars { display: flex; align-items: flex-end; gap: 3px; height: 90px; }
.chart-bars span { flex: 1; background: var(--accent-bg); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; transition: .2s; }
.chart-bars span:hover { background: var(--accent); }
.chart-bars span[title]:hover::after { content: attr(title); position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); background: var(--surface-3); color: var(--text); font-size: .7rem; padding: .2rem .45rem; border-radius: 6px; white-space: nowrap; border: 1px solid var(--border-2); z-index: 5; }
.color-swatch { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border-2); padding: 0; cursor: pointer; background: none; }
.qr-box { background: #fff; padding: 10px; border-radius: var(--r); display: inline-block; }
.qr-box svg, .qr-box img, .qr-box table { display: block; }
.code-box { font-family: var(--mono); font-size: .8rem; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: .7rem .9rem; overflow-x: auto; white-space: pre-wrap; word-break: break-all; min-width: 0; max-width: 100%; }
.code-box > .truncate { min-width: 0; flex: 1; }
.card, .card-body, .cols-main > * { min-width: 0; }
.sticky-side { position: sticky; top: calc(var(--topbar) + 1rem); }
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 1.5rem; background: radial-gradient(900px 500px at 50% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%), var(--bg); }
.auth .card { width: 100%; max-width: 420px; }
.install-wrap { max-width: 860px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.rule-kind { display: grid; grid-template-columns: 180px 1fr auto; gap: .5rem; align-items: start; }
@media (max-width: 640px) { .rule-kind { grid-template-columns: 1fr; } }
.kind-rule { color: var(--info-text); } .kind-exception { color: var(--warning-text); } .kind-emphasis { color: var(--danger-text); }
.lock { color: var(--muted-2); }
@media print { .sidebar, .topbar, .no-print { display: none !important; } .main { margin: 0 !important; } body { background: #fff; color: #000; } }

/* ---------- Planning ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); }
.cal-head { padding: .5rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; text-align: center; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.cal-day { min-height: 96px; padding: .35rem .4rem; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.cal-day:nth-child(7n+1) { border-left: 0; }
.cal-day.out { opacity: .45; }
.cal-day.weekend { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.cal-day.today .cal-num { color: var(--accent-text); font-weight: 700; }
.cal-day.selected { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-num:hover { color: var(--accent-text); }
.cal-num { font-size: .8rem; font-weight: 600; color: var(--text-2); margin-bottom: .15rem; }
.cal-ev { display: block; font-size: .72rem; line-height: 1.3; padding: .2rem .35rem; border-radius: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text); border-left: 3px solid; background: var(--surface-2); text-decoration: none !important; }
.cal-ev:hover { background: var(--surface-3); }
.ev-success { border-color: var(--success); } .ev-info { border-color: var(--info); } .ev-warning { border-color: var(--warning); } .ev-muted { border-color: var(--muted-2); }
@media (max-width: 767px) { .cal-day { min-height: 64px; } .cal-ev { font-size: .62rem; padding: .1rem .25rem; } }
.day-item { align-items: flex-start; padding: .65rem 1.1rem; }
.day-item .meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; }
.day-item .meta > * { display: inline-flex; align-items: center; gap: .25rem; white-space: nowrap; }
.day-item .meta .icon { width: 12px; height: 12px; opacity: .7; }
.day-item .badge.mono { font-family: var(--mono); font-weight: 500; }
.day-item a.title:hover { color: var(--accent-text); }
/* ---------- Stats ---------- */
.rank { display: grid; gap: .45rem; }
.rank-row { display: flex; align-items: center; gap: .6rem; font-size: .86rem; }
.rank-n { width: 20px; font-size: .72rem; color: var(--muted); text-align: right; flex: none; }
.rank-l { flex: 1 1 90px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-v { flex: none; font-variant-numeric: tabular-nums; font-weight: 600; min-width: 44px; text-align: right; white-space: nowrap; }
.hbar { flex: 1 1 60px; min-width: 40px; height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.hbar span { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.hbar span.success { background: var(--success); } .hbar span.danger { background: var(--danger); }

/* ==========================================================================
   Refonte 09/2026 — sidebar par module, logo mis en valeur, tableau de bord épuré
   ========================================================================== */
/* Logo : centré, plus grand, halo dans la couleur d'accent */
.brand { height: auto; justify-content: center; padding: 1.4rem 1rem 1.15rem; position: relative; background: radial-gradient(ellipse 70% 80% at 50% 30%, var(--accent-bg), transparent 75%); }
.brand::after { content: ""; position: absolute; left: 1.25rem; right: 1.25rem; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: .7; }
.brand .logo-img { height: 82px; filter: drop-shadow(0 10px 22px rgba(214, 66, 59, .28)); transition: transform .2s var(--ease); }
[data-theme="light"] .brand .logo-img { filter: drop-shadow(0 8px 18px rgba(194, 47, 41, .18)); }
.brand:hover .logo-img { transform: scale(1.03); }

/* Entité courante : chip (avec menu pour l'owner) */
.entity-switch { margin: .75rem .75rem 0; }
.entity-chip { display: flex; width: 100%; align-items: center; gap: .6rem; padding: .55rem .65rem; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.entity-chip.static { cursor: default; }
button.entity-chip:hover { border-color: var(--border-2); }
.entity-chip .avatar { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 800; }
.entity-chip .body { flex: 1; min-width: 0; }
.entity-chip .chev { width: 16px; height: 16px; color: var(--muted); flex: none; }
.entity-switch .menu { left: 0; right: 0; max-height: 60vh; overflow-y: auto; }
.entity-switch .menu small { margin-left: auto; color: var(--muted); font-size: .7rem; }

/* Navigation : état actif souligné, modules à venir grisés */
.nav a.active { box-shadow: inset 3px 0 0 var(--accent); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.nav .nav-soon { display: flex; align-items: center; gap: .7rem; padding: .6rem .75rem; color: var(--muted-2); font-weight: 500; cursor: default; }
.nav .nav-soon .icon { width: 18px; height: 18px; opacity: .55; }
.tag-soon, .tag-new { margin-left: auto; font-size: .62rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: .1rem .4rem; border-radius: 4px; }
.tag-soon { color: var(--muted); border: 1px solid var(--border-2); }
.tag-new { color: var(--info-text); background: var(--info-bg); }

/* Barre du haut : recherche globale et cloche */
.notif { position: relative; }
.notif .notif-dot { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--accent); color: #fff; font-size: .62rem; font-weight: 800; display: grid; place-items: center; }

/* Tableau de bord : cartes module */
.modules .mod { display: flex; flex-direction: column; gap: .45rem; padding: 1.1rem 1.25rem; color: inherit; text-decoration: none; min-height: 150px; transition: border-color .15s var(--ease), transform .15s var(--ease); }
a.mod:hover { border-color: var(--border-2); transform: translateY(-1px); text-decoration: none; }
.mod-head { display: flex; align-items: center; gap: .5rem; font-size: .82rem; font-weight: 600; color: var(--text-2); }
.mod-head .icon { width: 17px; height: 17px; color: var(--muted); }
.mod-head .badge { margin-left: auto; font-size: .62rem; }
.mod-value { font-size: 2rem; font-weight: 700; letter-spacing: -.03em; line-height: 1; margin-top: .3rem; display: flex; align-items: baseline; gap: .5rem; font-variant-numeric: tabular-nums; }
.mod-value small { font-size: .8rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.mod-value.accent { color: var(--accent-text); }
.mod-line { font-size: .8rem; color: var(--muted); }
.mod-cta { margin-top: auto; padding-top: .5rem; font-size: .8rem; font-weight: 600; color: var(--accent-text); display: inline-flex; align-items: center; gap: .3rem; }
.mod-cta .icon { width: 14px; height: 14px; }
.mod.soon { background: var(--surface-2); box-shadow: none; }
.mod.soon .mod-head { color: var(--muted); }
.sev { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: .4rem; vertical-align: middle; }
.sev-danger { background: var(--danger); } .sev-warning { background: var(--warning); } .sev-success { background: var(--success); }
.chart-bars span:nth-last-child(-n+7) { background: var(--accent); opacity: .85; }

/* Fil de messages : pièces jointes et notice RGPD du portail */
.msg-file { display: inline-flex; align-items: center; gap: .35rem; margin: .4rem .6rem 0 0; padding: .25rem .6rem; border: 1px solid var(--border-2); border-radius: 99px; font-size: .78rem; font-weight: 600; color: var(--text-2); background: var(--surface); }
.msg-file:hover { border-color: var(--accent); color: var(--accent-text); text-decoration: none; }
.msg-file .icon { width: 13px; height: 13px; }
.rgpd-box { border-top: 1px solid var(--border); }
.rgpd-box p { margin-bottom: .45rem; }

/* ---------- Sentinel ---------- */
.obs-list { display: flex; flex-direction: column; }
.obs-row { border-top: 1px solid var(--border); padding: .7rem 1.25rem; background: var(--surface); transition: background .15s; }
.obs-row:first-child { border-top: 0; }
.obs-row[draggable] { cursor: grab; }
.obs-row.dragging { opacity: .45; background: var(--surface-2); }
.obs-row.na { opacity: .6; }
.obs-main { display: flex; gap: .8rem; align-items: flex-start; }
.obs-rank { display: inline-flex; align-items: center; gap: .3rem; min-width: 44px; padding-top: .15rem; color: var(--muted); }
.obs-rank .grip { width: 14px; height: 14px; opacity: .6; }
.obs-rank b { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--accent-bg); color: var(--accent-text); font-size: .8rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.obs-row.na .obs-rank b { background: var(--surface-3); color: var(--muted); }
.obs-body { flex: 1; min-width: 0; }
.obs-title { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
.obs-meta { margin-top: .15rem; display: flex; gap: .25rem; align-items: center; flex-wrap: wrap; }
.obs-meta .icon { width: 12px; height: 12px; }
.obs-side { display: flex; gap: .4rem; align-items: center; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.obs-loc { display: flex; align-items: flex-start; gap: .35rem; margin-top: .3rem; color: var(--text-2); }
.obs-loc .icon { width: 14px; height: 14px; flex: 0 0 14px; margin-top: .12rem; color: var(--accent-text); }
.obs-tags { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .35rem; }
.obs-tag { display: inline-flex; align-items: center; gap: .25rem; padding: .12rem .5rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: .7rem; color: var(--muted); white-space: nowrap; }
.obs-tag .icon { width: 11px; height: 11px; }
.obs-detail { margin: .7rem 0 .2rem 44px; display: grid; gap: .6rem; }
.obs-block { border: 1px solid var(--border); border-left: 3px solid var(--border-2); border-radius: var(--r-sm); padding: .6rem .8rem; background: var(--surface-2); }
.obs-block.ai { border-left-color: var(--accent); background: var(--accent-bg); }
.obs-label { display: flex; align-items: center; gap: .35rem; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: .3rem; }
.obs-block.ai .obs-label { color: var(--accent-text); }
.obs-label .icon { width: 12px; height: 12px; }
@media (max-width: 640px) { .obs-detail { margin-left: 0; } .obs-side { width: 100%; justify-content: flex-start; } .obs-main { flex-wrap: wrap; } }
.file-drop.is-invalid { border-color: var(--danger); }
/* Dossier de commission */
.dossier-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.dossier-table td { vertical-align: top; }
.dossier-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 1.25rem; }
@media print {
  .dossier { border: 0; box-shadow: none; }
  .dossier .badge { border: 1px solid #999; color: #000 !important; background: none !important; }
  .dossier-table th, .dossier-table td { font-size: 11px; padding: 6px 8px; }
  .content { padding: 0 !important; max-width: none !important; }
}

/* ---------- Budget ---------- */
.table .group-row td { background: var(--surface-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); padding: .45rem 1.25rem; }
.summary-box { border: 1px solid var(--border); border-radius: var(--r-sm); padding: .6rem .8rem; display: grid; gap: .3rem; background: var(--surface-2); }

/* Budget : déchiffrage des codes FCT sous le code de ligne */
.code-decode { display: flex; flex-direction: column; gap: .1rem; margin-top: .3rem; font-size: .72rem; line-height: 1.3; color: var(--text-2); white-space: nowrap; }
.code-decode b { display: inline-block; min-width: 2.6em; color: var(--accent-text); font-weight: 700; }

/* Tickets : vignettes photo */
.ticket-photo img { width: 140px; height: 105px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--border); display: block; }
.ticket-photo:hover img { border-color: var(--accent); }

/* ---------- Plan du centre ---------- */
.plan-shell { display: flex; flex-direction: column; gap: .6rem; }
.plan-toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.plan-body { display: grid; grid-template-columns: 1fr 300px; gap: .8rem; min-height: 560px; }
.plan-canvas { position: relative; background: #fff; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; height: calc(100vh - 260px); min-height: 480px; }
[data-theme="dark"] .plan-canvas { background: #f8fafc; }
.plan-canvas svg { display: block; user-select: none; }
.plan-canvas .cell { cursor: pointer; transition: fill-opacity .12s; }
.plan-canvas .cell:hover { fill-opacity: .7; }
.plan-canvas .cell-label { pointer-events: none; font-family: Inter, Arial, sans-serif; fill: #111; paint-order: stroke; stroke: #fff; stroke-width: .35px; stroke-linejoin: round; }
.plan-canvas .txt text { fill: #9ca3af; }
.plan-loading { position: absolute; inset: 0; display: grid; place-items: center; }
.plan-side { border: 1px solid var(--border); border-radius: var(--r); padding: .8rem; background: var(--surface); overflow: auto; max-height: calc(100vh - 260px); display: flex; flex-direction: column; gap: .8rem; }
.plan-side-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.plan-tools { border-top: 1px solid var(--border); padding-top: .6rem; }
.plan-legend { display: flex; flex-wrap: wrap; gap: .3rem .7rem; font-size: .72rem; color: var(--text-2); border-top: 1px solid var(--border); padding-top: .6rem; }
.plan-legend .lg { display: inline-flex; align-items: center; gap: .3rem; }
.plan-legend .lg i { width: 11px; height: 11px; border-radius: 2px; border: 1px solid rgba(0,0,0,.25); display: inline-block; }
@media (max-width: 900px) { .plan-body { grid-template-columns: 1fr; } .plan-canvas { height: 60vh; } .plan-side { max-height: none; } }

/* l'attribut hidden doit gagner sur les display:flex/grid des utilitaires */
[hidden] { display: none !important; }

/* Cloche et centre de notifications */
.bell { position: relative; }
.bell-backdrop { display: none; }      /* sur téléphone le panneau prend l'écran : on le ferme en touchant à côté, ou par sa croix */
.bell-panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(400px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r); box-shadow: 0 18px 50px rgba(0,0,0,.35); z-index: 60; overflow: hidden; }
.bell-head, .bell-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .65rem .9rem; border-bottom: 1px solid var(--border); }
.bell-foot { border-bottom: 0; border-top: 1px solid var(--border); font-size: .82rem; }
.bell-list { max-height: min(60vh, 460px); overflow-y: auto; }
.bell-empty { padding: 1.8rem 1rem; text-align: center; color: var(--muted); font-size: .88rem; display: grid; gap: .4rem; justify-items: center; }
.bell-empty svg { width: 22px; height: 22px; opacity: .6; }
/* Dossier commission : documents classés, regroupés par périmètre */
.doc-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; font-weight: 600; }
.doc-title a { color: inherit; text-decoration: none; }
.doc-title a:hover { color: var(--accent-text); text-decoration: underline; }
.doc-meta { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .74rem; color: var(--muted); margin-top: .1rem; }
.doc-one { display: grid; gap: .15rem; min-width: 0; max-width: 340px; }
.doc-one .badge { justify-self: start; }
.doc-obs { position: relative; display: inline-flex; align-items: center; min-width: 58px; height: 18px; padding: 0 .45rem; border-radius: 99px; overflow: hidden; background: var(--surface-3); font-size: .68rem; white-space: nowrap; flex: none; }
.doc-obs i { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--success) 45%, transparent); }
.doc-obs b { position: relative; font-weight: 700; color: var(--text-2); margin: 0 auto; }
.doc-obs-ko { background: var(--danger-bg); } .doc-obs-ko b { color: var(--danger-text); }
.doc-obs-ok b { color: var(--success-text); }
.doc-group { max-width: 340px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); }
.doc-group + .doc-group { margin-top: .35rem; }
.doc-group summary { list-style: none; display: flex; align-items: center; gap: .45rem; padding: .35rem .5rem; cursor: pointer; }
.doc-group summary::-webkit-details-marker { display: none; }
.doc-group summary .icon { width: 14px; height: 14px; color: var(--muted); transition: transform .15s; flex: none; }
.doc-group[open] summary .icon { transform: rotate(180deg); }
.doc-group .doc-count { font-size: .74rem; color: var(--muted); margin-right: auto; white-space: nowrap; }
.doc-group ul { list-style: none; margin: 0; padding: .1rem .55rem .45rem; display: grid; gap: .4rem; border-top: 1px solid var(--border); }
.doc-group li { min-width: 0; padding-top: .4rem; }
@media (max-width: 719px) { .doc-one, .doc-group { max-width: none; } }
/* Périmètre d'un rapport (centre, parkings, Cergy Office…) */
.badge-scope { background: color-mix(in srgb, #6d5bd0 16%, transparent); color: color-mix(in srgb, #6d5bd0 70%, var(--text)); border: 1px solid color-mix(in srgb, #6d5bd0 35%, transparent); }
.notif-item { display: flex; gap: .7rem; padding: .7rem .9rem; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; position: relative; }
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--surface-2); text-decoration: none; }
.notif-item.unread { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.notif-item.unread::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.notif-ico { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.notif-ico svg { width: 16px; height: 16px; }
.notif-main { display: grid; gap: .12rem; min-width: 0; }
.notif-title { font-weight: 600; font-size: .9rem; line-height: 1.3; }
.notif-item:not(.unread) .notif-title { font-weight: 500; color: var(--text-2); }
.notif-body { font-size: .82rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif-meta { font-size: .74rem; color: var(--muted); }
.notif-day { padding: .5rem .9rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); }

/* Dossiers d'aménagement : observations */
.da-obs { padding: .8rem 1rem; border-bottom: 1px solid var(--border); scroll-margin-top: 80px; }
.da-obs.off { opacity: .55; }
.da-obs-head { display: flex; gap: .7rem; align-items: flex-start; }
.da-num { flex: none; min-width: 28px; height: 28px; padding: 0 .4rem; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); font-weight: 700; font-size: .8rem; }
.da-add { padding: .8rem 1rem; border-top: 1px solid var(--border); }
.da-add > summary { cursor: pointer; font-size: .86rem; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: .4rem; }

/* Formulaire public en assistant pas à pas */
.wz-head { text-align: center; padding: .6rem 0 1.1rem; }
.wz-head h1 { font-size: clamp(1.35rem, 3.6vw, 1.9rem); margin-bottom: .4rem; }
.wz-head .badge { font-size: .85rem; padding: .35rem .8rem; }
.wz { max-width: 760px; margin: 0 auto; overflow: hidden; scroll-margin-top: 12px; }
.wz-steps { list-style: none; margin: 0; padding: .9rem 1rem .6rem; display: flex; gap: .25rem; justify-content: space-between; }
.wz-steps li { flex: 1; min-width: 0; }
.wz-steps button { all: unset; box-sizing: border-box; width: 100%; display: flex; flex-direction: column; align-items: center; gap: .3rem; cursor: pointer; color: var(--muted); font-size: .74rem; font-weight: 600; }
.wz-steps button:disabled { cursor: default; opacity: .6; }
.wz-steps .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--border-2); font-size: .8rem; font-weight: 700; background: var(--surface); transition: .2s var(--ease); }
.wz-steps .n .icon { width: 14px; height: 14px; }
.wz-steps li.active button { color: var(--text); }
.wz-steps li.active .n { border-color: var(--accent); background: var(--accent); color: #fff; }
.wz-steps li.done .n { border-color: var(--accent); color: var(--accent-text); background: var(--accent-bg); }
.wz-steps .l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.wz-bar { height: 3px; background: var(--border); }
.wz-bar span { display: block; height: 100%; background: var(--accent); transition: width .3s var(--ease); }
.wz-title { font-size: 1.15rem; margin: 0 0 1rem; }
.wz-sub { color: var(--muted); font-size: .88rem; margin: 1.4rem 0 .4rem; }
.wz-intro { display: grid; gap: .7rem; font-size: .95rem; line-height: 1.6; }
.wz-intro p { margin: 0; }
.wz-questions { display: grid; }
.wz-questions .field { padding: .8rem 0; border-top: 1px solid var(--border); margin: 0; }
.wz-questions .field.ft-yesno { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem 1rem; align-items: center; }
.wz-questions .field.ft-yesno > label { margin: 0; font-weight: 500; }
.wz-questions .field.ft-yesno > .help, .wz-questions .field.ft-yesno > .error, .wz-questions .field.ft-yesno > .alert { grid-column: 1 / -1; }
.wz-questions .field.ft-yesno > .help { grid-row: 2; grid-column: 1; margin-top: 0; }
.wz-questions .field.ft-checkbox .radios label { border-radius: var(--r-sm); background: var(--accent-bg); border-color: var(--accent); line-height: 1.45; padding: .7rem .9rem .7rem 2.4rem; }
.wz-questions .field.ft-checkbox .radios label::before { content: ""; position: absolute; left: .85rem; top: .85rem; width: 16px; height: 16px; border-radius: 4px; border: 2px solid var(--accent); background: var(--surface); }
.wz-questions .field.ft-checkbox .radios label:has(input:checked)::before { background: var(--accent); box-shadow: inset 0 0 0 2px var(--surface); }
.wz-recap { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; }
.wz-recap > div { border: 1px solid var(--border); border-radius: var(--r-sm); padding: .55rem .75rem; display: grid; gap: .1rem; min-width: 0; }
.wz-recap span { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.wz-recap strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wz-foot .spacer { flex: 1; }
.wz-foot { display: flex; align-items: center; gap: .6rem; position: sticky; bottom: 0; background: var(--surface); z-index: 5; }
@media (max-width: 560px) { .wz-steps .l { display: none; } .wz-steps li.active .l { display: block; } .wz-foot .btn-lg { padding-left: 1rem; padding-right: 1rem; } }

/* Fiche d'une demande : avis de l'IA en tête, détails repliables */
.verdict { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; font-size: 1.05rem; }
.verdict .icon { width: 20px; height: 20px; }
.verdict-conforme { color: var(--success-text, var(--success)); } .verdict-reserves { color: var(--warning-text, var(--warning)); } .verdict-non_conforme { color: var(--danger-text, var(--danger)); }
.issue .issue-sev { flex: none; align-self: flex-start; min-width: 74px; justify-content: center; text-align: center; }
.ai-detail { border-top: 1px solid var(--border); }
.ai-detail > summary, details.fold > summary { cursor: pointer; list-style: none; }
.ai-detail > summary { padding: .8rem 1.25rem; font-weight: 600; font-size: .9rem; color: var(--text-2); }
.ai-detail > summary::before, details.fold > summary h3::before { content: "▸"; display: inline-block; margin-right: .5rem; transition: transform .15s var(--ease); color: var(--muted); }
.ai-detail[open] > summary::before, details.fold[open] > summary h3::before { transform: rotate(90deg); }
.ai-detail > summary::-webkit-details-marker, details.fold > summary::-webkit-details-marker { display: none; }
details.fold:not([open]) > summary { border-bottom: 0; }

/* Logo du centre : deux versions, le thème affiche celle qui convient à son fond */
[data-theme="dark"] .logo-on-light, [data-theme="light"] .logo-on-dark { display: none; }
.panel-logo-box { display: flex; justify-content: center; padding: .9rem 1.1rem .2rem; }
.panel-logo { max-width: 100%; max-height: 92px; width: auto; object-fit: contain; }

.portal-logo-box { display: flex; justify-content: center; margin: .2rem 0 1rem; }
.portal-logo { max-height: 120px; max-width: min(320px, 80%); width: auto; object-fit: contain; }
.panel-logo-box { padding-top: 1.1rem; }
.sidebar-mallops { display: flex; justify-content: center; padding: .7rem .5rem .1rem; opacity: .75; transition: opacity .15s var(--ease); }
.sidebar-mallops:hover { opacity: 1; }
.sidebar-mallops img, .sidebar-mallops svg { max-height: 40px; width: auto; }
.dossier-logo-box { flex: none; margin-right: 1.1rem; }
.dossier-logo { max-height: 70px; width: auto; }
@media print { .logo-on-dark { display: none !important; } .logo-on-light { display: inline-block !important; } }

/* « Voir comme » : bandeau permanent tant que l'owner regarde avec le compte d'un autre */
.view-as-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; padding: .35rem 1rem; background: #b45309; color: #fff; font-size: .88rem; }
.view-as-bar svg { width: 1rem; height: 1rem; vertical-align: -0.15rem; }
.view-as-bar .btn { background: #fff; color: #7c2d12; border-color: #fff; }
.view-as-bar ~ .app .sidebar { top: 44px; }
.view-as-bar ~ .app .topbar { top: 44px; }

/* Barre du haut sur téléphone : le titre se tronque au lieu d'élargir la page (sinon tout déborde et le bouton du menu sort de l'écran) */
.topbar { min-width: 0; max-width: 100vw; }
.topbar h1 { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar > * { flex-shrink: 0; }
.topbar > h1, .topbar > .spacer { flex-shrink: 1; }
@media (max-width: 719px) {
  .topbar { gap: .35rem; padding-left: .6rem; padding-right: .6rem; }
  .topbar h1 { font-size: 1rem; }
  .topbar > .badge { display: none; }            /* pastille « vous agissez dans… » : réservée aux écrans larges */
  .topbar .btn-icon { width: 36px; padding-left: 0; padding-right: 0; }
}
/* Garde-fou général : rien ne doit élargir la page sur petit écran */
@media (max-width: 999px) {
  .content { min-width: 0; max-width: 100vw; overflow-x: clip; }
  .content img, .content canvas, .content video { max-width: 100%; height: auto; }
  .page-head { flex-wrap: wrap; }
  .page-head > * { min-width: 0; }
  .card-head { flex-wrap: wrap; gap: .5rem; }
  .card-head > * { min-width: 0; }
  .card-head h2, .card-head h3 { white-space: normal; }
}
/* Les grilles ne s'élargissent plus pour loger un contenu trop long : c'est le contenu qui se plie */
.stack { grid-template-columns: minmax(0, 1fr); }
.stack > *, .grid > *, .form-grid > * { min-width: 0; }
.select, .input, .textarea { max-width: 100%; }
.obs-tag { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.builder-field .fbody .t { overflow-wrap: anywhere; }
@media (max-width: 719px) {
  .builder-field { flex-wrap: wrap; }
  form.row > .select, form.row > .input { flex: 1 1 100%; min-width: 0; }
  .table-responsive td, .table-responsive th { overflow-wrap: anywhere; }
}

/* Grilles déclarées dans la page : une colonne ne dépasse jamais son conteneur */
[style*="display:grid"] { grid-template-columns: minmax(0, 1fr); }
[style*="display:grid"] > * { min-width: 0; }

/* Panneau des notifications sur téléphone : calé sur l'écran, pas sur la cloche */
@media (max-width: 719px) {
  .bell { position: static; }
  .bell-panel { position: fixed; left: 8px; right: 8px; top: calc(var(--topbar) + env(safe-area-inset-top, 0px) + 6px); width: auto; max-height: calc(100dvh - var(--topbar) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 40px); display: flex; flex-direction: column; }
  /* la barre du haut est floutée (backdrop-filter) : ses enfants « fixed » se placent par rapport à elle, d'où la taille donnée en clair */
  .bell-backdrop { display: block; position: fixed; top: 0; left: 0; width: 100vw; height: 100dvh; z-index: 55; background: rgba(0,0,0,.45); }
  .bell-panel .bell-list { max-height: none; flex: 1 1 auto; min-height: 0; }
  .notif-title, .notif-body { overflow-wrap: anywhere; }
  .badge { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
}

/* Tableaux en fiches sur téléphone : l'intitulé garde sa largeur, une cellule à plusieurs blocs les empile à droite */
@media (max-width: 719px) {
  .table-responsive td::before { flex: none; max-width: 38%; overflow-wrap: normal; word-break: normal; }
  .table-responsive td > * { min-width: 0; }
  .table-responsive td:not(.no-label):is(:has(> * + *), :has(> div)) { display: grid; grid-template-columns: minmax(4.5rem, 30%) minmax(0, 1fr); column-gap: 1rem; row-gap: 0; align-items: start; }
  .table-responsive td:not(.no-label):is(:has(> * + *), :has(> div))::before { grid-column: 1; grid-row: 1 / span 12; max-width: none; }
  .table-responsive td:not(.no-label):is(:has(> * + *), :has(> div)) > * { grid-column: 2; }
}

/* Mise en service : fiches par module */
.install-hub { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1000px) { .install-hub { grid-template-columns: 290px minmax(0, 1fr); } .install-side { position: sticky; top: calc(var(--topbar) + 1rem); } }
.install-side { padding: 1.3rem; display: grid; gap: 1rem; }
.install-ring { --p: 0; width: 150px; height: 150px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-3) 0); }
.install-ring > div { width: 116px; height: 116px; border-radius: 50%; background: var(--surface); display: grid; place-content: center; text-align: center; }
.install-ring strong { font-size: 2rem; letter-spacing: -.04em; line-height: 1; } .install-ring span { font-size: .74rem; color: var(--muted); }
.install-offer, .install-help { display: grid; gap: .3rem; padding: .9rem 1rem; border-radius: var(--r); background: var(--surface-2); }
.install-help { background: none; border: 1px dashed var(--border-2); }
.install-group { font-size: .74rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 .6rem; }
.install-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.install-card { display: flex; flex-direction: column; gap: .5rem; min-height: 170px; padding: 1.05rem; border: 1px solid var(--border-2); border-radius: 18px; background: var(--surface); color: inherit; text-decoration: none; transition: border-color .15s, transform .15s, box-shadow .15s; }
.install-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-lg); text-decoration: none; }
.install-card strong { font-size: 1rem; letter-spacing: -.01em; }
.install-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-bg); color: var(--accent-text); }
.install-ico .icon { width: 19px; height: 19px; }
.install-card.is-ok .install-ico { background: var(--success-bg); color: var(--success-text); }
.install-card.is-locked { background: repeating-linear-gradient(135deg, var(--surface), var(--surface) 12px, var(--surface-2) 12px, var(--surface-2) 24px); }
.install-card.is-locked .install-ico { background: var(--surface-3); color: var(--muted); }

/* Tableau en colonnes (installations des centres) */
.kanban { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); align-items: start; }
.kanban-col { background: var(--surface-2); border-radius: var(--r-lg); padding: .7rem; display: grid; gap: .6rem; }
.kanban-col > h3 { display: flex; justify-content: space-between; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: .15rem .3rem; }
.kanban-card { display: grid; gap: .35rem; padding: .8rem .85rem; border: 1px solid var(--border-2); border-radius: var(--r); background: var(--surface); color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.kanban-card:hover { border-color: var(--accent); transform: translateY(-1px); text-decoration: none; }

/* Choix de la formule (installation, abonnement) */
.offer-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.offer { position: relative; display: flex; flex-direction: column; gap: .7rem; padding: 1.3rem; border: 1.5px solid var(--border-2); border-radius: 18px; background: var(--surface); cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.offer:hover { transform: translateY(-2px); }
.offer.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg), var(--shadow-lg); }
.offer-flag { position: absolute; top: -11px; left: 1.2rem; background: var(--accent); color: #fff; font-size: .66rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: .2rem .6rem; border-radius: 99px; }
.offer-name { font-size: 1.15rem; letter-spacing: -.01em; }
.offer-price { display: flex; align-items: baseline; gap: .45rem; }
.offer-price b { font-size: 1.9rem; letter-spacing: -.04em; }
.offer-price span { font-size: .74rem; color: var(--muted); line-height: 1.25; }
.offer-mods { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; font-size: .84rem; flex: 1; }
.offer-mods li { display: flex; align-items: center; gap: .45rem; }
.offer-mods li .icon { width: 14px; height: 14px; color: var(--success-text); flex: none; }
.offer-mods li.no { color: var(--muted-2); } .offer-mods li.no .icon { color: var(--muted-2); }

/* Menu : modules hors formule, visibles mais verrouillés */
.nav a.nav-locked { opacity: .55; }
.nav a.nav-locked:hover { opacity: .9; }
.nav a.nav-locked { flex-wrap: wrap; row-gap: .15rem; }
.nav a.nav-locked .tag-soon { margin-left: auto; display: inline-flex; align-items: center; gap: .25rem; flex: none; font-size: .58rem; padding: .1rem .35rem; }
.nav a.nav-locked .tag-soon .icon { width: 11px; height: 11px; opacity: 1; }

/* Attente d'un traitement (lecture d'un classeur par l'IA) */
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Cartes : un tableau en haut ou en bas d'une carte suit ses coins arrondis (l'en-tête gris ne dépasse plus) */
.card > .table-wrap:first-child, .card > form:first-child > .table-wrap:first-child { border-radius: calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px) 0 0; }
.card > .table-wrap:last-child, .card > form:last-child > .table-wrap:last-child { border-radius: 0 0 calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px); }
.card > .table-wrap:only-child { border-radius: calc(var(--r-lg) - 1px); }
.card > .card-head:first-child { border-radius: calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px) 0 0; }
.card > .table-wrap:last-child .table tr:last-child td { border-bottom: 0; }

/* Groupe de centres : une carte par centre */
.site-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); margin-bottom: 1.25rem; }
.site-card { display: flex; flex-direction: column; transition: border-color .2s var(--ease), transform .2s var(--ease); }
.site-card:hover { border-color: var(--border-2); transform: translateY(-1px); }
.site-card.is-alert { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.site-card-head { display: flex; gap: .8rem; align-items: center; padding: 1rem 1.15rem; border-bottom: 1px solid var(--border); }
.site-card-head .avatar { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft, var(--surface-3)); color: var(--accent-text); font-size: .9rem; }
.site-card-name { font-size: 1.02rem; display: block; line-height: 1.25; }
.site-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--border); flex: 1; }
.site-metric { background: var(--surface); padding: .75rem .9rem; display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.site-metric strong { font-size: 1.35rem; letter-spacing: -.02em; line-height: 1.1; }
.site-metric-label { font-size: .72rem; color: var(--muted); display: flex; gap: .3rem; align-items: center; line-height: 1.25; }
.site-metric-label .icon { width: 13px; height: 13px; flex: none; }
.site-metric.is-off strong { color: var(--muted-2); font-weight: 500; }
.site-metric.is-warn strong { color: var(--warning-text); }
.site-metric.is-danger strong { color: var(--danger-text); }
.site-card-foot { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .75rem 1.15rem; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px); }
@media (max-width: 520px) { .site-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Prix en crédits d'une analyse, là où elle se lance */
.credit-line { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; padding: .7rem .9rem; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); }
.credit-line-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--surface); color: var(--accent-text); flex: none; }
.credit-line-main { flex: 1 1 220px; min-width: 0; font-size: .9rem; }
.credit-line-left { flex: 0 1 280px; display: flex; flex-direction: column; gap: .3rem; font-size: .82rem; }
.credit-line-bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.credit-line-bar i { display: block; height: 100%; background: var(--success); border-radius: 99px; }
.credit-line.is-low { border-color: color-mix(in srgb, var(--warning) 50%, var(--border)); }
.credit-line.is-low .credit-line-bar i { background: var(--warning); }
.credit-line.is-out { border-color: color-mix(in srgb, var(--danger) 50%, var(--border)); }
.credit-line.is-out .credit-line-bar i { background: var(--danger); }

/* Abonnement : la formule en cours */
.plan-card { display: grid; gap: 1.25rem 2rem; padding: 1.35rem 1.4rem; margin-bottom: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .plan-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); } .plan-mods { grid-column: 1 / -1; } }
.plan-main { display: flex; flex-direction: column; gap: .15rem; }
.plan-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--accent-text); }
.plan-name { font-size: 1.7rem; letter-spacing: -.03em; line-height: 1.1; }
.plan-period { display: flex; flex-direction: column; gap: .45rem; justify-content: center; }
.plan-bar { height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.plan-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #fff)); }
.plan-mods { display: flex; flex-wrap: wrap; gap: .4rem; padding-top: 1rem; border-top: 1px dashed var(--border); }
.plan-mod { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; padding: .3rem .6rem; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); }
.plan-mod .icon { width: 12px; height: 12px; color: var(--success); }
.plan-mod.is-off { color: var(--muted-2); background: transparent; }
.plan-mod.is-off .icon { color: var(--muted-2); }
.pack-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.pack { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.1rem; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); }
.pack-n { font-size: 1.15rem; letter-spacing: -.02em; }

/* Bénéfice : détail des recettes, projection */
.rev-split { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.rev-tile { display: flex; flex-direction: column; gap: .3rem; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); min-width: 0; }
.rev-tile strong { font-size: 1.35rem; letter-spacing: -.02em; }
.rev-tile-label { display: flex; gap: .35rem; align-items: center; font-size: .78rem; color: var(--muted); }
.rev-tile-label .icon { width: 14px; height: 14px; }
.rev-tile-bar { height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.rev-tile-bar i { display: block; height: 100%; }
.cols-2 { display: grid; grid-template-columns: 1fr; }
@media (min-width: 1100px) { .cols-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 1099px) { .cols-2 > div + div { border-left: 0 !important; border-top: 1px solid var(--border); } }
/* deux cartes côte à côte : elles respirent, et ne se collent pas comme les deux moitiés d'une même carte */
.cols-2.cards { gap: 1rem; }
.cols-2.cards > .card { margin: 0; }
@media (max-width: 1099px) { .cols-2.cards > div + div { border-top: 0; } }

/* Lien d'invitation d'un superviseur, à copier à la main */
.invite-link { position: relative; }
.invite-link > summary { list-style: none; cursor: pointer; }
.invite-link > summary::-webkit-details-marker { display: none; }
.invite-link-box { position: absolute; right: 0; top: calc(100% + .4rem); z-index: 20; width: min(440px, 80vw); display: grid; gap: .4rem; padding: .7rem; background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r); box-shadow: var(--shadow-lg, var(--shadow)); }
.invite-link-box .input { font-size: .78rem; font-family: ui-monospace, Consolas, monospace; }

/* Pastille des crédits d'IA, en tête des pages des modules */
.credit-chip { display: inline-flex; align-items: center; gap: .55rem; padding: .35rem .5rem .35rem .4rem; border: 1px solid var(--border-2); border-radius: 12px; background: var(--surface); color: inherit; text-decoration: none !important; line-height: 1.15; transition: border-color .2s var(--ease); }
a.credit-chip:hover { border-color: var(--accent); }
.credit-chip-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-bg); color: var(--accent-text); flex: none; }
.credit-chip-ico .icon { width: 16px; height: 16px; }
.credit-chip-txt { display: flex; flex-direction: column; }
.credit-chip-txt strong { font-size: .9rem; }
.credit-chip-txt span { font-size: .7rem; color: var(--muted); }
.credit-chip-price { font-size: .72rem; font-weight: 600; padding: .2rem .5rem; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); white-space: nowrap; }
.credit-chip.is-low { border-color: color-mix(in srgb, var(--warning) 55%, var(--border)); }
.credit-chip.is-low .credit-chip-ico { background: var(--warning-bg); color: var(--warning-text); }
.credit-chip.is-out { border-color: color-mix(in srgb, var(--danger) 55%, var(--border)); }
.credit-chip.is-out .credit-chip-ico { background: var(--danger-bg); color: var(--danger-text); }
@media (max-width: 560px) { .credit-chip-price { display: none; } }

/* Jauge circulaire des crédits (--p = part restante, en %) */
.credit-ring { --p: 100; --c: var(--success); width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-3) 0); position: relative; }
.credit-ring::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--surface); }
.credit-ring > div { position: relative; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.credit-ring strong { font-size: .62rem; font-weight: 800; letter-spacing: -.02em; }
.credit-ring.is-low { --c: var(--warning); }
.credit-ring.is-out { --c: var(--danger); }
.credit-ring.lg { width: 108px; height: 108px; }
.credit-ring.lg::before { inset: 10px; }
.credit-ring.lg strong { font-size: 1.35rem; }
.credit-ring.lg span { font-size: .7rem; color: var(--muted); margin-top: .2rem; }
.credit-hero { display: flex; gap: 1.4rem; align-items: center; }
@media (max-width: 560px) { .credit-hero { flex-direction: column; align-items: stretch; } .credit-hero .credit-ring.lg { align-self: center; } }

/* Registre réglementaire : les deux volets (commission, sanitaire) */
.tabs.volets a .badge { margin-left: .35rem; }
.nav a .tag-soon { margin-left: auto; font-size: .58rem; padding: .1rem .35rem; border-radius: 99px; background: var(--surface-3); color: var(--muted); letter-spacing: .04em; text-transform: uppercase; font-weight: 700; }

/* RiskWise : formulaire de mise à jour sous la ligne de la vérification */
.dep-row td { padding: 1rem 1.25rem !important; }
.dep-form .dep-title { font-size: .95rem; margin-bottom: .8rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.dep-form .dep-title .icon { color: var(--accent-text); }
.dep-form .file-drop { min-height: 0; }
.rw-filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; border-bottom: 1px solid var(--border); }
.rw-actions { display: flex; flex-direction: column; gap: .35rem; align-items: stretch; min-width: 150px; }
.rw-actions .btn { justify-content: flex-start; white-space: nowrap; }
@media (max-width: 767px) { .rw-actions { min-width: 0; } }

/* Application mobile, écran plein (viewport-fit=cover) : la barre du haut passe sous l'heure et l'encoche sans cela */
.topbar { height: calc(var(--topbar) + env(safe-area-inset-top, 0px)); padding-top: env(safe-area-inset-top, 0px); }
.sidebar { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.main { padding-bottom: env(safe-area-inset-bottom, 0px); }
.auth { padding-top: calc(1.5rem + env(safe-area-inset-top, 0px)); padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px)); }
.view-as-bar { padding-top: calc(.35rem + env(safe-area-inset-top, 0px)); }

/* Sur téléphone, une fiche « libellé / valeur » se lit de haut en bas : la question, puis la réponse dessous */
@media (max-width: 640px) {
  .kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .kv dt { font-size: .8rem; margin-top: .7rem; }
  .kv dt:first-child { margin-top: 0; }
  .kv dd { margin-top: .1rem; }
}

/* Réponses complémentaires d'une demande : une tuile par question, la réponse en évidence */
.answers { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .5rem; }
.answer { display: flex; flex-direction: column; gap: .3rem; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); min-width: 0; }
.answer.wide { grid-column: 1 / -1; }
.answer.yes { border-color: color-mix(in srgb, var(--warning, #f59e0b) 45%, var(--border)); }
.answer .q { font-size: .78rem; color: var(--muted); line-height: 1.35; }
.answer .q .site { display: inline-flex; vertical-align: middle; opacity: .7; }
.answer .q .site svg { width: 12px; height: 12px; }
.answer .a { font-weight: 600; font-size: .9rem; word-break: break-word; }
.answer .a .badge svg { width: 12px; height: 12px; margin-right: .2rem; }
/* une réponse qui découle d'une autre : rattachée à sa question mère, avec le petit embranchement */
.answer-children { display: grid; gap: .4rem; margin-top: .35rem; padding-top: .5rem; border-top: 1px dashed var(--border); }
.answer-child { display: flex; gap: .5rem; align-items: flex-start; padding: .45rem .6rem; border-radius: var(--r-sm); background: color-mix(in srgb, var(--surface) 60%, transparent); border: 1px solid var(--border); }
.answer-child > div { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.answer-child .link { flex: none; color: var(--muted); margin-top: .1rem; }
.answer-child .link svg { width: 14px; height: 14px; }
.answer-child.yes { border-color: color-mix(in srgb, var(--warning, #f59e0b) 45%, var(--border)); }
