/* ============================================================
   ATLAS UI — système de design (mamori data)
   Chargé APRÈS style.css : redéfinit la coque, les composants et les jetons.
   Sections : 1 jetons · 2 base · 3 coque · 4 composants · 5 pages · 6 modules · 7 responsive
   ============================================================ */

/* ── 1. JETONS ─────────────────────────────────────────────── */
:root {
  --font-title: "League Spartan", "Poppins", system-ui, sans-serif;
  --font-text: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --plum-950: #1d0013;
  --plum-900: #2d0019;
  --plum-800: #46102f;
  --plum-700: #5f1a45;
  --magenta: #bc237c;
  --magenta-700: #9d1c68;
  --magenta-100: #fbe6f2;
  --magenta-50: #fdf3f9;
  --violet: #91539d;
  --violet-700: #764084;
  --violet-100: #f0e5f3;
  --turquoise: #1fa6b5;
  --turquoise-100: #dff5f8;
  --amber: #e8960f;
  --amber-100: #fff2d9;
  --green: #1f8a5b;
  --green-100: #e2f4eb;
  --red: #d03b3b;
  --red-100: #fdeaea;
  --blue: #3d6fd1;
  --blue-100: #e6edfb;

  --ink: #211a2a;
  --ink-2: #3b3347;
  --muted: #6b6470;
  --faint: #9b94a3;
  --line: #e9e2ed;
  --line-2: #f2eef5;
  --bg: #f6f3f8;
  --surface: #ffffff;

  --grad-brand: linear-gradient(135deg, #bc237c 0%, #91539d 55%, #2abecc 120%);
  --grad-brand-soft: linear-gradient(135deg, #fbe6f2 0%, #f0e5f3 55%, #dff5f8 120%);
  --grad-plum: linear-gradient(170deg, #2d0019 0%, #46102f 52%, #6e1650 125%);
  --grad-magenta: linear-gradient(135deg, #c92a87 0%, #8f1a63 100%);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --shadow-sm: 0 1px 2px rgba(45, 0, 25, .06);
  --shadow: 0 6px 22px rgba(45, 0, 25, .08);
  --shadow-lg: 0 24px 60px rgba(45, 0, 25, .22);
  --ease: cubic-bezier(.2, .8, .2, 1);

  --sidebar-w: 272px;
  --topbar-h: 64px;

  /* accent du module courant (surchargé par [data-module]) */
  --accent: var(--magenta);
  --accent-100: var(--magenta-100);
  --accent-grad: var(--grad-magenta);

  /* compatibilité avec l'ancienne feuille de style */
  --primary: var(--magenta);
  --primary-dark: var(--magenta-700);
  --gray-50: #faf8fb; --gray-100: #f2eef5; --gray-200: #e9e2ed; --gray-300: #d9d0df; --gray-400: #9b94a3; --gray-500: #6b6470; --gray-600: #4f4858; --gray-700: #3b3347; --gray-800: #2a2233;
  --success: var(--green); --warning: var(--amber); --danger: var(--red); --info: var(--turquoise);
}
[data-module="rgpd"]   { --accent: #bc237c; --accent-100: #fbe6f2; --accent-grad: linear-gradient(135deg, #c92a87, #8f1a63); }
[data-module="cyber"]  { --accent: #91539d; --accent-100: #f0e5f3; --accent-grad: linear-gradient(135deg, #a064ad, #6c3a79); }
[data-module="ria"]    { --accent: #1fa6b5; --accent-100: #dff5f8; --accent-grad: linear-gradient(135deg, #2abecc, #12808d); }
[data-module="gov"]    { --accent: #e8960f; --accent-100: #fff2d9; --accent-grad: linear-gradient(135deg, #f5ac2f, #c47806); }
[data-module="suivi"]  { --accent: #1f8a5b; --accent-100: #e2f4eb; --accent-grad: linear-gradient(135deg, #2aa070, #146b45); }
[data-module="livrables"], [data-module="home"], [data-module="config"] { --accent: #bc237c; --accent-100: #fbe6f2; --accent-grad: var(--grad-brand); }

/* ── 2. BASE ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-text); font-size: 14px; line-height: 1.55; font-weight: 400;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--font-title); font-weight: 700; letter-spacing: -.01em; color: var(--ink); line-height: 1.2; margin: 0; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.05rem; } h4 { font-size: .95rem; }
p { margin: 0 0 .6em; }
a { color: var(--magenta-700); }
button { font-family: inherit; }
::selection { background: var(--magenta-100); color: var(--plum-900); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d9cfe0; border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #c2b3cb; background-clip: content-box; border: 2px solid transparent; }

/* icônes */
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; display: inline-block; }
.ic-wrap { display: inline-flex; align-items: center; vertical-align: middle; line-height: 1; }
.ic-wrap .ic { width: 1.1em; height: 1.1em; vertical-align: 0; }
.ic-lg { width: 1.6em; height: 1.6em; } .ic-xl { width: 2.2em; height: 2.2em; }
.icon-tile {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 40px; height: 40px; border-radius: 12px; background: var(--accent-grad); color: #fff;
  box-shadow: 0 6px 14px -6px var(--accent);
}
.icon-tile { position: relative; }
.icon-tile .ic { position: absolute; left: 50%; top: 50%; width: 56%; height: 56%; transform: translate(-50%, -50%); display: block; margin: 0; vertical-align: baseline; } /* centrage fiable sur Firefox comme sur Chrome */
.icon-tile.soft { background: var(--accent-100); color: var(--accent); box-shadow: none; }
.icon-tile.lg { width: 56px; height: 56px; border-radius: 16px; }
.icon-tile.xl { width: 72px; height: 72px; border-radius: 22px; }

/* ── 3. COQUE ─────────────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; align-self: flex-start; height: 100vh; width: var(--sidebar-w); flex: none;
  background: var(--grad-plum); color: #e9dbe3; display: flex; flex-direction: column; z-index: 40;
  overflow: hidden;
}
.sidebar::before { /* halo de marque */
  content: ""; position: absolute; inset: auto -40% -25% -40%; height: 55%;
  background: radial-gradient(60% 60% at 50% 100%, rgba(188, 35, 124, .45), transparent 70%); pointer-events: none;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 22px 22px 14px; position: relative; }
.sidebar-brand img { height: 30px; width: auto; display: block; }
.sidebar-brand .product {
  font-family: var(--font-title); font-weight: 800; font-size: 1.15rem; letter-spacing: .08em; color: #fff;
  padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, .22); line-height: 1;
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 12px 16px; position: relative; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.nav-section { margin-top: 18px; }
.nav-section:first-child { margin-top: 4px; }
.nav-section-title {
  font-size: .68rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: rgba(233, 219, 227, .5); padding: 0 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border-radius: 12px; border: 0; background: transparent;
  color: #e9dbe3; font: inherit; font-weight: 500; font-size: .9rem; text-align: left; cursor: pointer; text-decoration: none; position: relative;
  transition: background .18s var(--ease), color .18s;
}
.nav-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-item .nav-ic {
  width: 32px; height: 32px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: none;
  background: rgba(255, 255, 255, .08); color: #f3d3e6; transition: all .18s;
}
.nav-item .nav-ic .ic { width: 18px; height: 18px; }
.nav-item .nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .nav-chev { opacity: .5; transition: transform .2s var(--ease); }
.nav-item.active { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.nav-item.active .nav-ic { background: var(--nav-accent, var(--grad-brand)); color: #fff; box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .5); }
.nav-item.active::before { content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: #fff; opacity: .9; }
.nav-item[data-module="rgpd"] { --nav-accent: linear-gradient(135deg, #d6389a, #8f1a63); }
.nav-item[data-module="cyber"] { --nav-accent: linear-gradient(135deg, #ad70b9, #6c3a79); }
.nav-item[data-module="ria"] { --nav-accent: linear-gradient(135deg, #2abecc, #12808d); }
.nav-item[data-module="gov"] { --nav-accent: linear-gradient(135deg, #f5ac2f, #c47806); }
.nav-item[data-module="suivi"] { --nav-accent: linear-gradient(135deg, #2aa070, #146b45); }
.nav-badge { font-size: .68rem; font-weight: 700; background: rgba(255, 255, 255, .16); color: #fff; padding: 1px 7px; border-radius: 999px; }
.sidebar-foot { position: relative; padding: 12px 12px 14px; border-top: 1px solid rgba(255, 255, 255, .08); }
.user-chip {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 14px; background: rgba(255, 255, 255, .06);
  border: 0; color: #fff; font: inherit; cursor: pointer; text-align: left;
}
.user-chip:hover { background: rgba(255, 255, 255, .11); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none;
  background: var(--grad-brand); color: #fff; font-family: var(--font-title); font-weight: 700; font-size: .85rem; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-chip .who { min-width: 0; flex: 1; line-height: 1.25; }
.user-chip .who b { display: block; font-size: .85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .who span { display: block; font-size: .72rem; color: rgba(233, 219, 227, .65); }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: 14px; padding: 0 28px;
  background: rgba(246, 243, 248, .82); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line);
}
.topbar .burger { display: none; }
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: .85rem; color: var(--muted); }
.crumbs b { color: var(--ink); font-weight: 600; font-family: var(--font-title); font-size: 1.05rem; letter-spacing: -.005em; }
.crumbs .sep { opacity: .5; }
.crumbs .ic { width: 14px; height: 14px; }
.topbar .spacer { flex: 1; }
.save-state { display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; color: var(--muted); padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.save-state .ic { width: 15px; height: 15px; color: var(--green); }
.save-state.dirty { color: #8a5500; border-color: #f5d79c; background: var(--amber-100); }
.save-state.dirty .ic { color: var(--amber); }
.save-state.saving .ic { animation: spin 1s linear infinite; color: var(--violet); }
@keyframes spin { to { transform: rotate(360deg); } }
.client-switch { position: relative; }
.client-pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 5px 12px 5px 6px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--line); cursor: pointer; font: inherit; color: var(--ink); max-width: 280px;
}
.client-pill:hover { border-color: #d4c3dc; box-shadow: var(--shadow-sm); }
.client-pill .logo { width: 30px; height: 30px; border-radius: 50%; background: var(--grad-brand-soft); color: var(--magenta-700); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .75rem; overflow: hidden; flex: none; font-family: var(--font-title); }
.client-pill .logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.client-pill .nm { font-weight: 600; font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-pill .sub { display: block; font-size: .68rem; color: var(--muted); font-weight: 400; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow-lg); padding: 8px; z-index: 60; display: none;
}
.menu.open { display: block; animation: pop .16s var(--ease); }
.menu.up { top: auto; bottom: calc(100% + 8px); left: 0; right: 0; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 10px; border: 0; background: transparent; font: inherit; font-size: .86rem; color: var(--ink); cursor: pointer; text-align: left; }
.menu-item:hover { background: var(--magenta-50); }
.menu-item.active { background: var(--magenta-100); color: var(--magenta-700); font-weight: 600; }
.menu-item .ic { color: var(--muted); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu-title { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); font-weight: 600; padding: 6px 12px 4px; }

#main-content { flex: 1; width: 100%; max-width: 1360px; margin: 0 auto; padding: 28px 32px 64px; outline: none; }
.scrim { display: none; }

/* ── 4. COMPOSANTS ───────────────────────────────────────── */
/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 18px; border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: .86rem; line-height: 1.2; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .15s var(--ease), box-shadow .2s, background .2s, border-color .2s, color .2s; position: relative; overflow: visible;
}
.btn::before { display: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent-grad); color: #fff; box-shadow: 0 8px 18px -8px var(--accent); }
.btn-primary:hover { box-shadow: 0 12px 24px -8px var(--accent); transform: translateY(-1px); filter: brightness(1.04); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--ink-2); border-color: var(--line); }
.btn-secondary:hover { border-color: #cdb9d6; background: var(--magenta-50); color: var(--magenta-700); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--line-2); color: var(--ink); }
.btn-success { background: var(--green); color: #fff; }
.btn-danger { background: var(--red-100); color: var(--red); border-color: transparent; }
.btn-danger:hover { background: #fbd5d5; color: #b02a2a; }
.btn-danger-solid { background: var(--red); color: #fff; }
.btn-sm { min-height: 32px; padding: 5px 12px; font-size: .78rem; border-radius: 10px; gap: 6px; }
.btn-lg { min-height: 48px; padding: 10px 26px; font-size: .95rem; border-radius: 14px; }
.btn-icon { min-height: 34px; width: 34px; padding: 0; border-radius: 10px; background: transparent; color: var(--muted); border: 1px solid transparent; }
.btn-icon:hover { background: var(--magenta-50); color: var(--magenta-700); }
.btn-icon.btn-danger:hover { background: var(--red-100); color: var(--red); }
.btn .ic { width: 1.1em; height: 1.1em; }
.btn-add-inline { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 10px; border: 1px dashed #cdb9d6; background: transparent; color: var(--magenta-700); font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; }
.btn-add-inline:hover { background: var(--magenta-50); border-style: solid; }
.btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Formulaires */
.form-group { margin-bottom: 16px; }
.form-group > label, label.field-label { display: block; font-size: .78rem; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; letter-spacing: .01em; }
.form-control, .form-input, input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="url"], input[type="search"], input[type="tel"], select, textarea {
  width: 100%; min-height: 42px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink);
  font: inherit; font-size: .88rem; transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { min-height: 92px; 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' viewBox='0 0 24 24' fill='none' stroke='%236b6470' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.form-control:hover, input:hover, select:hover, textarea:hover { border-color: #d4c6dc; }
.form-control:focus, input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--accent); flex: none; cursor: pointer; }
input[type="file"] { padding: 8px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 18px; }
.form-hint, .config-section-desc { font-size: .78rem; color: var(--muted); margin: -2px 0 10px; }
.form-section { padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); margin-bottom: 16px; }
.form-section-title { display: flex; align-items: center; gap: 10px; font-family: var(--font-title); font-size: 1rem; font-weight: 700; margin: 0 0 14px; color: var(--ink); }
.form-actions, .modal-footer, .modal-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.checkbox-label, .radio-label, .config-checkbox-label {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
  font-size: .85rem; cursor: pointer; margin: 0 8px 8px 0; transition: all .15s; font-weight: 500; color: var(--ink-2);
}
.checkbox-label:hover, .radio-label:hover { border-color: #cdb9d6; background: var(--magenta-50); }
.checkbox-label:has(input:checked), .radio-label:has(input:checked), .config-checkbox-label:has(input:checked) { border-color: var(--accent); background: var(--accent-100); color: var(--ink); }
.checkboxes-container { display: flex; flex-wrap: wrap; }

/* Cartes */
.card, .dashboard-card, .score-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 20px 22px; position: relative;
  transition: box-shadow .2s, transform .2s var(--ease), border-color .2s;
}
.card::before { display: none; }
.card:hover { box-shadow: var(--shadow); transform: none; }
.card-title, .section-title { font-family: var(--font-title); font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: 10px; margin: 0 0 4px; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

/* Badges */
.badge, .conf-badge, .ref-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: .72rem; font-weight: 600; line-height: 1.6;
  background: var(--line-2); color: var(--ink-2); border: 0; letter-spacing: .01em; white-space: nowrap;
}
.badge .ic { width: 12px; height: 12px; }
.badge-primary { background: var(--magenta-100); color: var(--magenta-700); }
.badge-success { background: var(--green-100); color: var(--green); }
.badge-warning { background: var(--amber-100); color: #9a5f00; }
.badge-danger { background: var(--red-100); color: var(--red); }
.badge-info { background: var(--turquoise-100); color: #0f7783; }
.badge-secondary { background: var(--violet-100); color: var(--violet-700); }
.badge-muted { background: var(--line-2); color: var(--muted); }

/* Tableaux */
table { border-collapse: separate; border-spacing: 0; width: 100%; }
th { text-align: left; font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 14px; background: #fbf9fc; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); font-size: .86rem; vertical-align: middle; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--magenta-50); }
tbody tr:last-child td { border-bottom: 0; }
.table-wrap, .aipd-table-container, .durees-table-container, .tableau-wrapper { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: auto; box-shadow: var(--shadow-sm); }
.table-wrap th:first-child, .aipd-table-container th:first-child { border-top-left-radius: var(--radius-lg); }

/* Modales */
.modal, .modal-overlay { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(29, 0, 19, .5); backdrop-filter: blur(6px); }
.modal.active, .modal-overlay.active { display: flex; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal-content {
  background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); width: min(640px, 100%); max-height: calc(100vh - 48px); overflow: auto; padding: 0;
  animation: rise .26s var(--ease); border: 0;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-small .modal-content, .modal-content.modal-small { width: min(460px, 100%); }
.modal-large .modal-content, .modal-content.modal-large { width: min(860px, 100%); }
.modal-xlarge .modal-content, .modal-content.modal-xlarge { width: min(1040px, 100%); }
.modal-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 26px 16px; position: sticky; top: 0; z-index: 2; background: var(--surface);
  border-bottom: 1px solid var(--line-2); margin: 0;
}
.modal-header h2, .modal-title, .modal-content > h2 { font-family: var(--font-title); font-size: 1.25rem; margin: 0; }
.modal-content > form, .modal-body, .modal-content > .modal-body { padding: 22px 26px 26px; }
.modal-content > h2 { padding: 22px 26px 0; }
.modal-close, .close, button.modal-close {
  width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--line-2); color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; line-height: 1; padding: 0;
}
.modal-close:hover, .close:hover { background: var(--magenta-100); color: var(--magenta-700); }
.modal-footer { padding: 16px 26px 20px; margin: 0; border-top: 1px solid var(--line-2); position: sticky; bottom: 0; background: var(--surface); }

/* Toasts */
#toast-container, .toast-container { position: fixed; right: 20px; top: 20px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 12px; min-width: 280px; max-width: 380px; padding: 12px 16px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-lg); border: 1px solid var(--line); animation: toastin .28s var(--ease); }
@keyframes toastin { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes fadeOut { to { opacity: 0; transform: translateX(16px); } }
.toast .toast-icon { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.toast .toast-icon .ic { width: 17px; height: 17px; }
.toast-success .toast-icon { background: var(--green-100); color: var(--green); }
.toast-error .toast-icon { background: var(--red-100); color: var(--red); }
.toast-warning .toast-icon { background: var(--amber-100); color: var(--amber); }
.toast-info .toast-icon { background: var(--turquoise-100); color: var(--turquoise); }
.toast-title { font-weight: 600; font-size: .85rem; } .toast-message { font-size: .8rem; color: var(--muted); }

/* États vides */
.empty-state, .dashboard-empty, .empty-message {
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 40px 20px; color: var(--muted); font-size: .88rem;
}
.empty-state-icon { width: 64px; height: 64px; border-radius: 20px; background: var(--accent-100); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; }
.empty-state-icon .ic { width: 30px; height: 30px; }

/* Onglets de page */
.page-tabs { display: flex; gap: 4px; overflow-x: auto; margin: 0 0 22px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; width: fit-content; max-width: 100%; box-shadow: var(--shadow-sm); scrollbar-width: none; }
.page-tab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 12px; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: .84rem; cursor: pointer; white-space: nowrap; transition: all .15s; }
.page-tab:hover { color: var(--ink); background: var(--line-2); }
.page-tab.active { background: var(--accent-grad); color: #fff; box-shadow: 0 6px 14px -6px var(--accent); }
.page-tab .ic { width: 16px; height: 16px; }

/* En-tête de page */
.page-head { display: flex; align-items: center; gap: 16px; margin: 0 0 22px; flex-wrap: wrap; }
.page-head .titles { min-width: 0; flex: 1; }
.page-head h1 { font-size: 1.6rem; display: flex; align-items: center; gap: 10px; }
.page-head p { margin: 2px 0 0; color: var(--muted); font-size: .88rem; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.toolbar .spacer { flex: 1; }
.toolbar select, .toolbar input[type="search"], .toolbar input[type="text"] { width: auto; min-width: 180px; min-height: 40px; }
.search-field { position: relative; }
.search-field .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 16px; height: 16px; }
.search-field input { padding-left: 38px; }

/* Structure des onglets/panneaux (les règles historiques restent valables) */
.tab-content { display: none; }
.tab-content.active { display: block; animation: tabin .28s var(--ease); }
@keyframes tabin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.subtab-content { display: none; }
.subtab-content.active { display: block; }
.secondary-tab-btn { display: none !important; }

/* Utilitaires */
.muted { color: var(--muted); } .faint { color: var(--faint); }
.flex { display: flex; } .items-center { align-items: center; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .grow { flex: 1; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.stack > * + * { margin-top: 14px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { background: var(--plum-900); }

/* ── 7. RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 1024px) {
  #main-content { padding: 22px 20px 56px; }
  .topbar { padding: 0 16px; }
}
@media (max-width: 860px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; transform: translateX(-102%); transition: transform .26s var(--ease); width: min(86vw, 320px); box-shadow: var(--shadow-lg); }
  .app-shell.nav-open .sidebar { transform: none; }
  .app-shell.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(29, 0, 19, .5); backdrop-filter: blur(3px); z-index: 35; }
  .topbar .burger { display: inline-flex; }
  .topbar .client-pill .nm-wrap { display: none; }
  .save-state .txt { display: none; }
  .page-head h1 { font-size: 1.35rem; }
  .modal, .modal-overlay { padding: 0; align-items: flex-end; }
  .modal-content { width: 100% !important; max-height: 94vh; border-radius: 22px 22px 0 0; }
  .form-row { grid-template-columns: 1fr; }
  input, select, textarea { font-size: 16px; }
}
@media (pointer: coarse) { .nav-item, .page-tab, .menu-item { min-height: 44px; } }
@media print { .sidebar, .topbar, .scrim, #toast-container { display: none !important; } #main-content { max-width: none; padding: 0; } }

/* ── Composants de données (ui.js) ─────────────────────────── */
.kpi-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.kpi-ic { width: 44px; height: 44px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; flex: none; background: color-mix(in srgb, var(--kc, var(--magenta)) 13%, white); color: var(--kc, var(--magenta)); }
.kpi-ic .ic { width: 22px; height: 22px; }
.kpi-val { font-family: var(--font-title); font-weight: 800; font-size: 1.6rem; line-height: 1; letter-spacing: -.02em; }
.kpi-lbl { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.kpi-hint { font-size: .72rem; color: var(--faint); }
.bar { height: 8px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; transition: width .5s var(--ease); }
.ring { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ring svg { width: 100%; height: 100%; }
.ring-bg { fill: none; stroke: var(--line-2); stroke-width: 9; }
.ring-fg { fill: none; stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset .8s var(--ease); }
.ring-val { position: absolute; font-family: var(--font-title); font-weight: 800; font-size: 1.35rem; letter-spacing: -.02em; }
.ring-val small { font-size: .6em; margin-left: 1px; opacity: .7; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line-2); cursor: pointer; border-radius: 10px; transition: background .12s; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--magenta-50); }
.list-row .grow { min-width: 0; }
.list-row .t { font-weight: 600; font-size: .88rem; }
.list-row .s { font-size: .76rem; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--faint); }
.dot.ok { background: var(--green); } .dot.warn { background: var(--amber); } .dot.bad { background: var(--red); } .dot.info { background: var(--turquoise); }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); }
.tag .ic { width: 12px; height: 12px; }
.section-gap { margin-top: 22px; }
.form-group.full { grid-column: 1 / -1; }

/* ── Accueil ───────────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden; border-radius: var(--radius-xl); padding: 30px 34px; color: #fff; background: var(--grad-plum);
  display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center; box-shadow: var(--shadow);
}
.hero::before { content: ""; position: absolute; width: 520px; height: 520px; right: -140px; top: -220px; background: radial-gradient(closest-side, rgba(188, 35, 124, .55), transparent); }
.hero::after { content: ""; position: absolute; width: 420px; height: 420px; left: 30%; bottom: -260px; background: radial-gradient(closest-side, rgba(42, 190, 204, .28), transparent); }
.hero > * { position: relative; z-index: 1; }
.hero .eyebrow { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; color: rgba(255, 255, 255, .62); display: flex; align-items: center; gap: 8px; }
.hero h1 { color: #fff; font-size: 2.1rem; margin: 8px 0 6px; font-weight: 800; }
.hero p { color: rgba(255, 255, 255, .78); max-width: 52ch; margin: 0 0 18px; }
.hero .stage-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: 999px; background: rgba(255, 255, 255, .12); font-weight: 600; font-size: .82rem; backdrop-filter: blur(6px); }
.hero .stage-chip .ic { width: 28px; height: 28px; padding: 6px; border-radius: 50%; background: var(--stage, #fff); color: #fff; }
.hero .ring { background: rgba(255, 255, 255, .06); border-radius: 50%; }
.hero .ring-bg { stroke: rgba(255, 255, 255, .15); }
.hero .ring-val { color: #fff; font-size: 2.1rem; }
.hero .hero-ring-wrap { text-align: center; }
.hero .hero-ring-wrap .cap { margin-top: 8px; font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .6); }
.presta-card { display: flex; flex-direction: column; gap: 14px; padding: 20px; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.presta-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, white); box-shadow: var(--shadow); transform: translateY(-2px); }
.presta-card .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.presta-card h3 { font-size: 1.05rem; margin-top: 12px; }
.presta-card .sub { font-size: .76rem; color: var(--muted); margin-top: 2px; }
.presta-card .foot { display: flex; align-items: center; justify-content: space-between; font-size: .76rem; color: var(--muted); margin-top: auto; }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; padding: 24px; } .hero h1 { font-size: 1.6rem; } }

/* ── Composants des modules (RIA, gouvernance, suivi) ──────── */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.sticky { position: sticky; top: calc(var(--topbar-h) + 18px); }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } .sticky { position: static; } }
.qa { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 0; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.qa:last-child { border-bottom: 0; }
.qa-q { flex: 1; min-width: 240px; font-size: .88rem; }
.seg { display: inline-flex; padding: 3px; background: var(--line-2); border-radius: 12px; gap: 2px; flex: none; }
.seg-btn { border: 0; background: transparent; padding: 6px 14px; border-radius: 9px; font: inherit; font-size: .78rem; font-weight: 600; color: var(--muted); cursor: pointer; transition: all .15s; }
.seg-btn:hover:not(:disabled) { color: var(--ink); }
.seg-btn.on { background: #fff; box-shadow: var(--shadow-sm); color: var(--ink); }
.seg-btn.on.oui { color: var(--green); } .seg-btn.on.non { color: var(--red); } .seg-btn.on.nsp { color: var(--amber); }
.seg-btn:disabled { cursor: default; opacity: .7; }
.callout { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 12px; font-size: .83rem; margin-bottom: 8px; background: var(--line-2); color: var(--ink-2); }
.callout .ic { margin-top: 2px; flex: none; }
.callout.ok { background: var(--green-100); color: #14633f; } .callout.warn { background: var(--amber-100); color: #8a5500; }
.callout.bad { background: var(--red-100); color: #a02a2a; } .callout.info { background: var(--turquoise-100); color: #0f6a75; }
.timeline { display: flex; flex-direction: column; gap: 14px; position: relative; padding-left: 4px; }
.tl-item { display: flex; gap: 14px; align-items: flex-start; position: relative; }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); margin-top: 5px; flex: none; box-shadow: 0 0 0 4px var(--accent-100); }
.tl-item:not(:last-child)::after { content: ""; position: absolute; left: 5px; top: 20px; bottom: -14px; width: 2px; background: var(--line); }
.flowcard { padding: 18px 20px; }
.flowrow { display: grid; grid-template-columns: 1fr auto 1fr auto 1.2fr; gap: 14px; align-items: center; }
.flowcol { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.flowlabel { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); font-weight: 600; }
.flownode { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 10px; background: var(--line-2); font-size: .82rem; font-weight: 500; }
.flownode.strong { background: var(--accent-grad); color: #fff; font-weight: 600; }
.flownode.warn { background: var(--amber-100); color: #8a5500; }
.flowarrow { color: var(--accent); opacity: .7; }
@media (max-width: 860px) { .flowrow { grid-template-columns: 1fr; } .flowarrow { transform: rotate(90deg); justify-self: center; } }
.flux-row { display: grid; grid-template-columns: 1.4fr 1.4fr 120px 36px; gap: 8px; margin-bottom: 8px; }
@media (max-width: 700px) { .flux-row { grid-template-columns: 1fr; } }
.st-select { min-width: 150px; font-weight: 600; }
.st-select.conforme { color: var(--green); border-color: #bfe3d1; background-color: var(--green-100); }
.st-select.partiel { color: #8a5500; border-color: #f2d79b; background-color: var(--amber-100); }
.st-select.non_conforme { color: var(--red); border-color: #f1c1c1; background-color: var(--red-100); }
.st-select.na, .st-select.nd { color: var(--muted); }
.table-wrap td input[type="text"], .table-wrap td select { min-height: 36px; padding: 6px 10px; font-size: .82rem; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.stack > * + * { margin-top: 0; }

.road { position: relative; display: flex; flex-direction: column; gap: 14px; padding-left: 8px; }
.road::before { content: ""; position: absolute; left: 22px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.road-item { position: relative; display: flex; gap: 16px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px 14px 14px; box-shadow: var(--shadow-sm); }
.road-dot { width: 30px; height: 30px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--line-2); color: var(--muted); border: 2px solid var(--surface); z-index: 1; }
.road-dot .ic { width: 16px; height: 16px; }
.road-item.termine .road-dot { background: var(--green); color: #fff; } .road-item.en_cours .road-dot { background: var(--turquoise); color: #fff; } .road-item.bloque .road-dot { background: var(--red); color: #fff; }
.road-body { flex: 1; min-width: 0; } .road-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }

/* ── Référentiels ──────────────────────────────────────────── */
.ref-tabs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.ref-tab { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font: inherit; text-align: left; color: inherit; transition: all .15s; }
.ref-tab:hover { border-color: #d4c3dc; box-shadow: var(--shadow-sm); }
.ref-tab.active { border-color: var(--accent); background: var(--accent-100); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.ref-tab small, .ref-dom-head small { display: block; color: var(--muted); font-size: .72rem; font-weight: 400; }
.ref-dom { padding: 0; overflow: hidden; }
.ref-dom-head { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 18px; border: 0; background: transparent; font: inherit; cursor: pointer; text-align: left; color: inherit; }
.ref-dom-head:hover { background: var(--magenta-50); }
.ref-crit { border-top: 1px solid var(--line-2); }
.ref-row { display: grid; grid-template-columns: minmax(0, 2.2fr) 170px minmax(0, 1.6fr) 90px; gap: 14px; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--line-2); }
.ref-row:last-child { border-bottom: 0; }
.ref-label { font-size: .85rem; } .ref-date { font-size: .75rem; text-align: right; }
.st-select.ref-conforme { color: var(--green); background-color: var(--green-100); border-color: #bfe3d1; }
.st-select.ref-en_cours { color: #0f6a75; background-color: var(--turquoise-100); border-color: #b9e3e8; }
.st-select.ref-non_conforme { color: var(--red); background-color: var(--red-100); border-color: #f1c1c1; }
.ref-row select, .ref-row input { min-height: 36px; padding: 6px 10px; font-size: .82rem; }
@media (max-width: 900px) { .ref-row { grid-template-columns: 1fr; gap: 8px; } .ref-date { text-align: left; } }

/* ── Configuration ─────────────────────────────────────────── */
.logo-field { display: flex; align-items: center; gap: 16px; }
.logo-preview { width: 84px; height: 84px; border-radius: 18px; border: 1px dashed #d2c3da; background: var(--line-2); display: inline-flex; align-items: center; justify-content: center; overflow: hidden; color: var(--faint); flex: none; }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; background: #fff; } .logo-preview .ic { width: 28px; height: 28px; }
.presta-toggle { padding: 18px 20px; transition: border-color .2s, box-shadow .2s; }
.presta-toggle:not(.on) { background: #fcfbfd; } .presta-toggle:not(.on) .icon-tile { background: var(--line); color: var(--faint); box-shadow: none; }
.presta-toggle.on { border-color: color-mix(in srgb, var(--accent) 40%, white); }
.presta-head { display: flex; align-items: center; gap: 16px; }
.presta-sub { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line); }
.switch { position: relative; display: inline-block; width: 48px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.slider { position: absolute; inset: 0; border-radius: 999px; background: #d9d0df; transition: .2s; cursor: pointer; }
.slider::before { content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: .2s var(--ease); }
.switch input:checked + .slider { background: var(--accent-grad); } .switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:focus-visible + .slider { outline: 3px solid color-mix(in srgb, var(--accent) 40%, white); outline-offset: 2px; }
.switch input:disabled + .slider { opacity: .5; cursor: not-allowed; }
.matrix { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.mx-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.mx-row:last-child { border-bottom: 0; } .mx-lab { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; font-size: .86rem; }
.mx-sub { background: #fbf9fc; border-top: 1px solid var(--line); padding: 8px 0 2px; } .mx-sub .mx-row { padding-left: 34px; }
.export-title { display: flex; align-items: center; gap: 8px; font-family: var(--font-title); font-weight: 700; margin-bottom: 10px; }
.btn-x { border: 0; background: transparent; cursor: pointer; padding: 0; margin-left: 4px; color: var(--muted); display: inline-flex; } .btn-x:hover { color: var(--red); }
.field-label { display: block; font-size: .78rem; font-weight: 600; margin-bottom: 6px; }

/* ── Accessibilité transverse ──────────────────────────────── */
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 70%, white) !important; outline-offset: 2px !important; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0 !important; }
.skip-link { position: absolute; left: 8px; top: -56px; z-index: 3000; padding: 10px 16px; color: #fff; border-radius: 10px; text-decoration: none; transition: top .15s ease; }
.skip-link:focus { top: 8px; }
[role="button"] { cursor: pointer; }
img, svg, video, canvas { max-width: 100%; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

/* ── Liste des traitements ─────────────────────────────────── */
.trait-list { display: flex; flex-direction: column; gap: 10px; }
.trait-row { position: relative; display: flex; align-items: center; gap: 16px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); cursor: pointer; transition: all .15s var(--ease); }
.trait-row:hover { border-color: #d4c3dc; box-shadow: var(--shadow); transform: translateY(-1px); }
.trait-row.selected { border-color: var(--accent); background: var(--accent-100); }
.trait-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.trait-main b { font-size: .95rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trait-svc { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); }
.trait-svc .ic { width: 14px; height: 14px; }
.trait-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.trait-go { color: var(--faint); }
@media (max-width: 760px) { .trait-row { flex-wrap: wrap; } .trait-tags { justify-content: flex-start; width: 100%; } }
.batch-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 12px; border-radius: var(--radius); background: var(--grad-plum); color: #fff; font-size: .85rem; font-weight: 600; position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 10; box-shadow: var(--shadow); }
.batch-bar .btn { background: #fff; color: var(--ink); } .batch-bar .btn-danger-solid { background: var(--red); color: #fff; }
.batch-bar .batch-ghost { background: rgba(255, 255, 255, .15); color: #fff; }
.batch-bar .btn:disabled { opacity: .45; }
.stackbar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--line-2); gap: 2px; }
.stackbar > span { min-width: 8px; } .seg-ok { background: var(--green); } .seg-info { background: var(--turquoise); } .seg-warn { background: var(--amber); } .seg-bad { background: var(--red); } .seg-muted { background: #cbc2d3; }
.stack-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: .78rem; color: var(--muted); } .stack-legend span { display: inline-flex; align-items: center; gap: 7px; } .stack-legend .dot { background: #cbc2d3; }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: .86rem; } .kv:last-child { border-bottom: 0; } .kv span { color: var(--muted); } .kv b { font-weight: 600; text-align: right; }
.carto-svg-zone { min-height: 220px; display: flex; align-items: center; justify-content: center; }
.star-on { color: #e8960f; fill: currentColor; width: 1em; height: 1em; }
.search-field { flex: 1 1 260px; max-width: 380px; min-width: 200px; }
.search-field input { width: 100%; }
.toolbar select { flex: 0 1 220px; }

/* ── Fiche détail d'un traitement ───────────────────────────── */
.detail-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; margin-top: 16px; }
.dsec { background: #fbf9fc; border: 1px solid var(--line-2); border-radius: var(--radius-lg); padding: 16px 18px; }
.dsec h3 { display: flex; align-items: center; gap: 9px; font-size: .95rem; margin-bottom: 12px; } .dsec h3 .ic { color: var(--accent); }
.dsec p { font-size: .88rem; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; margin: 0 6px 6px 0; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: .78rem; font-weight: 500; color: var(--ink-2); }
.chip-warn { background: var(--amber-100); border-color: #f2d79b; color: #8a5500; } .chip-brand { background: var(--magenta-100); border-color: #f1c4de; color: var(--magenta-700); }
.dcp-cat { margin-bottom: 10px; } .dcp-cat-t { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 600; margin-bottom: 4px; }
.dsec .table-wrap { margin: 8px 0; box-shadow: none; } .dsec .kv b { text-align: right; }
.modal-footer .seg { margin-right: 4px; }
@media (max-width: 760px) { .detail-grid { grid-template-columns: 1fr; } }

/* ── Parcours par étapes (formulaire traitement) ───────────── */
.stepper { display: flex; gap: 6px; padding: 14px 26px; overflow-x: auto; border-bottom: 1px solid var(--line-2); background: #fbf9fc; position: sticky; top: 73px; z-index: 2; scrollbar-width: none; }
.step { display: inline-flex; align-items: center; gap: 9px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: .78rem; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.step-n { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--line-2); font-size: .72rem; }
.step-n .ic { width: 13px; height: 13px; }
.step.active { color: #fff; border-color: transparent; background: var(--accent-grad); box-shadow: 0 6px 14px -6px var(--accent); } .step.active .step-n { background: rgba(255, 255, 255, .25); }
.step.done { color: var(--green); } .step.done .step-n { background: var(--green-100); color: var(--green); }
.form-section[hidden] { display: none !important; }
#form-traitement-v2 .form-section { border: 0; padding: 4px 0; margin: 0; background: transparent; }
#form-traitement-v2 .form-section-title { display: none; }
#form-traitement-v2 { padding: 22px 26px 0; }
#form-traitement-v2 .form-actions { position: sticky; bottom: 0; background: var(--surface); padding: 14px 0 18px; margin: 22px 0 0; border-top: 1px solid var(--line-2); }

/* ── Cybersécurité ─────────────────────────────────────────── */
.fiche { display: flex; flex-direction: column; gap: 14px; }
.fiche-head { display: flex; align-items: center; gap: 12px; } .fiche-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.stars { display: inline-flex; color: var(--amber); } .stars .star-off { color: #e3dce8; fill: none; } .stars .ic { width: 15px; height: 15px; }
.fiche-actions { display: flex; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line-2); margin-top: auto; }
.radar-wrap { display: flex; justify-content: center; } .radar-wrap svg { max-width: 360px; width: 100%; height: auto; }
.card-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

/* ── Documents, liens ──────────────────────────────────────── */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.cat-tile { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 14px; cursor: pointer; text-align: center; font: inherit; color: inherit; }
.cat-tile:hover { border-color: color-mix(in srgb, var(--accent) 40%, white); box-shadow: var(--shadow); transform: translateY(-2px); }
.cat-tile.active { border-color: var(--accent); background: var(--accent-100); }
.cat-tile b { font-family: var(--font-title); font-size: .98rem; } .cat-tile .muted { font-size: .76rem; }
.doc-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .82rem; color: var(--magenta-700); text-decoration: none; }
.doc-link:hover { text-decoration: underline; }
.modal-content > [id$="-container"], .modal-content > #modal-detail-card-contenu, .modal-content > #modal-ressource-contenu { padding: 22px 26px 26px; }
.modal-content form .form-actions { margin-top: 18px; }

/* ── Écrans d'accès (connexion, accès refusé…) ─────────────── */
.auth-screen { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 24px; overflow: auto;
  background: radial-gradient(60% 55% at 15% 10%, rgba(188, 35, 124, .45), transparent 70%), radial-gradient(55% 50% at 90% 95%, rgba(42, 190, 204, .25), transparent 70%), var(--plum-950); }
.auth-card { display: grid; grid-template-columns: 1.05fr 1fr; width: min(940px, 100%); background: var(--surface); border-radius: 28px; overflow: hidden; box-shadow: 0 40px 100px rgba(0, 0, 0, .5); }
.auth-card.auth-single { grid-template-columns: 1fr; width: min(480px, 100%); }
.auth-brand { position: relative; padding: 38px 36px; color: #fff; background: var(--grad-plum); display: flex; flex-direction: column; justify-content: space-between; gap: 28px; overflow: hidden; }
.auth-brand::before { content: ""; position: absolute; inset: auto -30% -35% -30%; height: 70%; background: radial-gradient(60% 60% at 50% 100%, rgba(188, 35, 124, .6), transparent 70%); }
.auth-brand > * { position: relative; }
.auth-logo { height: 40px; width: auto; align-self: flex-start; }
.auth-brand h2 { color: #fff; font-size: 2.4rem; font-weight: 800; letter-spacing: .06em; margin-bottom: 10px; }
.auth-brand p { color: rgba(255, 255, 255, .78); max-width: 34ch; }
.auth-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: .86rem; }
.auth-points li { display: flex; align-items: center; gap: 10px; color: rgba(255, 255, 255, .88); } .auth-points .ic { color: #f0a8d3; }
.auth-form { padding: 44px 40px; display: flex; flex-direction: column; justify-content: center; }
.auth-form h1 { font-size: 1.8rem; margin-bottom: 4px; } .auth-form > p { margin-bottom: 22px; }
@media (max-width: 760px) { .auth-card { grid-template-columns: 1fr; } .auth-brand { padding: 26px; } .auth-brand .auth-points, .auth-brand p { display: none; } .auth-brand h2 { font-size: 1.6rem; margin: 0; } .auth-form { padding: 28px 24px; } }

/* ── Cartographie des traitements ──────────────────────────── */
.carto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; width: 100%; }
.carto-tile { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; font: inherit; color: inherit; border-left: 4px solid var(--faint); transition: all .15s var(--ease); }
.carto-tile:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.carto-tile.tone-ok { border-left-color: var(--green); } .carto-tile.tone-warn { border-left-color: var(--amber); } .carto-tile.tone-bad { border-left-color: var(--red); }
.carto-ic { width: 32px; height: 32px; border-radius: 10px; background: var(--line-2); display: inline-flex; align-items: center; justify-content: center; color: var(--muted); } .carto-ic .ic { width: 17px; height: 17px; }
.carto-tile b { font-size: .88rem; line-height: 1.25; } .carto-meta { font-size: .72rem; color: var(--muted); }
.carto-tile .bar { width: 100%; margin-top: 2px; height: 6px; }
.carto-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; font-size: .75rem; color: var(--muted); } .carto-legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ── Fichiers chiffrés ─────────────────────────────────────── */
.file-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 220px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink-2); font: inherit; font-size: .78rem; font-weight: 500; cursor: pointer; transition: all .15s; }
.file-chip:hover { border-color: var(--magenta); color: var(--magenta-700); background: var(--magenta-50); }
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .file-chip .ic { width: 15px; height: 15px; flex: none; }
.file-current { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-bottom: 6px; border-radius: 10px; background: var(--line-2); font-size: .8rem; }
.file-current .ic { width: 15px; height: 15px; color: var(--muted); }

/* ── Feuille de route : statuts datés ─────────────────────── */
.road::before { display: none; } .road { padding-left: 0; }
.road-item { padding: 16px 18px; }
.road-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.road-sum { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: .78rem; background: var(--line-2); color: var(--ink-2); }
.road-sum .ic { width: 15px; height: 15px; } .road-sum.tone-info { background: var(--turquoise-100); color: #0f6a75; } .road-sum.tone-warn { background: var(--amber-100); color: #8a5500; } .road-sum.tone-ok { background: var(--green-100); color: #14633f; } .road-sum.tone-violet { background: var(--violet-100); color: var(--violet-700); }
.road-status { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 8px; }
.road-chip { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font: inherit; font-size: .76rem; font-weight: 600; cursor: pointer; transition: all .15s; }
.road-chip .ic { width: 14px; height: 14px; }
.road-chip:hover:not(:disabled) { border-color: var(--ink-2); color: var(--ink); } .road-chip:disabled { cursor: default; }
.road-chip.past { background: var(--line-2); color: var(--ink-2); }
.road-chip.on.tone-muted { background: var(--ink-2); border-color: var(--ink-2); color: #fff; } .road-chip.on.tone-info { background: var(--turquoise); border-color: var(--turquoise); color: #fff; } .road-chip.on.tone-warn { background: var(--amber); border-color: var(--amber); color: #fff; } .road-chip.on.tone-ok { background: var(--green); border-color: var(--green); color: #fff; } .road-chip.on.tone-violet { background: var(--violet); border-color: var(--violet); color: #fff; }
.road-chip[data-tip]::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%) translateY(4px); width: max-content; max-width: 240px; padding: 6px 10px; border-radius: 9px; background: var(--plum-900); color: #fff; font-size: .72rem; font-weight: 500; line-height: 1.3; text-align: center; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; z-index: 30; box-shadow: var(--shadow); }
.road-chip[data-tip]:hover::after, .road-chip[data-tip]:focus-visible::after { opacity: 1; transform: translateX(-50%); }
.road-prog { display: flex; align-items: center; gap: 10px; } .road-prog .bar { flex: 1; } .road-prog .muted { font-size: .72rem; min-width: 2.6em; text-align: right; }

/* ── Accueil : bloc « Suivi de prestation » ────────────────── */
.suivi-block { border-left: 4px solid var(--green); }
.suivi-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; } .suivi-head h3 { margin: 0; font-size: 1.15rem; } .suivi-head .grow { flex: 1; min-width: 200px; }
.suivi-lines { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.suivi-line .nm { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: .86rem; } .suivi-line .bars { margin-bottom: 6px; } .suivi-line .bars .muted { display: block; font-size: .72rem; margin-top: 2px; }

/* ── Éléments communs ─────────────────────────────────────── */
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 28px; } .kv-grid .kv b { text-align: right; }
.chips { display: flex; flex-wrap: wrap; } .date-chip { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: var(--grad-brand); color: #fff; flex: none; line-height: 1; } .date-chip b { font-family: var(--font-title); font-size: 1.1rem; } .date-chip small { font-size: .6rem; text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }

/* ── AIPD ─────────────────────────────────────────────────── */
.aipd-card { cursor: pointer; transition: transform .15s, box-shadow .15s; } .aipd-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.aipd-card-body { display: flex; align-items: center; gap: 14px; }
.aipd-top { margin-bottom: 8px; }
.aipd-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 6px 0 14px; }
.aipd-tab { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; font: inherit; text-align: left; cursor: pointer; color: var(--ink-2); transition: all .15s; min-width: 0; }
.aipd-tab:hover { border-color: var(--magenta); } .aipd-tab .n { width: 28px; height: 28px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; background: var(--line-2); } .aipd-tab .n .ic { width: 15px; height: 15px; }
.aipd-tab .t { display: flex; flex-direction: column; min-width: 0; } .aipd-tab .t b { font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .aipd-tab .t small { font-size: .7rem; color: var(--muted); }
.aipd-tab.active { background: var(--grad-plum); color: #fff; border-color: transparent; } .aipd-tab.active .n { background: rgba(255,255,255,.2); color: #fff; } .aipd-tab.active small { color: rgba(255,255,255,.75); }
.aipd-lead { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 16px; border-radius: 12px; background: var(--magenta-50); color: var(--magenta-700); font-size: .86rem; } .aipd-lead .ic { flex: none; }
.aipd-step { display: flex; flex-direction: column; gap: 16px; }
.aipd-h2 { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; margin: 10px 0 0; } .aipd-h2 .ic { color: var(--magenta); }
.aipd-item, .aipd-mesure, .aipd-risk { padding: 14px 0; border-bottom: 1px solid var(--line-2); } .aipd-item:last-child, .aipd-mesure:last-child { border-bottom: 0; }
.aipd-risk { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; }
.aipd-item-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; } .aipd-mesure .nm { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.aipd-auto { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; margin-bottom: 8px; border-radius: 10px; background: var(--turquoise-100); color: #0f6a75; font-size: .78rem; } .aipd-auto .ic { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.aipd-trs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; } .aipd-tr { display: flex; flex-direction: column; padding: 8px 12px; border-radius: 12px; background: var(--line-2); font-size: .84rem; } .aipd-tr .muted { font-size: .72rem; }
.aipd-nav { display: flex; justify-content: space-between; margin-top: 20px; }
.aipd-mx-wrap { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 24px; align-items: start; }
.mx { display: flex; flex-direction: column; gap: 4px; } .mx-title { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; } .mx-title.c { text-align: center; }
.mx-row { display: grid; grid-template-columns: 78px repeat(4, 1fr); gap: 4px; align-items: stretch; } .mx-axis { font-size: .66rem; color: var(--muted); display: flex; align-items: center; } .mx-axis.c { justify-content: center; text-align: center; }
.mx-cell { min-height: 52px; border-radius: 8px; display: flex; flex-wrap: wrap; gap: 3px; align-items: center; justify-content: center; padding: 3px; } .mx-cell.tone-ok { background: var(--green-100); } .mx-cell.tone-warn { background: var(--amber-100); } .mx-cell.tone-bad { background: var(--red-100); } .mx-cell.tone-muted { background: var(--line-2); }
.mx-dot { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--plum-800); color: #fff; font-size: .68rem; font-weight: 700; font-style: normal; } .mx-dot.target { background: #fff; color: var(--magenta-700); border: 2px dashed var(--magenta); }
.mx-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; font-size: .72rem; color: var(--muted); } .mx-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rapport { font-size: .9rem; } .rapport h1 { font-size: 1.7rem; } .rapport h2 { margin-top: 26px; padding-bottom: 4px; border-bottom: 2px solid var(--magenta); font-size: 1.25rem; } .rapport h3 { margin: 16px 0 6px; font-size: 1rem; } .rapport table { width: 100%; border-collapse: collapse; margin: 8px 0; } .rapport th, .rapport td { border: 1px solid var(--line); padding: 6px 8px; vertical-align: top; text-align: left; }

/* ── Agenda ───────────────────────────────────────────────── */
.ev-month { font-size: 1rem; text-transform: capitalize; margin: 22px 0 10px; color: var(--ink-2); }
.ev-list { display: flex; flex-direction: column; gap: 10px; }
.ev-card { display: flex; align-items: center; gap: 16px; padding: 14px 18px; transition: transform .15s, box-shadow .15s, border-color .15s; } .ev-card.clickable { cursor: pointer; } .ev-card.clickable:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--magenta); }
.ev-card.past { opacity: .78; } .ev-go { color: var(--faint); flex: none; }
.ev-date { width: 56px; height: 62px; flex: none; border-radius: 14px; background: var(--grad-brand); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; } .ev-date b { font-family: var(--font-title); font-size: 1.5rem; } .ev-date span { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; margin-top: 3px; }
.ev-card[data-type="visite"] .ev-date { background: var(--violet); } .ev-card[data-type="sensibilisation"] .ev-date { background: var(--turquoise); } .ev-card[data-type="info"] .ev-date { background: var(--green); }
.ev-main { flex: 1; min-width: 0; } .ev-main h3 { margin: 4px 0; font-size: 1.02rem; } .ev-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.ev-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .78rem; color: var(--muted); } .ev-meta span { display: inline-flex; align-items: center; gap: 5px; } .ev-meta .ic { width: 14px; height: 14px; }
.ev-desc { margin: 6px 0 8px; font-size: .84rem; color: var(--ink-2); }
.ev-detail-head { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ev-sect { padding: 14px 0; border-top: 1px solid var(--line-2); } .ev-sect h3 { display: flex; align-items: center; gap: 8px; font-size: .95rem; margin: 0 0 8px; } .ev-sect h3 .ic { color: var(--magenta); width: 17px; height: 17px; } .ev-sect p { margin: 0; font-size: .88rem; }
.ev-ol { margin: 0; padding-left: 20px; font-size: .88rem; } .ev-ol li { margin: 3px 0; }
.ev-todo { list-style: none; margin: 0; padding: 0; } .ev-todo li { padding: 5px 0; } .ev-todo .done { text-decoration: line-through; color: var(--muted); }

/* ── Impression (rapport d'AIPD) ──────────────────────────── */
@media print { .sidebar, #sidebar-nav, .topbar, .page-head .actions, .aipd-tabs, .aipd-nav, .aipd-top, .aipd-lead, .btn-group { display: none !important; } .app-main { margin: 0 !important; } body { background: #fff; } }

/* ── Adaptations d'écran ──────────────────────────────────── */
@media (max-width: 900px) { .aipd-tabs { grid-template-columns: repeat(2, 1fr); } .aipd-mx-wrap { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .ev-card { padding: 12px; gap: 12px; } .ev-date { width: 48px; height: 54px; } .aipd-tabs { grid-template-columns: 1fr; } .mx-row { grid-template-columns: 56px repeat(4, 1fr); } .road-chip { padding: 5px 10px; } }

/* ── Harmonisation des menus et en-têtes (tailles, alignements, responsive) ─────────────── */
.nav-item { align-items: center; padding: 8px 10px 8px 8px; font-size: .88rem; }
.nav-item .nav-label { white-space: normal; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nav-item .nav-ic { width: 30px; height: 30px; }
.page-head { align-items: center; }
.page-head > .icon-tile { align-self: center; }
.page-head h1 { line-height: 1.15; margin: 0; }
.page-head .titles { min-width: min(100%, 220px); }
.page-tabs { scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.page-tab { scroll-snap-align: center; flex: none; }
.crumbs { flex: 1 1 auto; overflow: hidden; } .crumbs b, .crumbs > span { white-space: nowrap; }
.crumbs b { overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 0 0 0; }
.client-pill .nm-wrap { min-width: 0; display: flex; flex-direction: column; text-align: left; line-height: 1.15; }
.client-pill > .ic { flex: none; width: 16px; height: 16px; color: var(--muted); }
@media (max-width: 860px) {
  .topbar { gap: 10px; padding: 0 12px; }
  .crumbs > span, .crumbs .sep { display: none; }
  .crumbs b { font-size: 1rem; }
  .client-pill { padding: 3px; gap: 0; } .client-pill > .ic { display: none; }
  .save-state { padding: 6px 8px; }
  .page-head { gap: 12px; margin-bottom: 16px; }
  .page-head > .icon-tile.lg { width: 44px; height: 44px; border-radius: 13px; }
  .page-head h1 { font-size: 1.25rem; } .page-head p { font-size: .82rem; }
  .page-head .actions { width: 100%; } .page-head .actions .btn { flex: 1 1 auto; justify-content: center; }
  .page-tabs { width: 100%; margin-bottom: 16px; border-radius: 14px; }
  .page-tab { padding: 8px 12px; font-size: .8rem; }
  .toolbar { gap: 8px; } .toolbar select, .toolbar .search-field { flex: 1 1 100%; max-width: none; }
  .card { border-radius: 16px; }
  .suivi-head > .btn { width: 100%; justify-content: center; }
}
@media (max-width: 420px) {
  #main-content { padding: 16px 12px 48px; }
  .kpi-card { padding: 12px 14px; } .hero { padding: 22px 18px; }
}
.card-header { flex-wrap: wrap; gap: 10px; } .seg { max-width: 100%; }

/* ── Profil, informations légales ─────────────────────────── */
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 2px 6px 10px; }
.foot-link { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px; border: 0; background: transparent; color: rgba(233, 219, 227, .72); font: inherit; font-size: .76rem; font-weight: 500; text-decoration: none; cursor: pointer; border-radius: 8px; }
.foot-link:hover { color: #fff; background: rgba(255, 255, 255, .08); } .foot-link .ic { width: 14px; height: 14px; }
.avatar.xl { width: 72px; height: 72px; font-size: 1.4rem; flex: none; overflow: hidden; }
.profil-top { display: flex; align-items: center; gap: 18px; } .profil-top .grow { flex: 1; min-width: 0; }
.profil-legal { display: flex; flex-wrap: wrap; } .profil-legal .chip { text-decoration: none; color: var(--ink-2); } .profil-legal .chip:hover { border-color: var(--magenta); color: var(--magenta-700); }
.legal-banner { display: flex; align-items: center; gap: 12px; padding: 10px 28px; background: var(--amber-100); color: #8a5500; font-size: .84rem; border-bottom: 1px solid #f2d79b; } .legal-banner span { flex: 1; } .legal-banner .ic { flex: none; }
@media (max-width: 860px) { .legal-banner { padding: 10px 14px; flex-wrap: wrap; } }

/* ── Bibliothèque ─────────────────────────────────────────── */
th.w-check, td.w-check { width: 44px; text-align: center; } td.w-check input { width: 18px; height: 18px; accent-color: var(--magenta); }
.imp-bar { position: sticky; bottom: 12px; z-index: 20; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 18px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); }
.imp-bar > span { flex: 1; min-width: 160px; font-size: .86rem; }
.grille-crit { padding: 14px 0; border-top: 1px solid var(--line-2); } .grille-crit-h { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.ed-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: .86rem; } .ed-row .seg { flex: none; }
@media (max-width: 700px) { .ed-row { flex-direction: column; align-items: flex-start; } .imp-bar { bottom: 6px; } }
