/* =========================================================================
   SAN ANDREAS STATE POLICE — Portail
   styles.css — Design institutionnel (inspiré des portails d'État US / USWDS)
   Palette : bleu marine, or, gris neutres · Typo : Merriweather + Public Sans

   Sommaire
   01. Tokens (variables)        09. Services / tuiles       17. Modales
   02. Reset & base              10. Espace agent            18. Espace Agent
   03. Utilitaires               11. Chiffres clés           19. Tableaux & badges
   04. Popup d'entrée (RP)       12. Divisions               20. Toasts
   05. En-tête                   13. Communiqués             21. Effets (ripple, skeleton…)
   06. Boutons & liens           14. Recrutement             22. Animations
   07. Hero                      15. Formulaires             23. Responsive
   08. Carte de statut           16. Pied de page            24. Mouvement réduit
   ========================================================================= */

/* ---------- 01. Tokens ---------- */
:root {
  /* Marque */
  --navy-950: #06101f;
  --navy-900: #0b1a33;
  --navy-800: #112548;
  --navy-700: #1a3263;
  --navy-600: #24427f;
  --navy-100: #e6ecf6;
  --navy-50: #f2f5fb;

  --gold-700: #8a6a1c;
  --gold-600: #a8842a;
  --gold-500: #c9a13b;
  --gold-400: #dcb85a;
  --gold-100: #f8f0da;

  /* Neutres */
  --white: #ffffff;
  --gray-25: #fbfbfc;
  --gray-50: #f5f6f8;
  --gray-100: #eceef1;
  --gray-200: #dde1e6;
  --gray-300: #c3c9d1;
  --gray-500: #6b7380;
  --gray-700: #3a414c;
  --ink: #161b22;

  /* États */
  --green-600: #147a3f;
  --green-100: #e3f4ea;
  --amber-500: #e09a00;
  --amber-100: #fdf1d8;
  --orange-600: #c4540a;
  --orange-100: #fdeadc;
  --red-600: #b3261e;
  --red-500: #d63a31;
  --red-100: #fbe6e4;
  --blue-600: #1f5fbf;
  --blue-100: #e3edfb;

  /* Jetons sémantiques (redéfinis par le thème sombre) */
  --surface: var(--white);      /* fond des cartes, panneaux, champs */
  --text: var(--ink);           /* texte courant */
  --heading: var(--navy-900);   /* titres et valeurs mises en avant */
  --danger-tint: #fff8f7;       /* fond d'erreur très léger */

  /* Typographie */
  --font-sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Merriweather", Georgia, "Times New Roman", serif;
  --fs-xs: .75rem;
  --fs-sm: .875rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;

  /* Rayons, ombres, mouvements */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-xs: 0 1px 2px rgba(11, 26, 51, .06);
  --shadow-sm: 0 1px 3px rgba(11, 26, 51, .08), 0 1px 2px rgba(11, 26, 51, .04);
  --shadow-md: 0 6px 16px -4px rgba(11, 26, 51, .12), 0 2px 6px rgba(11, 26, 51, .06);
  --shadow-lg: 0 20px 40px -12px rgba(11, 26, 51, .25), 0 6px 14px rgba(11, 26, 51, .08);
  --shadow-xl: 0 40px 80px -20px rgba(6, 16, 31, .5);
  --ring: 0 0 0 3px rgba(201, 161, 59, .45);
  --ring-blue: 0 0 0 3px rgba(36, 66, 127, .25);

  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --t-fast: .15s;
  --t: .25s;
  --t-slow: .6s;

  --container: 1200px;
  --nav-h: 56px;
}

/* ---------- 02. Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: 1.6;
  color: var(--text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.modal-open, body.gate-open { overflow: hidden; }

img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; color: var(--heading); }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; padding: 0; }
a { color: var(--navy-600); text-underline-offset: 3px; transition: color var(--t-fast) var(--ease); }
a:hover { color: var(--heading); }
button { font: inherit; }
code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: .88em;
  background: var(--navy-50);
  color: var(--navy-700);
  padding: .12em .4em;
  border-radius: var(--radius-xs);
  border: 1px solid var(--navy-100);
}
abbr[title] { text-decoration: none; }
::selection { background: var(--gold-400); color: var(--navy-950); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-xs); }

/* ---------- 03. Utilitaires ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute;
  left: 16px; top: -60px;
  z-index: 1000;
  padding: 10px 16px;
  background: var(--gold-500);
  color: var(--navy-950);
  font-weight: 700;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: top var(--t) var(--ease);
}
.skip-link:focus { top: 0; }

/* Barre de progression de lecture */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 120;
  background: linear-gradient(90deg, var(--gold-600), var(--gold-400), var(--gold-600));
  transform-origin: 0 50%;
  transform: scaleX(var(--progress, 0));
  box-shadow: 0 0 10px rgba(220, 184, 90, .6);
  pointer-events: none;
}

/* ---------- 04. Popup d'entrée obligatoire ---------- */
.rp-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(900px 500px at 50% 0%, rgba(36, 66, 127, .55), transparent 70%),
    rgba(6, 16, 31, .92);
  backdrop-filter: blur(10px) saturate(1.2);
  animation: fadeIn .5s var(--ease) both;
}
.rp-gate.is-leaving { animation: gateOut .45s var(--ease) forwards; }
.rp-gate__dialog {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 40px 36px 28px;
  text-align: center;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border-top: 6px solid var(--gold-500);
  animation: gateIn .7s var(--ease-spring) .1s both;
}
.rp-gate__seal {
  width: 96px; height: 96px;
  margin: -88px auto 16px;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(6, 16, 31, .35));
  animation: sealIn .9s var(--ease-spring) .25s both;
}
.rp-gate__kicker {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold-700);
  margin-bottom: 6px;
}
.rp-gate__title { font-family: var(--font-serif); font-size: 1.6rem; margin-bottom: 16px; }
.rp-gate__body { color: var(--gray-700); font-size: .95rem; text-align: left; }
.rp-gate__main {
  padding: 14px 16px;
  background: var(--navy-900);
  color: var(--white);
  font-weight: 700;
  text-align: center;
  border-radius: var(--radius-sm);
  line-height: 1.45;
}
.rp-gate__emergency {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  background: var(--red-100);
  border-left: 4px solid var(--red-600);
  border-radius: var(--radius-xs);
  color: var(--red-600);
  font-weight: 600;
}
.rp-gate__emergency .icon { margin-top: 3px; }
.rp-gate .btn { margin-top: 22px; }
.rp-gate__note { margin-top: 12px; font-size: var(--fs-xs); color: var(--gray-500); }

/* ---------- 05. En-tête ---------- */
.site-header { position: relative; z-index: 60; }

/* Barre utilitaire */
.utility-bar { background: var(--navy-950); color: rgba(255, 255, 255, .78); font-size: var(--fs-sm); }
.utility-bar__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 42px; }
.utility-bar__state { margin: 0; letter-spacing: .02em; }
.utility-bar__actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

.utility-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: none;
  border: 0;
  border-radius: var(--radius-xs);
  color: rgba(255, 255, 255, .85);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.utility-link:hover { color: var(--white); background: rgba(255, 255, 255, .08); }
.utility-link--accent { color: var(--gold-400); }
.utility-link--accent:hover { color: var(--gold-400); }
.utility-link--admin { background: var(--red-600); color: var(--white); }
.utility-link--admin:hover { background: var(--red-500); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 8px;
  padding: 4px 12px 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .15);
  background: rgba(255, 255, 255, .06);
  color: var(--white);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .04em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), transform var(--t) var(--ease);
}
.status-pill:hover { color: var(--white); background: rgba(255, 255, 255, .12); transform: translateY(-1px); }
.status-pill__dot { --c: #3bd07a; width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 0 var(--c); animation: ping 2s var(--ease) infinite; }
.status-pill.defcon-4 .status-pill__dot { --c: #5b9dff; }
.status-pill.defcon-3 .status-pill__dot { --c: #ffc043; }
.status-pill.defcon-2 .status-pill__dot { --c: #ff8a3d; }
.status-pill.defcon-1 .status-pill__dot { --c: #ff5a4f; animation: ping 2s var(--ease) infinite, strobe .6s steps(1) infinite; }
.status-pill.defcon-2 { border-color: rgba(255, 138, 61, .6); background: rgba(196, 84, 10, .35); }
.status-pill.defcon-1 { border-color: rgba(255, 90, 79, .6); background: rgba(179, 38, 30, .35); }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  color: var(--white);
  text-decoration: none;
  transition: background var(--t-fast) var(--ease);
}
.user-chip:hover { color: var(--white); background: rgba(255, 255, 255, .08); }
.user-chip__name { font-weight: 700; }
.user-chip__rank {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--gold-500);
  color: var(--navy-950);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* Masthead */
.masthead {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0) 60%, var(--gray-50)),
    var(--white);
  border-bottom: 1px solid var(--gray-200);
}
.masthead__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 18px; }

.brand { display: flex; align-items: center; gap: 16px; color: inherit; text-decoration: none; }
.brand__seal {
  width: 76px; height: 76px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(11, 26, 51, .25));
  transition: transform .6s var(--ease-spring), filter var(--t) var(--ease);
}
.brand:hover .brand__seal { transform: rotate(-8deg) scale(1.06); filter: drop-shadow(0 8px 16px rgba(11, 26, 51, .35)); }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__kicker { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-700); }
.brand__name { font-family: var(--font-serif); font-weight: 900; font-size: 1.55rem; color: var(--heading); margin: 4px 0; }
.brand__abbr {
  display: inline-block;
  padding: 0 8px;
  margin-right: 6px;
  background: var(--navy-900);
  color: var(--gold-400);
  border-radius: var(--radius-xs);
  letter-spacing: .06em;
}
.brand__tag { font-size: var(--fs-sm); color: var(--gray-500); font-style: italic; }

.masthead__contacts { list-style: none; display: flex; gap: 10px; }
.masthead__contacts li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
.masthead__contacts li:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--gold-400); }
.masthead__contacts li:first-child { border-color: rgba(179, 38, 30, .35); }
.masthead__contacts li:first-child .icon { color: var(--red-600); }
.masthead__contacts .icon { width: 22px; height: 22px; color: var(--navy-600); }
.masthead__contacts small { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gray-500); }
.masthead__contacts strong { font-size: 1.15rem; color: var(--heading); line-height: 1.1; font-variant-numeric: tabular-nums; }

/* Navigation principale (collante) */
.primary-nav {
  position: sticky;
  top: 0;
  z-index: 70;
  background: var(--navy-900);
  border-bottom: 3px solid var(--gold-500);
  transition: box-shadow var(--t) var(--ease), background var(--t) var(--ease);
}
body.is-scrolled .primary-nav { box-shadow: 0 8px 24px -8px rgba(6, 16, 31, .55); background: rgba(11, 26, 51, .97); backdrop-filter: blur(8px); }
/* La nav collante doit être hors du header pour rester visible : on neutralise le contexte */
.site-header { display: contents; }

.primary-nav__inner { display: flex; align-items: center; gap: 16px; min-height: var(--nav-h); }
.primary-nav__list { list-style: none; display: flex; align-self: stretch; }
.primary-nav__list a {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 16px;
  color: rgba(255, 255, 255, .88);
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.primary-nav__list a::after {
  content: "";
  position: absolute;
  left: 16px; right: 16px; bottom: -3px;
  height: 3px;
  background: var(--surface);
  transform: scaleX(0);
  transform-origin: 50% 50%;
  transition: transform var(--t) var(--ease);
}
.primary-nav__list a:hover { color: var(--white); background: rgba(255, 255, 255, .06); }
.primary-nav__list a:hover::after, .primary-nav__list a.is-current::after { transform: scaleX(1); }
.primary-nav__list a.is-current { color: var(--gold-400); }
.primary-nav__list a.is-current::after { background: var(--gold-400); }
.primary-nav__cta { margin-left: auto; }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-weight: 600;
  cursor: pointer;
}

/* Bandeau d'alerte (DEFCON 2 / 1) */
.site-alert {
  position: relative;
  overflow: hidden;
  background: var(--red-600);
  color: var(--white);
  animation: slideDown .45s var(--ease) both;
}
.site-alert::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .07) 0 12px, transparent 12px 24px);
  animation: stripes 1.2s linear infinite;
}
.site-alert.defcon-2 { background: var(--orange-600); }
.site-alert.defcon-1 { animation: slideDown .45s var(--ease) both, alertFlash 1.2s steps(1) infinite; }
.site-alert__inner { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; font-weight: 600; }
.site-alert__inner p { margin: 0; flex: 1; }
.site-alert__inner a { color: var(--white); font-weight: 700; }
.site-alert__inner .icon { width: 20px; height: 20px; animation: wiggle 1.5s var(--ease) infinite; }

/* ---------- 06. Boutons & liens ---------- */
.btn {
  --btn-bg: var(--navy-700);
  --btn-fg: var(--white);
  --btn-border: transparent;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 700;
  font-size: .95rem;
  line-height: 1.2;
  letter-spacing: .01em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--t) var(--ease),
    box-shadow var(--t) var(--ease),
    background-color var(--t) var(--ease),
    border-color var(--t) var(--ease),
    color var(--t) var(--ease);
}
.btn .icon { transition: transform var(--t) var(--ease); }
.btn:hover { color: var(--btn-fg); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:hover .icon:last-child:not(:first-child) { transform: translateX(4px); }
.btn:active { transform: translateY(0) scale(.98); box-shadow: var(--shadow-xs); transition-duration: .08s; }
.btn:disabled, .btn.is-loading { cursor: not-allowed; opacity: .7; transform: none; box-shadow: none; }

/* Reflet qui balaie le bouton au survol */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .7s var(--ease);
}
.btn:hover::before { transform: translateX(120%); }

/* Chargement */
.btn.is-loading { color: transparent !important; }
.btn.is-loading .icon { opacity: 0; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px;
  border: 2.5px solid var(--btn-fg);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.btn--primary { --btn-bg: var(--navy-700); }
.btn--primary:hover { --btn-bg: var(--navy-800); }
.btn--secondary { --btn-bg: var(--surface); --btn-fg: var(--navy-800); --btn-border: var(--gray-300); }
.btn--secondary:hover { --btn-border: var(--navy-600); --btn-bg: var(--navy-50); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--navy-700); --btn-border: var(--gray-300); box-shadow: none; }
.btn--ghost:hover { --btn-bg: var(--gray-50); }
.btn--gold { --btn-bg: var(--gold-500); --btn-fg: var(--navy-950); background-image: linear-gradient(180deg, var(--gold-400), var(--gold-500)); }
.btn--gold:hover { box-shadow: 0 10px 24px -6px rgba(201, 161, 59, .6); }
.btn--outline-light { --btn-bg: transparent; --btn-fg: var(--white); --btn-border: rgba(255, 255, 255, .55); box-shadow: none; }
.btn--outline-light:hover { --btn-bg: rgba(255, 255, 255, .1); --btn-border: var(--white); }
.btn--danger { --btn-bg: var(--red-600); }
.btn--danger:hover { --btn-bg: #9b1f18; box-shadow: 0 10px 24px -8px rgba(179, 38, 30, .55); }
.btn--success { --btn-bg: var(--green-600); }
.btn--warning { --btn-bg: var(--amber-500); --btn-fg: var(--navy-950); }
.btn--sm { padding: 7px 12px; font-size: .82rem; }
.btn--lg { padding: 14px 26px; font-size: 1rem; }
.btn--block { width: 100%; }

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--navy-600);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: text-decoration-color var(--t) var(--ease), color var(--t) var(--ease);
}
.link-btn:hover { color: var(--heading); text-decoration-color: currentColor; }
.link-btn--light { color: rgba(255, 255, 255, .78); font-weight: 400; text-align: left; }
.link-btn--light:hover { color: var(--white); }

/* ---------- 07. Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 88px 0 140px;
  color: var(--white);
  background:
    radial-gradient(1000px 520px at 85% 10%, rgba(201, 161, 59, .18), transparent 60%),
    radial-gradient(800px 600px at 0% 100%, rgba(36, 66, 127, .8), transparent 60%),
    linear-gradient(135deg, var(--navy-950) 0%, var(--navy-900) 45%, var(--navy-800) 100%);
}
/* Lignes diagonales animées */
.hero::before {
  content: "";
  position: absolute;
  inset: -50%;
  background: repeating-linear-gradient(115deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 22px);
  animation: drift 40s linear infinite;
  pointer-events: none;
}
/* Faisceau lumineux */
.hero::after {
  content: "";
  position: absolute;
  top: -40%;
  left: -20%;
  width: 60%;
  height: 180%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .05), transparent);
  transform: rotate(18deg);
  animation: sweep 9s var(--ease) infinite;
  pointer-events: none;
}
.hero__watermark {
  position: absolute;
  right: -110px;
  top: 50%;
  width: 560px;
  height: 560px;
  object-fit: contain;
  opacity: .07;
  transform: translate3d(0, calc(-50% + var(--parallax, 0px)), 0) rotate(var(--parallax-rot, 0deg));
  pointer-events: none;
  will-change: transform;
}
.hero__grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.25fr 1fr; gap: 56px; align-items: center; }
.hero__kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--gold-400);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.hero__kicker::before { content: ""; width: 32px; height: 2px; background: currentColor; animation: growX .8s var(--ease) .3s both; transform-origin: left; }
.hero__title {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: clamp(2.2rem, 4.6vw, 3.6rem);
  line-height: 1.12;
  color: var(--white);
  margin-bottom: 22px;
  text-wrap: balance;
}
.hero__lead { max-width: 580px; font-size: var(--fs-lg); color: rgba(255, 255, 255, .8); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0 26px; }
.hero__note { display: flex; align-items: flex-start; gap: 10px; font-size: var(--fs-sm); color: rgba(255, 255, 255, .7); }
.hero__note .icon { color: var(--gold-400); }
.hero__note strong { color: var(--white); }

/* ---------- 08. Carte de statut ---------- */
.status-card {
  --c: var(--green-600);
  --c-soft: var(--green-100);
  position: relative;
  color: var(--text);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.status-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: var(--c);
  transition: background var(--t-slow) var(--ease);
}
.status-card.defcon-4 { --c: var(--blue-600); --c-soft: var(--blue-100); }
.status-card.defcon-3 { --c: #b77f00; --c-soft: var(--amber-100); }
.status-card.defcon-2 { --c: var(--orange-600); --c-soft: var(--orange-100); }
.status-card.defcon-1 { --c: var(--red-600); --c-soft: var(--red-100); }
.status-card.defcon-1::before { animation: lightbar 1s steps(1) infinite; }
.status-card.is-updated { animation: pop .6s var(--ease-spring); }

.status-card__head { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px 0; }
.status-card__title { font-size: var(--fs-sm); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--gray-500); font-family: var(--font-sans); }
.status-card__live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--red-100);
  color: var(--red-600);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.status-card__live span { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: blink 1.2s ease-in-out infinite; }

.status-card__body { padding: 16px 24px 20px; }
.status-card__code-row { display: flex; align-items: center; gap: 14px; }
.status-card__beacon { position: relative; width: 16px; height: 16px; border-radius: 50%; background: var(--c); flex-shrink: 0; }
.status-card__beacon::before, .status-card__beacon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--c);
  animation: radar 2s var(--ease) infinite;
}
.status-card__beacon::after { animation-delay: 1s; }
.status-card__code {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: clamp(2.4rem, 5vw, 3.2rem);
  line-height: 1;
  color: var(--c);
  letter-spacing: .02em;
  transition: color var(--t-slow) var(--ease);
}
.status-card__label { margin: 10px 0 6px; font-size: 1.15rem; font-weight: 800; color: var(--heading); }
.status-card__desc { color: var(--gray-700); font-size: .95rem; }
.status-card__message {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--c-soft);
  border-left: 4px solid var(--c);
  border-radius: var(--radius-xs);
  font-weight: 600;
  font-size: .92rem;
  animation: fadeUp .4s var(--ease) both;
}
.status-card__updated { margin-top: 10px; font-size: var(--fs-xs); color: var(--gray-500); }

.status-legend { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--gray-200); border-top: 1px solid var(--gray-200); }
.status-legend li {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 12px 4px;
  background: var(--gray-25);
  font-size: var(--fs-sm);
  color: var(--gray-500);
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.status-legend li strong { display: block; color: inherit; font-size: .95rem; font-family: var(--font-serif); }
.status-legend li small { font-size: .68rem; line-height: 1.2; }
.status-legend li.is-active { background: var(--surface); color: var(--heading); box-shadow: inset 0 -3px 0 var(--c); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.status-dot--5 { background: var(--green-600); }
.status-dot--4 { background: var(--blue-600); }
.status-dot--3 { background: var(--amber-500); }
.status-dot--2 { background: var(--orange-600); }
.status-dot--1 { background: linear-gradient(90deg, var(--red-600) 50%, var(--blue-600) 50%); }

/* Squelette pendant le chargement */
.status-card.is-loading .status-card__code,
.status-card.is-loading .status-card__label,
.status-card.is-loading .status-card__desc {
  color: transparent;
  border-radius: var(--radius-xs);
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 50%, var(--gray-100) 75%) 0 0 / 200% 100%;
  animation: shimmer 1.3s linear infinite;
}

/* ---------- 09. Services ---------- */
.services { position: relative; z-index: 2; margin-top: -84px; padding-bottom: 72px; }
.service-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.service-tile {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 22px 20px;
  background: var(--surface);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  color: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0));
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
.service-tile::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-600), var(--gold-400));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s var(--ease);
}
.service-tile:hover { --lift: -6px; color: inherit; box-shadow: var(--shadow-lg); border-color: var(--gold-400); }
.service-tile:hover::after { transform: scaleX(1); }
.service-tile__icon {
  display: grid;
  place-items: center;
  width: 48px; height: 48px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--navy-50);
  color: var(--navy-700);
  transition: background var(--t) var(--ease), color var(--t) var(--ease), transform .5s var(--ease-spring);
}
.service-tile__icon .icon { width: 24px; height: 24px; }
.service-tile:hover .service-tile__icon { background: var(--navy-700); color: var(--gold-400); transform: rotate(-6deg) scale(1.08); }
.service-tile__body { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.service-tile__title { font-weight: 800; color: var(--heading); }
.service-tile__text { font-size: var(--fs-sm); color: var(--gray-500); line-height: 1.45; }
.service-tile__arrow { margin-top: 4px; color: var(--gray-300); transition: transform var(--t) var(--ease), color var(--t) var(--ease); }
.service-tile:hover .service-tile__arrow { transform: translateX(4px); color: var(--gold-600); }

/* ---------- Sections génériques ---------- */
.section { padding: 88px 0; }
.section--muted { background: var(--gray-50); border-block: 1px solid var(--gray-100); }
.section-head { max-width: 760px; margin-bottom: 44px; }
.section-head--split { max-width: none; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.section-head__kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--gold-700);
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.section-head__kicker::before { content: ""; width: 24px; height: 2px; background: var(--gold-500); }
.section-head__title { font-family: var(--font-serif); font-weight: 900; font-size: clamp(1.7rem, 3.2vw, 2.4rem); margin-bottom: 12px; text-wrap: balance; }
.section-head__lead { color: var(--gray-700); font-size: var(--fs-lg); }
.section-head__aside { margin: 0; color: var(--gray-500); font-size: var(--fs-sm); }

/* ---------- 10. Espace agent ---------- */
.agent-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: center;
  padding: 28px 32px;
  background: var(--surface);
  border: 1px solid var(--gray-200);
  border-left: 6px solid var(--gold-500);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  animation: fadeUp .6s var(--ease) both;
}
.agent-card__id { display: flex; align-items: center; gap: 18px; padding-right: 32px; border-right: 1px solid var(--gray-200); }
.agent-card__seal { width: 88px; height: 88px; object-fit: contain; animation: float 6s ease-in-out infinite; }
.agent-card__rank { margin: 0; font-size: var(--fs-xs); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-700); }
.agent-card__name { margin: 2px 0 0; font-family: var(--font-serif); font-weight: 900; font-size: 1.5rem; color: var(--heading); }
.agent-card__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 0; }
.agent-card__grid dt { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gray-500); }
.agent-card__grid dd { margin: 4px 0 0; font-weight: 700; font-size: 1.05rem; color: var(--heading); }

/* ---------- 11. Chiffres clés ---------- */
.facts { position: relative; overflow: hidden; background: var(--navy-900); color: var(--white); padding: 56px 0; }
.facts::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 200px at 50% 0%, rgba(201, 161, 59, .18), transparent 70%);
}
.facts__grid { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); }
.fact { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 8px 16px; }
.fact + .fact { border-left: 1px solid rgba(255, 255, 255, .12); }
.fact__value {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1;
  color: var(--gold-400);
  font-variant-numeric: tabular-nums;
  transition: transform var(--t) var(--ease), text-shadow var(--t) var(--ease);
}
.fact:hover .fact__value { transform: scale(1.08); text-shadow: 0 0 24px rgba(220, 184, 90, .5); }
.fact__label { margin-top: 8px; font-size: var(--fs-sm); color: rgba(255, 255, 255, .72); }

/* ---------- 12. Divisions ---------- */
.division-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
.division-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 28px 24px;
  background: var(--surface);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0));
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
.division-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--navy-700);
  transition: background var(--t) var(--ease), height var(--t) var(--ease);
}
/* Halo qui suit la souris */
.division-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgba(201, 161, 59, .12), transparent 60%);
  opacity: 0;
  transition: opacity var(--t) var(--ease);
  pointer-events: none;
}
.division-card:hover { --lift: -6px; box-shadow: var(--shadow-lg); border-color: var(--gray-300); }
.division-card:hover::before { background: linear-gradient(90deg, var(--gold-600), var(--gold-400)); }
.division-card:hover::after { opacity: 1; }
.division-card__icon {
  display: grid;
  place-items: center;
  width: 56px; height: 56px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--navy-900);
  color: var(--gold-400);
  box-shadow: 0 0 0 6px var(--navy-50);
  transition: transform .6s var(--ease-spring), box-shadow var(--t) var(--ease);
}
.division-card__icon .icon { width: 26px; height: 26px; }
.division-card:hover .division-card__icon { transform: scale(1.1) rotate(8deg); box-shadow: 0 0 0 10px var(--gold-100); }
.division-card__title { font-family: var(--font-serif); font-size: 1.2rem; margin-bottom: 10px; }
.division-card p { color: var(--gray-700); font-size: .93rem; flex: 1; }
.division-card__meta {
  flex: 0 !important;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--gray-100);
  font-size: var(--fs-xs) !important;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gray-500) !important;
}

/* ---------- 13. Communiqués ---------- */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.news-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px 24px;
  background: var(--surface);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
.news-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--navy-100); }
.news-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; font-size: var(--fs-xs); color: var(--gray-500); font-weight: 600; }
.news-card__title {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  line-height: 1.4;
  margin-bottom: 10px;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .4s var(--ease);
}
.news-card:hover .news-card__title { background-size: 100% 1px; }
.news-card p { color: var(--gray-700); font-size: .93rem; }

.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.tag--navy { background: var(--navy-100); color: var(--navy-700); }
.tag--gold { background: var(--gold-100); color: var(--gold-700); }
.tag--red { background: var(--red-100); color: var(--red-600); }

/* ---------- 14. Recrutement ---------- */
.recruit { display: grid; grid-template-columns: 1fr 1.25fr; gap: 56px; align-items: start; }
.recruit__info { position: sticky; top: calc(var(--nav-h) + 24px); }

.steps { list-style: none; margin: 28px 0; position: relative; }
.steps::before { content: ""; position: absolute; left: 17px; top: 18px; bottom: 18px; width: 2px; background: linear-gradient(var(--gold-500), var(--gray-200)); }
.steps__item { position: relative; display: flex; gap: 16px; padding: 10px 0; }
.steps__num {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--navy-900);
  color: var(--gold-400);
  font-weight: 800;
  box-shadow: 0 0 0 4px var(--white);
  transition: transform .5s var(--ease-spring), background var(--t) var(--ease);
}
.steps__item:hover .steps__num { transform: scale(1.15); background: var(--gold-500); color: var(--navy-950); }
.steps__item strong { color: var(--heading); }
.steps__item p { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--gray-500); }

.callout {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  background: var(--blue-100);
  border-left: 4px solid var(--blue-600);
  border-radius: var(--radius-xs);
  color: var(--heading);
  font-size: .93rem;
}
.callout .icon { width: 22px; height: 22px; color: var(--blue-600); margin-top: 1px; }
.callout ul { margin: 6px 0 0; padding-left: 18px; }
.callout li { margin: 2px 0; }
.callout p { margin: 0; }
.callout--compact { padding: 12px 14px; font-size: var(--fs-sm); }
.callout--warning { background: var(--amber-100); border-color: var(--amber-500); }
.callout--warning .icon { color: #9a6a00; }

/* ---------- 15. Formulaires ---------- */
.form-card { background: var(--surface); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.form-card__head { padding: 22px 28px; background: var(--navy-900); color: var(--white); border-bottom: 3px solid var(--gold-500); }
.form-card__head h3 { color: var(--white); font-family: var(--font-serif); font-size: 1.25rem; margin-bottom: 4px; }
.form-card__head p { margin: 0; font-size: var(--fs-sm); color: rgba(255, 255, 255, .72); }
.form-card__head .req { color: var(--gold-400); }
.form-card__body { display: grid; gap: 18px; padding: 28px; }
.form-card__foot { padding: 0 28px 28px; }

.form { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.field { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; transition: padding var(--t) var(--ease); }
.field label { font-weight: 700; font-size: .9rem; color: var(--heading); }
.req { color: var(--red-600); font-weight: 800; }
.field__optional { font-weight: 400; color: var(--gray-500); }
.field__hint { font-size: var(--fs-xs); color: var(--gray-500); }
.field__error { font-size: .8rem; font-weight: 600; color: var(--red-600); min-height: 0; }
.field__error:empty { display: none; }
.field__meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.char-count { margin-left: auto; font-size: var(--fs-xs); color: var(--gray-500); white-space: nowrap; font-variant-numeric: tabular-nums; transition: color var(--t) var(--ease); }
.char-count.is-low { color: #9a6a00; font-weight: 700; }

.field input, .field select, .field textarea, .search input {
  width: 100%;
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: .95rem;
  box-shadow: inset 0 1px 2px rgba(11, 26, 51, .04);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease), background var(--t) var(--ease);
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--gray-500); }
.field input:focus, .field select:focus, .field textarea:focus, .search input:focus {
  outline: none;
  border-color: var(--navy-600);
  box-shadow: var(--ring-blue);
}
.field input::placeholder, .field textarea::placeholder { color: #9aa1ab; }
.field textarea { resize: vertical; min-height: 88px; line-height: 1.5; }

/* État d'erreur (inspiré USWDS) */
.field.has-error { padding-left: 14px; }
.field.has-error::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 2px; background: var(--red-600); animation: growY .3s var(--ease) both; transform-origin: top; }
.field .is-invalid { border-color: var(--red-600) !important; background: var(--danger-tint); }
.field.has-error input, .field.has-error select, .field.has-error textarea { animation: shake .4s var(--ease); }

.select-wrap { position: relative; }
.select-wrap select { appearance: none; padding-right: 40px; cursor: pointer; }
.select-wrap::after {
  content: "";
  position: absolute;
  right: 16px; top: 50%;
  width: 8px; height: 8px;
  border-right: 2px solid var(--navy-700);
  border-bottom: 2px solid var(--navy-700);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.field--check { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: start; padding: 14px 16px; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius-sm); }
.field--check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--navy-700); cursor: pointer; }
.field--check label { font-weight: 400; font-size: .9rem; color: var(--gray-700); cursor: pointer; }
.field--check .field__error { grid-column: 2; }
.field--check.has-error { padding-left: 16px; }

.input-prefix { display: flex; border: 1px solid var(--gray-300); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.input-prefix span { display: flex; align-items: center; padding: 0 4px 0 12px; background: var(--gray-50); color: var(--gray-500); font-family: ui-monospace, Consolas, monospace; font-size: .88rem; border-right: 1px solid var(--gray-200); padding-right: 10px; }
.field .input-prefix input { border: 0; border-radius: 0; box-shadow: none; }
.input-prefix:focus-within { border-color: var(--navy-600); box-shadow: var(--ring-blue); }

.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- 16. Pied de page ---------- */
.site-footer { background: var(--navy-950); color: rgba(255, 255, 255, .72); font-size: var(--fs-sm); border-top: 4px solid var(--gold-500); }
.site-footer__main { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; padding-block: 56px 44px; }
.site-footer__brand { display: flex; gap: 16px; align-items: flex-start; }
.site-footer__brand img { width: 84px; height: 84px; object-fit: contain; transition: transform .8s var(--ease-spring); }
.site-footer__brand:hover img { transform: rotate(360deg); }
.site-footer__name { font-family: var(--font-serif); font-weight: 900; font-size: 1.1rem; color: var(--white); margin-bottom: 6px; }
.site-footer__motto { color: rgba(255, 255, 255, .6); }
.site-footer__heading { font-family: var(--font-sans); font-size: var(--fs-xs); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-400); margin-bottom: 14px; }
.site-footer__col ul { list-style: none; display: grid; gap: 10px; }
.site-footer__col a { color: rgba(255, 255, 255, .78); text-decoration: none; display: inline-block; transition: color var(--t-fast) var(--ease), transform var(--t) var(--ease); }
.site-footer__col a:hover, .site-footer__col .link-btn:hover { color: var(--white); transform: translateX(4px); }
.site-footer__col .link-btn { transition: color var(--t-fast) var(--ease), transform var(--t) var(--ease); }
.site-footer__col strong { color: var(--white); }
.site-footer__bottom { border-top: 1px solid rgba(255, 255, 255, .08); }
.site-footer__bottom-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 18px; font-size: var(--fs-xs); color: rgba(255, 255, 255, .5); }
.site-footer__bottom-inner p { margin: 0; }
.site-footer__legal { font-style: italic; }

/* Bouton retour en haut */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--navy-900);
  color: var(--gold-400);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  opacity: 0;
  transform: translateY(16px) scale(.8);
  pointer-events: none;
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease-spring), background var(--t) var(--ease);
}
.back-to-top .icon { transform: rotate(180deg); width: 22px; height: 22px; }
.back-to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.back-to-top:hover { background: var(--navy-700); transform: translateY(-3px); }

/* ---------- 17. Modales ---------- */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(6, 16, 31, .6); backdrop-filter: blur(0); opacity: 0; transition: opacity var(--t) var(--ease), backdrop-filter var(--t) var(--ease); }
.modal.is-open .modal__backdrop { opacity: 1; backdrop-filter: blur(6px); }
.modal__dialog {
  position: relative;
  width: 100%;
  max-width: 500px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  opacity: 0;
  transform: translateY(24px) scale(.96);
  transition: opacity .3s var(--ease), transform .4s var(--ease-spring);
}
.modal.is-open .modal__dialog { opacity: 1; transform: none; }
.modal__dialog--wide { max-width: 720px; }
.modal__head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px 18px 24px;
  background: var(--navy-900);
  border-bottom: 3px solid var(--gold-500);
}
.modal__head img { width: 44px; height: 44px; object-fit: contain; }
.modal__kicker { margin: 0; font-size: .7rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-400); }
.modal__title { color: var(--white); font-family: var(--font-serif); font-size: 1.25rem; }
.modal__close {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 50%;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  transition: background var(--t) var(--ease), transform .4s var(--ease-spring);
}
.modal__close:hover { background: rgba(255, 255, 255, .12); transform: rotate(90deg); }
.modal__body { padding: 24px; }
.modal__switch { margin: 0; text-align: center; font-size: var(--fs-sm); color: var(--gray-500); }
.modal__foot { margin: 0; padding: 14px 24px; background: var(--gray-50); border-top: 1px solid var(--gray-200); font-size: var(--fs-xs); color: var(--gray-500); text-align: center; }

/* ---------- 18. Espace Agent (intranet) ---------- */
body.intranet { background: var(--gray-50); }
body.intranet.is-booting { overflow: hidden; }

/* Écran de chargement */
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: radial-gradient(700px 400px at 50% 30%, rgba(36, 66, 127, .6), transparent 70%), var(--navy-950);
  color: var(--white);
  text-align: center;
  transition: opacity .5s var(--ease), visibility .5s;
}
.boot-screen.is-done { opacity: 0; visibility: hidden; }
.boot-screen__seal { width: 96px; height: 96px; object-fit: contain; animation: float 3s ease-in-out infinite; filter: drop-shadow(0 10px 30px rgba(201, 161, 59, .35)); }
.boot-screen__title { margin: 8px 0 0; font-family: var(--font-serif); font-weight: 900; font-size: 1.3rem; }
.boot-screen__text { margin: 0; color: rgba(255, 255, 255, .65); font-size: var(--fs-sm); }
.boot-screen__bar { position: relative; width: 180px; height: 3px; margin-top: 10px; border-radius: 3px; overflow: hidden; background: rgba(255, 255, 255, .12); }
.boot-screen__bar::after { content: ""; position: absolute; inset: 0; width: 40%; background: linear-gradient(90deg, var(--gold-600), var(--gold-400)); animation: bootBar 1.1s var(--ease) infinite; }

/* Mise en page */
.app { display: grid; grid-template-columns: 272px 1fr; min-height: 100vh; }
.app__sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 14px;
  background: linear-gradient(180deg, var(--navy-950), #081427);
  color: var(--white);
  overflow-y: auto;
  z-index: 40;
}
.app__brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; border-bottom: 1px solid rgba(255, 255, 255, .08); color: var(--white); text-decoration: none; }
.app__brand:hover { color: var(--white); }
.app__brand img { width: 42px; height: 42px; object-fit: contain; transition: transform .6s var(--ease-spring); }
.app__brand:hover img { transform: rotate(-10deg) scale(1.08); }
.app__brand > span { display: flex; flex-direction: column; line-height: 1.2; }
.app__brand-name { font-family: var(--font-serif); font-weight: 900; }
.app__brand-tag { font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-400); }

.app__nav { display: flex; flex-direction: column; gap: 3px; }
.app__nav-group { display: flex; flex-direction: column; gap: 3px; margin-top: 10px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .08); }
.app__nav-label { margin: 6px 10px 6px; font-size: .66rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: rgba(255, 255, 255, .42); }
.app-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, .72);
  font-weight: 600;
  font-size: .93rem;
  text-decoration: none;
  transition: background var(--t) var(--ease), color var(--t) var(--ease), padding var(--t) var(--ease);
}
.app-link .icon { width: 19px; height: 19px; transition: transform var(--t) var(--ease-spring); }
.app-link::before {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 2px;
  background: var(--gold-400);
  transform: scaleY(0);
  transition: transform var(--t) var(--ease-spring);
}
.app-link:hover { color: var(--white); background: rgba(255, 255, 255, .06); padding-left: 16px; }
.app-link:hover .icon { transform: scale(1.12); }
.app-link.is-active { color: var(--gold-400); background: rgba(201, 161, 59, .14); }
.app-link.is-active::before { transform: scaleY(1); }
.app-link__badge {
  margin-left: auto;
  min-width: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--red-500);
  color: var(--white);
  font-size: .7rem;
  font-weight: 800;
  text-align: center;
  animation: pop .5s var(--ease-spring);
}

.app__me { display: flex; align-items: center; gap: 12px; margin-top: auto; padding: 12px; border-radius: var(--radius); background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .06); }
.app__me-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.app__me-name { font-weight: 700; font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app__me-rank { font-size: .72rem; font-weight: 700; color: var(--gold-400); text-transform: uppercase; letter-spacing: .06em; }
.app__scrim { display: none; }

.avatar {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-600), var(--navy-800));
  color: var(--gold-400);
  font-weight: 800;
  font-size: .78rem;
  letter-spacing: .02em;
  box-shadow: 0 0 0 2px rgba(201, 161, 59, .35);
}
.avatar--lg { width: 42px; height: 42px; font-size: .9rem; }
.avatar--xl { width: 64px; height: 64px; font-size: 1.3rem; box-shadow: 0 0 0 3px var(--gold-500); }

.app__main { display: flex; flex-direction: column; min-width: 0; }
.app__topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 28px;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-200);
}
.app__menu-btn { display: none; place-items: center; width: 40px; height: 40px; border: 1px solid var(--gray-300); border-radius: var(--radius-sm); background: var(--surface); color: var(--navy-800); cursor: pointer; }
.app__crumb { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: var(--fs-sm); color: var(--gray-500); white-space: nowrap; }
.status-pill { white-space: nowrap; }
.app__crumb .icon { transform: rotate(-90deg); width: 14px; height: 14px; }
.app__crumb strong { color: var(--heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app__top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.status-pill--dark { margin: 0; background: var(--navy-900); border-color: var(--navy-900); }
.status-pill--dark:hover { background: var(--navy-800); }
.app__content { padding: 28px; display: grid; align-content: start; }

/* Vues */
.view { display: grid; gap: 22px; align-content: start; }
.view.is-entering { animation: viewIn .45s var(--ease) both; }
.view__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.view__title { font-family: var(--font-serif); font-weight: 900; font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
.view__sub { margin: 4px 0 0; color: var(--gray-500); max-width: 680px; }
.view__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Bandeau d'accueil */
.welcome {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 32px;
  border-radius: var(--radius-lg);
  color: var(--white);
  background:
    radial-gradient(600px 300px at 90% 0%, rgba(201, 161, 59, .25), transparent 60%),
    linear-gradient(135deg, var(--navy-950), var(--navy-800));
  box-shadow: var(--shadow-lg);
}
.welcome::before {
  content: "";
  position: absolute;
  inset: -50%;
  background: repeating-linear-gradient(115deg, rgba(255, 255, 255, .03) 0 2px, transparent 2px 22px);
  animation: drift 40s linear infinite;
}
.welcome__text { position: relative; }
.welcome__kicker { margin: 0 0 6px; color: var(--gold-400); font-size: var(--fs-xs); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.welcome__title { color: var(--white); font-family: var(--font-serif); font-weight: 900; font-size: clamp(1.4rem, 3vw, 2.1rem); }
.welcome__sub { margin: 8px 0 0; color: rgba(255, 255, 255, .75); }
.welcome__sub strong { color: var(--white); }
.welcome__seal { position: relative; width: 110px; height: 110px; object-fit: contain; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .4)); animation: float 6s ease-in-out infinite; }

/* Grille de cartes */
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.card-panel {
  background: var(--surface);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  animation: fadeUp .5s var(--ease) both;
  transition: box-shadow var(--t) var(--ease), transform var(--t) var(--ease);
}
.card-panel:hover { box-shadow: var(--shadow-md); }
.card-panel--wide { grid-column: span 1; }
.card-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-panel__head h2 { font-size: 1rem; font-family: var(--font-sans); font-weight: 800; }
.card-panel__foot { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--gray-100); }
.card-panel__label { margin: 0 0 10px; font-size: var(--fs-xs); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--gray-500); }
.dash-grid > .status-card { box-shadow: var(--shadow-md); }

.link-more { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); font-weight: 700; text-decoration: none; }
.link-more .icon { transition: transform var(--t) var(--ease); }
.link-more:hover .icon { transform: translateX(3px); }
.muted { color: var(--gray-500); font-size: var(--fs-sm); }

.id-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; margin: 0; }
.id-list dt { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gray-500); }
.id-list dd { margin: 3px 0 0; font-weight: 700; color: var(--heading); }

.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: var(--gray-100); color: var(--gray-700); font-size: .74rem; font-weight: 700; white-space: nowrap; }
.chip--gold { background: var(--gold-100); color: var(--gold-700); }

.rank-badge { display: inline-block; padding: 3px 10px; border-radius: var(--radius-xs); background: var(--navy-50); color: var(--navy-700); border: 1px solid var(--navy-100); font-size: .78rem; font-weight: 800; white-space: nowrap; }
.rank-badge--command { background: var(--navy-900); color: var(--gold-400); border-color: var(--navy-900); }

/* Annonces */
.announce-list { display: grid; gap: 14px; }
.announce {
  position: relative;
  padding: 18px 20px 18px 22px;
  background: var(--surface);
  border: 1px solid var(--gray-200);
  border-left: 4px solid var(--blue-600);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  animation: fadeUp .45s var(--ease) both;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.announce:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.announce--important { border-left-color: var(--gold-500); }
.announce--urgent { border-left-color: var(--red-600); background: linear-gradient(90deg, var(--red-100), var(--surface) 30%); }
.announce.is-pinned { box-shadow: inset 0 0 0 1px var(--gold-400), var(--shadow-sm); }
.announce__meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.announce__pin { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 700; color: var(--gold-700); }
.announce__pin .icon { width: 14px; height: 14px; }
.announce__date { margin-left: auto; font-size: var(--fs-xs); color: var(--gray-500); }
.announce__title { font-size: 1.05rem; margin-bottom: 6px; }
.announce__content { color: var(--gray-700); white-space: pre-line; font-size: .94rem; }
.announce__author { display: inline-flex; align-items: center; gap: 6px; margin: 10px 0 0; font-size: var(--fs-xs); font-weight: 700; color: var(--gray-500); }
.announce__author .icon { width: 14px; height: 14px; }
.announce .btn { position: absolute; top: 14px; right: 14px; }
.announce-list--compact .announce { padding: 12px 14px 12px 16px; }
.announce-list--compact .announce__content { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Résumé du dossier */
.dossier-summary { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dossier-summary__item {
  --c: var(--blue-600);
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  border-left: 4px solid var(--c);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.dossier-summary__item span { font-family: var(--font-serif); font-size: 1.5rem; font-weight: 900; color: var(--heading); letter-spacing: 0; }
.dossier-summary__item--commendation { --c: var(--green-600); }
.dossier-summary__item--warning { --c: var(--amber-500); }
.dossier-summary__item--reprimand { --c: var(--red-600); }

/* Filtres segmentés */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow-xs); justify-self: start; }
.segmented__btn { padding: 7px 14px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--gray-500); font-weight: 700; font-size: .85rem; cursor: pointer; transition: background var(--t) var(--ease), color var(--t) var(--ease); }
.segmented__btn:hover { color: var(--heading); background: var(--gray-50); }
.segmented__btn.is-active { background: var(--navy-800); color: var(--white); box-shadow: var(--shadow-sm); }

/* Chronologie (dossier) */
.timeline { list-style: none; position: relative; display: grid; gap: 14px; }
.timeline::before { content: ""; position: absolute; left: 19px; top: 8px; bottom: 8px; width: 2px; background: var(--gray-200); }
.timeline__item { --c: var(--blue-600); --c-soft: var(--blue-100); position: relative; display: flex; gap: 14px; animation: fadeUp .45s var(--ease) both; }
.timeline__item--commendation { --c: var(--green-600); --c-soft: var(--green-100); }
.timeline__item--warning { --c: #9a6a00; --c-soft: var(--amber-100); }
.timeline__item--reprimand { --c: var(--red-600); --c-soft: var(--red-100); }
.timeline__item--note { --c: var(--gray-700); --c-soft: var(--gray-100); }
.timeline__dot { position: relative; z-index: 1; display: grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; background: var(--c-soft); color: var(--c); box-shadow: 0 0 0 4px var(--gray-50); }
.timeline__dot .icon { width: 18px; height: 18px; }
.timeline__body { position: relative; flex: 1; padding: 14px 16px; background: var(--surface); border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.timeline__meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: var(--fs-xs); color: var(--gray-500); }
.timeline__text { margin: 0; white-space: pre-line; color: var(--text); }
.timeline__author { margin: 8px 0 0; font-size: var(--fs-xs); font-weight: 700; color: var(--gray-500); }
.timeline__body .btn { margin-top: 10px; }
.timeline--compact .timeline__dot { width: 34px; height: 34px; }
.timeline--compact::before { left: 16px; }
.kind { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.kind--message { background: var(--blue-100); color: var(--blue-600); }
.kind--commendation { background: var(--green-100); color: var(--green-600); }
.kind--warning { background: var(--amber-100); color: #8a5d00; }
.kind--reprimand { background: var(--red-100); color: var(--red-600); }
.kind--note { background: var(--gray-100); color: var(--gray-700); }

/* États vides et squelettes */
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 36px 20px; color: var(--gray-500); text-align: center; background: var(--surface); border: 1px dashed var(--gray-300); border-radius: var(--radius); }
.empty .icon { width: 30px; height: 30px; color: var(--gray-300); }
.empty p { margin: 0; }
.skeleton-card { display: grid; gap: 10px; padding: 18px; background: var(--surface); border: 1px solid var(--gray-200); border-radius: var(--radius); }

/* Formulaires intranet */
.form--narrow { max-width: 560px; }
.field--inline { align-self: end; padding: 11px 14px; }
.strength { height: 5px; border-radius: 3px; background: var(--gray-100); overflow: hidden; }
.strength__bar { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--red-600); transition: width .35s var(--ease), background .35s var(--ease); }
.strength__bar[data-score="1"] { width: 25%; background: var(--red-600); }
.strength__bar[data-score="2"] { width: 50%; background: var(--amber-500); }
.strength__bar[data-score="3"] { width: 75%; background: var(--blue-600); }
.strength__bar[data-score="4"] { width: 100%; background: var(--green-600); }
.alert-form__signature { margin: 0; font-size: var(--fs-sm); color: var(--gray-500); }
.alert-form__signature strong { color: var(--heading); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.split__title { font-size: 1rem; font-family: var(--font-sans); font-weight: 800; margin-bottom: 12px; }

/* Graphiques en barres */
.bar-chart { list-style: none; display: grid; gap: 10px; }
.bar-chart__row { display: grid; grid-template-columns: 130px 1fr 34px; align-items: center; gap: 10px; font-size: var(--fs-sm); }
.bar-chart__label { font-weight: 600; color: var(--gray-700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-chart__track { height: 10px; border-radius: 999px; background: var(--gray-100); overflow: hidden; }
.bar-chart__fill { display: block; height: 100%; width: var(--w, 0%); border-radius: 999px; background: linear-gradient(90deg, var(--navy-600), var(--navy-800)); transform-origin: left; animation: barGrow .9s var(--ease) both; }
.bar-chart--gold .bar-chart__fill { background: linear-gradient(90deg, var(--gold-400), var(--gold-600)); }
.bar-chart__value { font-weight: 800; color: var(--heading); text-align: right; font-variant-numeric: tabular-nums; }

/* Flux d'activité */
.feed { list-style: none; display: grid; gap: 2px; }
.feed__item { display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 4px 12px; padding: 10px 6px; border-bottom: 1px solid var(--gray-100); animation: fadeUp .4s var(--ease) both; }
.feed__item:last-child { border-bottom: 0; }
.feed__text { margin: 0; font-size: var(--fs-sm); color: var(--gray-700); }
.feed__text strong { color: var(--heading); }
.feed__details { grid-column: 2 / 3; margin: 0; font-size: var(--fs-xs); color: var(--gray-500); }
.feed__time { grid-column: 3; grid-row: 1; font-size: .72rem; color: var(--gray-500); white-space: nowrap; }

/* Liste de personnes */
.people { list-style: none; display: grid; gap: 4px; }
.person { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: transparent; text-align: left; cursor: pointer; transition: background var(--t) var(--ease); }
.person:hover { background: var(--navy-50); }
.person__text { display: flex; flex-direction: column; flex: 1; line-height: 1.3; }
.person__text strong { color: var(--heading); font-size: var(--fs-sm); }
.person__text span { color: var(--gray-500); font-size: var(--fs-xs); }
.person__arrow { color: var(--gray-300); transition: transform var(--t) var(--ease), color var(--t) var(--ease); }
.person:hover .person__arrow { transform: translateX(3px); color: var(--gold-600); }

/* Filtres et tableau interactif */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--gray-200); background: var(--gray-25); }
.filters .search { flex: 1 1 260px; }
.filters .search input, .filters .search input:focus { width: 100%; }
.filter select {
  padding: 10px 34px 10px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231a3263' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  appearance: none;
  font: inherit;
  font-size: .88rem;
  color: var(--heading);
  cursor: pointer;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.filter select:focus { outline: none; border-color: var(--navy-600); box-shadow: var(--ring-blue); }
.table--interactive tbody tr { cursor: pointer; }
.table--interactive tbody tr:focus-visible { outline: 2px solid var(--gold-500); outline-offset: -2px; }
.th-sort { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.th-sort::after { content: "↕"; opacity: .35; font-size: .8rem; }
.th-sort.is-asc::after { content: "↑"; opacity: 1; color: var(--navy-700); }
.th-sort.is-desc::after { content: "↓"; opacity: 1; color: var(--navy-700); }
.th-sort:hover { color: var(--heading); }
.agent-cell { display: flex; align-items: center; gap: 10px; }
.agent-cell__text { display: flex; flex-direction: column; line-height: 1.25; }
.agent-cell__text strong { color: var(--heading); }
.agent-cell__text span { font-size: var(--fs-xs); color: var(--gray-500); }
.panel__foot { display: flex; justify-content: center; padding: 14px; border-top: 1px solid var(--gray-100); }
.panel__foot:has(> [hidden]:only-child) { display: none; }

/* Tiroir « fiche agent » */
.drawer { position: fixed; inset: 0; z-index: 250; }
.drawer__backdrop { position: absolute; inset: 0; background: rgba(6, 16, 31, .5); backdrop-filter: blur(0); opacity: 0; transition: opacity .3s var(--ease), backdrop-filter .3s var(--ease); }
.drawer.is-open .drawer__backdrop { opacity: 1; backdrop-filter: blur(4px); }
.drawer__panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  background: var(--gray-50);
  box-shadow: var(--shadow-xl);
  transform: translateX(100%);
  transition: transform .4s var(--ease);
}
.drawer.is-open .drawer__panel { transform: none; }
.drawer__head {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px;
  color: var(--white);
  background: radial-gradient(400px 200px at 100% 0%, rgba(201, 161, 59, .25), transparent 60%), linear-gradient(135deg, var(--navy-950), var(--navy-800));
}
.drawer__id { flex: 1; min-width: 0; }
.drawer__rank { margin: 0; font-size: var(--fs-xs); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-400); }
.drawer__name { color: var(--white); font-family: var(--font-serif); font-weight: 900; font-size: 1.4rem; margin: 2px 0 4px; }
.drawer__sub { margin: 0 0 10px; font-size: var(--fs-xs); color: rgba(255, 255, 255, .7); }
.drawer__close { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 50%; background: transparent; color: var(--white); cursor: pointer; transition: background var(--t) var(--ease), transform .4s var(--ease-spring); }
.drawer__close:hover { background: rgba(255, 255, 255, .12); transform: rotate(90deg); }
.drawer__tabs { display: flex; gap: 2px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--gray-200); }
.drawer-tab { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 13px 14px; border: 0; background: none; color: var(--gray-500); font-weight: 700; font-size: .88rem; cursor: pointer; transition: color var(--t) var(--ease); }
.drawer-tab::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--gold-500); transform: scaleX(0); transition: transform var(--t) var(--ease); }
.drawer-tab:hover { color: var(--heading); }
.drawer-tab.is-active { color: var(--heading); }
.drawer-tab.is-active::after { transform: scaleX(1); }
.drawer-tab__count { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--gray-100); color: var(--gray-700); font-size: .7rem; text-align: center; }
.drawer__body { flex: 1; overflow-y: auto; padding: 18px; display: grid; gap: 14px; align-content: start; }
.drawer__pane { display: grid; gap: 14px; animation: fadeIn .3s var(--ease); }
.drawer-section { display: grid; gap: 12px; padding: 18px; background: var(--surface); border: 1px solid var(--gray-200); border-radius: var(--radius); }
.drawer-section__title { font-family: var(--font-sans); font-size: .82rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--gray-500); }
.drawer-section__hint { margin: 0; font-size: var(--fs-sm); color: var(--gray-500); }
.drawer-section--danger { border-color: rgba(179, 38, 30, .35); background: linear-gradient(180deg, var(--surface), var(--danger-tint)); }
.drawer-section .btn { justify-self: start; }
.inline-form { display: flex; gap: 10px; align-items: center; }
.inline-form .select-wrap { flex: 1; }
.inline-form select { width: 100%; padding: 10px 40px 10px 12px; border: 1px solid var(--gray-300); border-radius: var(--radius-sm); font: inherit; background: var(--surface); }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }
.notice { display: flex; align-items: center; gap: 10px; margin: 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--amber-100); color: #7a5200; font-size: var(--fs-sm); font-weight: 600; }

.spec-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.spec-group { margin: 0; padding: 10px 12px; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); background: var(--gray-25); }
.spec-group legend { padding: 0 4px; font-size: .72rem; font-weight: 800; color: var(--navy-700); }
.check { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: var(--fs-sm); cursor: pointer; }
.check input { flex-shrink: 0; width: 17px; height: 17px; accent-color: var(--navy-700); cursor: pointer; }

.secret-box { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 10px; padding: 14px; border-radius: var(--radius-sm); background: var(--green-100); border: 1px solid rgba(20, 122, 63, .3); animation: fadeUp .35s var(--ease) both; }
.secret-box code { font-size: 1.1rem; letter-spacing: .08em; background: var(--surface); padding: 6px 10px; }
.secret-box__hint { grid-column: 1 / -1; margin: 0; font-size: var(--fs-xs); color: var(--green-600); font-weight: 600; }

/* ---------- Panel Admin : identité « commandement » ---------- */
.btn--command { --btn-bg: var(--red-600); --btn-fg: var(--white); }
.btn--command:hover { --btn-bg: #9b1f18; box-shadow: 0 10px 24px -8px rgba(179, 38, 30, .55); }
.app-link--command { color: #ffb4ae; background: rgba(179, 38, 30, .18); border: 1px solid rgba(214, 58, 49, .35); }
.app-link--command:hover { color: var(--white); background: rgba(179, 38, 30, .35); }
.app-link__out { margin-left: auto; width: 15px !important; height: 15px !important; opacity: .6; }

.app--command .app__sidebar {
  background:
    radial-gradient(420px 260px at 0% 0%, rgba(179, 38, 30, .28), transparent 70%),
    linear-gradient(180deg, #120a10, #0a0f1f 55%, #06101f);
  border-right: 1px solid rgba(214, 58, 49, .25);
}
.app--command .app__brand { border-bottom-color: rgba(214, 58, 49, .25); }
.app--command .app__brand-tag { color: #ff8a82; }
.app--command .app-link.is-active { color: var(--white); background: linear-gradient(90deg, rgba(179, 38, 30, .55), rgba(179, 38, 30, .15)); }
.app--command .app-link::before { background: #ff5a4f; }
.app--command .app__me-rank { color: #ff8a82; }
.app--command .app__topbar { border-bottom: 3px solid var(--red-600); }
.command-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--red-600);
  color: var(--white);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.command-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--surface); animation: blink 1.4s ease-in-out infinite; }
.admin-page .view__title::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  margin-top: 8px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--red-600), var(--gold-500));
}
.boot-screen--command { background: radial-gradient(700px 400px at 50% 30%, rgba(179, 38, 30, .45), transparent 70%), #0a0710; }
.boot-screen--command .boot-screen__bar::after { background: linear-gradient(90deg, var(--red-600), #ff8a82); }

/* ---------- Documents administratifs ---------- */
.doc-list { display: grid; gap: 10px; }
.doc-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  text-align: left;
  cursor: pointer;
  animation: fadeUp .4s var(--ease) both;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
.doc-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--navy-100); }
.doc-card__icon, .doc-type__icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--navy-50); color: var(--navy-700); transition: background var(--t) var(--ease), color var(--t) var(--ease), transform .5s var(--ease-spring); }
.doc-card:hover .doc-card__icon { background: var(--navy-700); color: var(--gold-400); transform: rotate(-6deg); }
.doc-card__body { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.doc-card__type { font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-700); }
.doc-card__title { color: var(--heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-card__meta { font-size: var(--fs-xs); color: var(--gray-500); }

.doc-step__hint { margin-bottom: 14px; color: var(--gray-700); }
.doc-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.doc-type {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
.doc-type strong { color: var(--heading); font-size: .9rem; line-height: 1.25; }
.doc-type span:last-child { font-size: var(--fs-xs); color: var(--gray-500); line-height: 1.35; }
.doc-type:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--gold-400); }
.doc-type:hover .doc-type__icon { background: var(--navy-700); color: var(--gold-400); transform: scale(1.08); }
.doc-step__back { justify-self: start; font-size: var(--fs-sm); }
.doc-step__type { margin: 0; font-family: var(--font-serif); font-weight: 900; font-size: 1.15rem; color: var(--heading); }

.doc-view { display: grid; gap: 16px; }
.doc-view__head { padding-bottom: 14px; border-bottom: 2px solid var(--gray-100); }
.doc-view__type { margin: 0 0 4px; font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-700); }
.doc-view__title { font-family: var(--font-serif); font-size: 1.3rem; margin-bottom: 8px; }
.doc-view__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: var(--fs-sm); color: var(--gray-500); }
.doc-view__subject { display: inline-flex; align-items: center; gap: 6px; margin: 10px 0 0; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--navy-50); color: var(--navy-800); font-size: var(--fs-sm); font-weight: 700; }
.doc-view__fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; margin: 0; }
.doc-view__row--wide { grid-column: 1 / -1; }
.doc-view__row dt { font-size: var(--fs-xs); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gray-500); }
.doc-view__row dd { margin: 4px 0 0; white-space: pre-line; color: var(--text); }
.doc-view__review { padding: 14px 16px; border-radius: var(--radius-sm); border-left: 4px solid var(--blue-600); background: var(--blue-100); }
.doc-view__review--approved { border-color: var(--green-600); background: var(--green-100); }
.doc-view__review--rejected { border-color: var(--red-600); background: var(--red-100); }
.doc-view__review--filed { border-color: var(--gray-500); background: var(--gray-100); }
.doc-view__review p { margin: 0; white-space: pre-line; }
.doc-view__review-title { font-weight: 800; margin-bottom: 4px !important; }
.doc-view__actions { margin-top: 16px; }
.doc-review-form { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--gray-200); }
.doc-type-cell { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--navy-800); white-space: nowrap; }
.segmented__btn--radio { position: relative; }
.segmented__btn--radio input { position: absolute; opacity: 0; pointer-events: none; }
.segmented__btn--radio:has(input:checked) { background: var(--navy-800); color: var(--white); box-shadow: var(--shadow-sm); }
.segmented__btn--radio:has(input:focus-visible) { box-shadow: var(--ring); }

/* ---------- Discipline ---------- */
.discipline-badge {
  --c: var(--blue-600); --c-soft: var(--blue-100);
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 999px;
  background: var(--c-soft); color: var(--c);
  font-size: .7rem; font-weight: 800; letter-spacing: .04em; white-space: nowrap;
}
.discipline-badge--2 { --c: #8a5d00; --c-soft: var(--amber-100); }
.discipline-badge--3 { --c: var(--orange-600); --c-soft: var(--orange-100); }
.discipline-badge--4 { --c: var(--red-600); --c-soft: var(--red-100); }
.discipline-badge--5 { --c: var(--white); --c-soft: var(--red-600); }

.discipline-list { list-style: none; display: grid; gap: 10px; }
.discipline-list--panel { padding: 16px 20px; }
.discipline {
  --c: var(--blue-600);
  position: relative;
  padding: 14px 16px 14px 18px;
  background: var(--surface);
  border: 1px solid var(--gray-200);
  border-left: 4px solid var(--c);
  border-radius: var(--radius);
  animation: fadeUp .4s var(--ease) both;
}
.discipline--2 { --c: var(--amber-500); }
.discipline--3 { --c: var(--orange-600); }
.discipline--4, .discipline--5 { --c: var(--red-600); }
.discipline.is-lifted { opacity: .72; border-left-style: dashed; }
.discipline__body { display: grid; gap: 6px; }
.discipline__body > .btn { justify-self: start; margin-top: 4px; }
.discipline > .btn { margin-top: 8px; }
.discipline__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--fs-xs); color: var(--gray-500); }
.discipline__meta time { margin-left: auto; }
.discipline__user { margin: 0; font-weight: 800; color: var(--heading); }
.discipline__reason { margin: 0; white-space: pre-line; }
.discipline__extra { margin: 0; font-size: var(--fs-sm); font-weight: 700; color: var(--red-600); }
.discipline__author, .discipline__lifted { margin: 0; font-size: var(--fs-xs); color: var(--gray-500); font-weight: 600; }
.discipline__lifted { color: var(--green-600); }

/* Échelle (vue Discipline) */
.scale { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.scale__item {
  --c: var(--blue-600);
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--gray-200);
  border-top: 4px solid var(--c);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  color: var(--gray-700);
  box-shadow: var(--shadow-xs);
  animation: fadeUp .45s var(--ease) both;
}
.scale__item:nth-child(2) { --c: var(--amber-500); animation-delay: .05s; }
.scale__item:nth-child(3) { --c: var(--orange-600); animation-delay: .1s; }
.scale__item:nth-child(4) { --c: var(--red-600); animation-delay: .15s; }
.scale__item:nth-child(5) { --c: #7a1410; animation-delay: .2s; }
.scale__num { font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--c); }
.scale__item strong { color: var(--heading); font-size: .95rem; }

/* Choix du niveau (fiche agent) */
.level-picker { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.level-option { --c: var(--blue-600); position: relative; cursor: pointer; }
.level-option--2 { --c: var(--amber-500); }
.level-option--3 { --c: var(--orange-600); }
.level-option--4, .level-option--5 { --c: var(--red-600); }
.level-option input { position: absolute; opacity: 0; pointer-events: none; }
.level-option__box { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--gray-200); border-left: 4px solid var(--c); border-radius: var(--radius-sm); background: var(--surface); transition: background var(--t) var(--ease), box-shadow var(--t) var(--ease), transform var(--t) var(--ease); }
.level-option__num { display: grid; place-items: center; flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--gray-100); color: var(--c); font-weight: 900; }
.level-option__text { display: flex; flex-direction: column; line-height: 1.3; }
.level-option__text strong { color: var(--heading); font-size: .9rem; }
.level-option__text small { color: var(--gray-500); font-size: .76rem; }
.level-option:hover .level-option__box { transform: translateX(3px); }
.level-option input:checked + .level-option__box { background: var(--gray-50); box-shadow: 0 0 0 2px var(--c); }
.level-option input:checked + .level-option__box .level-option__num { background: var(--c); color: var(--white); }
.level-option input:focus-visible + .level-option__box { box-shadow: var(--ring); }
.level-option input:disabled + .level-option__box { opacity: .5; cursor: not-allowed; transform: none; }
.notice--danger { background: var(--red-100); color: var(--red-600); }
.drawer-section__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.drawer-tab__count--alert { background: var(--red-100); color: var(--red-600); }
.drawer-tab__count--alert.is-zero { background: var(--gray-100); color: var(--gray-500); }

/* ---------- Fiche de suivi ---------- */
.suivi { display: grid; gap: 20px; }
.suivi__head { padding-bottom: 12px; border-bottom: 2px solid var(--gold-500); }
.suivi__kicker { margin: 0; font-size: .7rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-700); }
.suivi__name { font-family: var(--font-serif); font-size: 1.35rem; margin-top: 4px; }
.suivi__identity { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 18px; margin: 0; }
.suivi__identity dt { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gray-500); }
.suivi__identity dd { margin: 3px 0 0; font-weight: 700; color: var(--heading); }
.suivi__section { display: grid; gap: 10px; }
.suivi__title { display: flex; align-items: center; gap: 8px; font-family: var(--font-sans); font-size: .85rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--navy-700); padding-bottom: 6px; border-bottom: 1px solid var(--gray-100); }
.suivi__title .icon { color: var(--gold-600); }

.record-list { list-style: none; display: grid; gap: 8px; }
.record { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); background: var(--surface); }
.record__status { display: grid; place-items: center; flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; }
.record__status--passed { background: var(--green-100); color: var(--green-600); }
.record__status--failed { background: var(--red-100); color: var(--red-600); }
.record__body { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.35; }
.record__body strong { color: var(--heading); font-size: .92rem; }
.record__meta { font-size: var(--fs-xs); color: var(--gray-500); }
.record__comment { font-size: var(--fs-sm); color: var(--gray-700); margin-top: 2px; }

.eval-list { display: grid; gap: 10px; }
.eval { padding: 12px 14px; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); background: var(--surface); }
.eval__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.eval__head strong { color: var(--heading); }
.eval__date { margin-left: auto; font-size: var(--fs-xs); color: var(--gray-500); }
.eval__line { margin: 2px 0; font-size: var(--fs-sm); color: var(--gray-700); }
.eval__line b { color: var(--navy-800); }
.eval__author { margin: 6px 0 0; font-size: var(--fs-xs); font-weight: 700; color: var(--gray-500); }
.eval .btn { margin-top: 8px; }
.stars { color: var(--gold-500); letter-spacing: 2px; font-size: 1rem; }

.rank-history { list-style: none; display: grid; gap: 8px; position: relative; }
.rank-history__item { display: flex; gap: 12px; align-items: flex-start; }
.rank-history__item > div { display: flex; flex-direction: column; line-height: 1.35; }
.rank-history__item strong { color: var(--heading); font-size: .92rem; }
.rank-history__icon { display: grid; place-items: center; flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--navy-50); color: var(--navy-700); }
.rank-history__item--up .rank-history__icon { background: var(--green-100); color: var(--green-600); }
.rank-history__item--down .rank-history__icon { background: var(--red-100); color: var(--red-600); }
.rank-history__item--arrival .rank-history__icon { background: var(--gold-100); color: var(--gold-700); }

.kpi-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.kpi--info { --k: var(--blue-600); --k-soft: var(--blue-100); }
.kpi--link { text-decoration: none; color: inherit; }
.kpi--link:hover { color: inherit; border-color: var(--k); }
.filter--grow { flex: 1 1 280px; }
.filter--grow select { width: 100%; }

/* ---------- Dossiers d'enquête (MDC) ---------- */
.view__kicker { margin: 0 0 4px; font-size: .7rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-700); }
.panel__count { margin: 0; padding: 10px 20px; font-size: var(--fs-xs); font-weight: 700; color: var(--gray-500); border-bottom: 1px solid var(--gray-100); }
.panel__count:empty { display: none; }
.filters .segmented { box-shadow: none; }

.case-num { display: inline-flex; align-items: center; gap: 6px; }
.case-num .icon { width: 15px; height: 15px; color: var(--red-600); }
.case-num code { font-weight: 800; letter-spacing: .04em; }
.case-lock .icon { width: 12px; height: 12px; }
.case-lock::before { content: none; }
.case-mini__num { flex-shrink: 0; padding: 4px 8px; border-radius: var(--radius-xs); background: var(--navy-50); color: var(--heading); font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .74rem; font-weight: 800; }

.crime-chip { --c: var(--gray-700); --c-soft: var(--gray-100); display: inline-flex; padding: 3px 10px; border-radius: var(--radius-xs); border-left: 3px solid var(--c); background: var(--c-soft); color: var(--c); font-size: .74rem; font-weight: 800; white-space: nowrap; }
.crime-chip--homicide { --c: var(--red-600); --c-soft: var(--red-100); }
.crime-chip--robbery { --c: var(--orange-600); --c-soft: var(--orange-100); }
.crime-chip--trafficking { --c: var(--blue-600); --c-soft: var(--blue-100); }
.crime-chip--organized { --c: var(--gold-700); --c-soft: var(--gold-100); }

/* Barre d'outils du dossier */
.case-detail { display: grid; gap: 18px; animation: viewIn .45s var(--ease) both; }
.case-toolbar { position: sticky; top: 66px; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; background: var(--surface); border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow-md); }
.case-back .icon { transform: rotate(180deg); }
.btn.case-back:hover .icon:first-child { transform: rotate(180deg) translateX(4px); }
.case-toolbar__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.case-toolbar__warn { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 700; color: var(--orange-600); }
.case-toolbar__warn .icon { width: 15px; height: 15px; }
#case-save-btn.is-pulsing { animation: savePulse 2s var(--ease) infinite; }

/* Feuille du dossier (aspect document officiel) */
.case-sheet {
  position: relative;
  display: grid;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--gray-200);
  border-top: 5px solid var(--navy-800);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.case-sheet.is-confidential { border-top-color: var(--red-600); }
.case-sheet::after {
  content: "";
  position: absolute;
  right: -40px; bottom: -40px;
  width: 260px; height: 260px;
  background: url("assets/logo-sasp.png") no-repeat center / contain;
  opacity: .04;
  pointer-events: none;
}
.case-sheet__head { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 24px 28px; border-bottom: 1px solid var(--gray-200); background: linear-gradient(180deg, var(--gray-25), var(--surface)); }
.case-sheet__seal { width: 64px; height: 64px; object-fit: contain; }
.case-sheet__agency { min-width: 0; }
.case-sheet__org { margin: 0; font-family: var(--font-serif); font-weight: 900; font-size: .95rem; color: var(--heading); text-transform: uppercase; letter-spacing: .06em; }
.case-sheet__dept { margin: 0 0 6px; font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-700); }
.case-sheet__title { font-family: var(--font-serif); font-weight: 900; font-size: clamp(1.25rem, 2.4vw, 1.7rem); }
.case-sheet__title-field { margin-top: 4px; }
.case-sheet__ref { position: relative; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.case-sheet__ref-label { font-size: .66rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--gray-500); }
.case-sheet__ref-num { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 1.35rem; font-weight: 800; color: var(--heading); letter-spacing: .06em; }
.case-stamp {
  margin-top: 8px;
  padding: 4px 12px;
  border: 3px double var(--red-600);
  border-radius: var(--radius-xs);
  color: var(--red-600);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .22em;
  text-transform: uppercase;
  transform: rotate(-6deg);
  animation: stampIn .5s var(--ease-spring) both;
}

.case-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0; border-bottom: 1px solid var(--gray-200); }
.case-meta__item { padding: 14px 20px; border-right: 1px solid var(--gray-100); border-bottom: 1px solid var(--gray-100); min-width: 0; }
.case-meta__item--wide { grid-column: span 2; }
.case-meta dt { margin-bottom: 6px; font-size: .66rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--gray-500); }
.case-meta dd { margin: 0; font-weight: 700; color: var(--heading); font-size: .92rem; }

.case-section { position: relative; padding: 22px 28px; border-bottom: 1px solid var(--gray-100); }
.case-section:last-child { border-bottom: 0; }
.case-section__head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; color: var(--navy-600); }
.case-section__head .icon { width: 18px; height: 18px; }
.case-section__num { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--navy-800); color: var(--gold-400); font-family: ui-monospace, Consolas, monospace; font-size: .78rem; font-weight: 800; }
.case-section__title { font-family: var(--font-sans); font-size: .82rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.case-stack { display: grid; gap: 14px; }
.case-stack > .btn { justify-self: start; }
.case-text { margin: 0; white-space: pre-line; color: var(--text); line-height: 1.7; }
.case-text--report { padding: 18px 20px; border-left: 3px solid var(--gold-500); background: var(--gray-25); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-family: var(--font-serif); font-size: .95rem; }
.case-subtitle { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: .9rem; font-family: var(--font-sans); font-weight: 800; }
.case-subtitle__count { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--gray-100); color: var(--gray-700); font-size: .7rem; text-align: center; }
.case-persons--suspect .case-subtitle { color: var(--red-600); }
.case-person { font-weight: 800; color: var(--heading); }

.case-table { border: 1px solid var(--gray-200); border-radius: var(--radius-sm); overflow: hidden; }
.case-table td { padding: 10px 14px; vertical-align: top; }
.case-table th { padding: 9px 14px; }
.case-table td > span { white-space: pre-line; }

.case-input {
  width: 100%;
  min-width: 110px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: .9rem;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.case-input:focus { outline: none; border-color: var(--navy-600); box-shadow: var(--ring-blue); }
textarea.case-input { resize: vertical; line-height: 1.5; }
.select-wrap .case-input { padding-right: 34px; appearance: none; cursor: pointer; }
.select-wrap:has(.case-input)::after { right: 12px; }
.case-label { display: grid; gap: 4px; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--gray-500); }

.icon-btn { display: inline-grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; border: 1px solid var(--gray-300); border-radius: var(--radius-sm); background: var(--surface); color: var(--gray-500); cursor: pointer; transition: color var(--t) var(--ease), border-color var(--t) var(--ease), background var(--t) var(--ease), transform var(--t) var(--ease); }
.icon-btn .icon { width: 16px; height: 16px; }
.icon-btn--danger:hover { color: var(--red-600); border-color: var(--red-600); background: var(--red-100); transform: scale(1.06); }

.suspicion { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.suspicion::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.suspicion--low { background: var(--green-100); color: var(--green-600); }
.suspicion--medium { background: var(--amber-100); color: #8a5d00; }
.suspicion--high { background: var(--red-100); color: var(--red-600); }
.suspicion--high::before { animation: blink 1.4s ease-in-out infinite; }

/* Pistes d'investigation */
.case-progress { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 14px; }
.case-progress__label { font-size: var(--fs-xs); font-weight: 800; color: var(--gray-500); }
.case-progress__track { height: 8px; border-radius: 999px; background: var(--gray-100); overflow: hidden; }
.case-progress__fill { display: block; height: 100%; width: var(--w, 0%); border-radius: 999px; background: linear-gradient(90deg, var(--green-600), #3ecf7c); transition: width .5s var(--ease); }
.lead-list { list-style: none; display: grid; gap: 6px; }
.lead { border: 1px solid var(--gray-200); border-radius: var(--radius-sm); background: var(--surface); transition: background var(--t) var(--ease), border-color var(--t) var(--ease); }
.lead:hover { border-color: var(--gray-300); }
.lead__label { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; }
.lead input { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--green-600); cursor: pointer; }
.lead input:disabled { cursor: default; }
.lead__mark { font-family: ui-monospace, Consolas, monospace; font-weight: 800; color: var(--gray-500); }
.lead.is-done { background: var(--green-100); border-color: transparent; }
.lead.is-done .lead__mark { color: var(--green-600); }
.lead.is-done .lead__label > span:last-child { text-decoration: line-through; text-decoration-color: var(--green-600); color: var(--gray-500); }
.lead--edit { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }

/* Interrogatoires */
.interview { display: grid; gap: 12px; padding: 16px 18px; border: 1px solid var(--gray-200); border-left: 4px solid var(--navy-600); border-radius: var(--radius-sm); background: var(--gray-25); animation: fadeUp .35s var(--ease) both; }
.interview__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; }
.interview__head strong { color: var(--heading); }
.interview__head span { font-size: var(--fs-xs); color: var(--gray-500); }
.interview__fields { display: grid; grid-template-columns: 1.3fr 1fr 1.3fr auto; gap: 10px; align-items: end; }
.qa { display: grid; gap: 6px; margin: 0; }
.qa__q, .qa__a { display: flex; gap: 10px; margin: 0; white-space: pre-line; }
.qa__q { font-weight: 700; color: var(--heading); }
.qa__a { padding-bottom: 8px; border-bottom: 1px dashed var(--gray-200); color: var(--text); }
.qa__a:last-child { border-bottom: 0; }
.qa__tag { flex-shrink: 0; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--navy-800); color: var(--gold-400); font-size: .7rem; font-weight: 900; }
.qa__a .qa__tag { background: var(--gray-100); color: var(--gray-700); }
.qa--edit { list-style: none; padding: 0; }
.qa__pair { display: grid; grid-template-columns: 1fr 1.6fr auto; gap: 10px; align-items: end; padding-bottom: 10px; border-bottom: 1px dashed var(--gray-200); }

/* Signatures */
.signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.signature { display: grid; gap: 6px; align-content: start; padding: 18px; border: 1px dashed var(--gray-300); border-radius: var(--radius); background: var(--gray-25); transition: border-color var(--t) var(--ease), background var(--t) var(--ease); }
.signature.is-signed { border-style: solid; border-color: var(--green-600); background: var(--green-100); }
.signature__role { margin: 0; font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--gray-500); }
.signature__name { margin: 4px 0 0; padding-bottom: 6px; border-bottom: 1px solid var(--gray-300); font-family: "Brush Script MT", "Segoe Script", cursive; font-size: 1.5rem; color: var(--heading); animation: fadeIn .6s var(--ease); }
.signature__pending { margin: 4px 0 0; padding-bottom: 6px; border-bottom: 1px solid var(--gray-300); color: var(--gray-500); font-style: italic; }
.signature__date { margin: 0; font-size: var(--fs-xs); color: var(--gray-500); }
.signature .btn { justify-self: start; margin-top: 6px; }

/* Liste d'agents à cocher (enquêteurs) */
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 14px; max-height: 190px; overflow-y: auto; padding: 8px 12px; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); background: var(--gray-25); font-weight: 600; }
.check-list small { margin-left: auto; color: var(--gray-500); font-size: .7rem; }

/* Menu de grade direct (Panel Admin › Effectifs) */
.select-wrap--inline { display: inline-block; min-width: 150px; }
.rank-select { width: 100%; padding: 6px 30px 6px 10px; border: 1px solid var(--gray-300); border-radius: var(--radius-xs); background: var(--navy-50); color: var(--heading); font: inherit; font-size: .8rem; font-weight: 800; cursor: pointer; appearance: none; transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.rank-select:hover { border-color: var(--navy-600); }
.rank-select:focus { outline: none; border-color: var(--navy-600); box-shadow: var(--ring-blue); }
.select-wrap--inline::after { right: 11px; width: 6px; height: 6px; }
.select-wrap--inline.is-loading { opacity: .6; pointer-events: none; }

@keyframes stampIn { from { opacity: 0; transform: rotate(-6deg) scale(1.8); } to { opacity: 1; transform: rotate(-6deg) scale(1); } }
@keyframes savePulse { 0%, 100% { box-shadow: var(--shadow-sm); } 50% { box-shadow: 0 0 0 5px rgba(201, 161, 59, .35); } }

@media (max-width: 1100px) {
  .case-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .interview__fields { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .case-sheet__head { grid-template-columns: 1fr; padding: 18px; }
  .case-sheet__seal { display: none; }
  .case-sheet__ref { align-items: flex-start; text-align: left; }
  .case-meta, .signatures, .qa__pair, .interview__fields { grid-template-columns: 1fr; }
  .case-meta__item--wide { grid-column: auto; }
  .case-section { padding: 18px; }
  .case-toolbar { top: 60px; }
  .case-table td { display: grid; gap: 4px; }
}

/* ---------- Terminal MDC : casier, mandats, arrestations, saisies ---------- */
.modal__dialog--xl { max-width: 1040px; }
.kpi-grid--3 { grid-template-columns: repeat(3, 1fr); }
.search--block input, .search--block input:focus { width: 100%; }
.button-row--end { justify-content: flex-end; }
.icon--flip { transform: rotate(180deg); }
.money-cell { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.table tbody tr.is-clickable { cursor: pointer; }
.avatar--danger { background: linear-gradient(135deg, #8f1d17, var(--red-600)); color: var(--white); box-shadow: 0 0 0 2px rgba(214, 58, 49, .45); }
.chip--link { border: 0; cursor: pointer; font: inherit; font-size: .74rem; font-weight: 700; transition: background var(--t) var(--ease), color var(--t) var(--ease); }
.chip--link:hover { background: var(--navy-50); color: var(--heading); }
.case-section__actions { margin-left: auto; display: flex; gap: 6px; }

/* Plaques d'immatriculation */
.plate { display: inline-block; padding: 3px 10px; border: 2px solid var(--heading); border-radius: 5px; background: var(--surface); color: var(--heading); font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-weight: 900; letter-spacing: .12em; }

/* Fiche citoyen */
.citizen-head { display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center; padding: 24px 28px; border-bottom: 1px solid var(--gray-200); background: linear-gradient(180deg, var(--gray-25), var(--surface)); }
.citizen-head__id { display: grid; gap: 6px; min-width: 0; }
.mugshot { position: relative; display: grid; place-items: center; width: 118px; height: 144px; border-radius: var(--radius); overflow: hidden; background: repeating-linear-gradient(0deg, var(--gray-100) 0 11px, var(--gray-50) 11px 12px); border: 1px solid var(--gray-300); box-shadow: var(--shadow-sm); }
.mugshot img { width: 100%; height: 100%; object-fit: cover; animation: fadeIn .4s var(--ease); }
.mugshot__initials { font-family: var(--font-serif); font-size: 2.2rem; font-weight: 900; color: var(--gray-500); }
.citizen-stats { display: grid; gap: 8px; }
.citizen-stats > div { display: flex; flex-direction: column; align-items: flex-end; padding: 8px 14px; border-radius: var(--radius-sm); background: var(--gray-50); border: 1px solid var(--gray-100); }
.citizen-stats strong { font-family: var(--font-serif); font-size: 1.15rem; color: var(--heading); font-variant-numeric: tabular-nums; }
.citizen-stats span { font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gray-500); }
.inline-add { display: grid; grid-template-columns: 1fr 1.3fr 1fr auto; gap: 8px; }
.inline-add input { width: 100%; padding: 9px 12px; border: 1px solid var(--gray-300); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-size: .9rem; }
.inline-add input:focus { outline: none; border-color: var(--navy-600); box-shadow: var(--ring-blue); }

/* Sélecteur de citoyen */
.citizen-pick { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 1px solid var(--gray-300); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.citizen-pick:hover { border-color: var(--navy-600); }
.citizen-pick:focus-visible { outline: none; box-shadow: var(--ring-blue); }
.citizen-pick .icon { width: 18px; height: 18px; color: var(--gray-500); }
.citizen-pick__name { flex: 1; font-weight: 700; }
.citizen-pick.is-empty .citizen-pick__name { font-weight: 400; color: var(--gray-500); }
.citizen-pick__action { font-size: var(--fs-xs); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--navy-600); }
.citizen-pick.is-invalid { border-color: var(--red-600); }
.pick-list { max-height: 340px; overflow-y: auto; margin: 12px 0; padding: 4px; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); }
.pick-list__empty { padding: 16px; text-align: center; }
.person-link { display: flex; gap: 6px; align-items: center; }
.icon-btn.is-linked { color: var(--green-600); border-color: var(--green-600); background: var(--green-100); }
.case-person--link { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--navy-600); font: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.case-person--link .icon { width: 14px; height: 14px; }

/* Mandats */
.warrant-list { display: grid; gap: 12px; }
.warrant {
  --c: var(--amber-500);
  position: relative;
  display: grid;
  gap: 8px;
  padding: 16px 18px 16px 22px;
  background: var(--surface);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  animation: fadeUp .4s var(--ease) both;
  overflow: hidden;
}
.warrant::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c); }
.warrant--low { --c: var(--green-600); }
.warrant--high { --c: var(--orange-600); }
.warrant--extreme { --c: var(--red-600); }
.warrant--extreme.warrant--active::before { animation: blink 1.4s ease-in-out infinite; }
.warrant--executed, .warrant--cancelled, .warrant--rejected { opacity: .78; }
.warrant__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.warrant__date { margin-left: auto; font-size: var(--fs-xs); color: var(--gray-500); }
.warrant__name { display: inline-flex; align-items: center; gap: 6px; justify-self: start; padding: 0; border: 0; background: none; color: var(--heading); font: inherit; font-family: var(--font-serif); font-size: 1.1rem; font-weight: 900; cursor: pointer; }
.warrant__name:hover { text-decoration: underline; text-underline-offset: 4px; }
.warrant__name .icon { width: 16px; height: 16px; color: var(--gray-500); }
.warrant__reason { margin: 0; white-space: pre-line; color: var(--text); }
.warrant__meta { margin: 0; font-size: var(--fs-xs); color: var(--gray-500); }
.warrant__note { margin: 0; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--gray-50); font-size: var(--fs-sm); color: var(--gray-700); }
.suspicion--extreme { background: var(--red-600); color: var(--white); }

/* Calculateur d'amendes */
.calc { border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; }
.calc__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--gray-25); border-bottom: 1px solid var(--gray-200); }
.calc__head h3 { font-family: var(--font-sans); font-size: .82rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.calc__head input { flex: 1 1 240px; max-width: 360px; padding: 8px 12px; border: 1px solid var(--gray-300); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-size: .88rem; }
.calc__body { display: grid; grid-template-columns: minmax(0, 1fr) 280px; }
.calc-groups { max-height: 420px; overflow-y: auto; padding: 10px 14px; display: grid; gap: 12px; align-content: start; }
.calc-group { margin: 0; padding: 0; border: 0; display: grid; gap: 4px; }
.calc-group legend { margin-bottom: 4px; font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-700); }
.calc-row { display: grid; grid-template-columns: auto 1fr auto auto 56px; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid transparent; border-radius: var(--radius-sm); transition: background var(--t) var(--ease), border-color var(--t) var(--ease); }
.calc-row:hover { background: var(--gray-50); }
.calc-row.is-checked { background: var(--blue-100); border-color: rgba(31, 95, 191, .25); }
.calc-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--navy-700); cursor: pointer; }
.calc-row label { display: flex; gap: 8px; align-items: baseline; cursor: pointer; font-size: .9rem; min-width: 0; }
.calc-row label code { flex-shrink: 0; }
.calc-row__fine { font-weight: 800; font-size: .85rem; color: var(--heading); font-variant-numeric: tabular-nums; white-space: nowrap; }
.calc-row__jail { font-size: .8rem; color: var(--gray-500); white-space: nowrap; min-width: 58px; text-align: right; }
.calc-qty { width: 56px; padding: 5px 6px; border: 1px solid var(--gray-300); border-radius: var(--radius-xs); background: var(--surface); color: var(--text); font: inherit; font-size: .85rem; text-align: center; }
.calc-qty:disabled { opacity: .35; }
.calc__side { display: grid; align-content: start; gap: 12px; padding: 14px; background: var(--gray-25); border-left: 1px solid var(--gray-200); }
.calc-total { display: grid; gap: 8px; }
.calc-total > div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--navy-900); color: var(--white); }
.calc-total > div:first-child { background: linear-gradient(135deg, var(--navy-800), var(--navy-600)); }
.calc-total span { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }
.calc-total strong { font-family: var(--font-serif); font-size: 1.15rem; color: var(--gold-400); font-variant-numeric: tabular-nums; animation: pop .35s var(--ease); }
.calc-summary { list-style: none; display: grid; gap: 4px; font-size: .82rem; }
.calc-summary li { display: flex; gap: 6px; align-items: baseline; }
.calc-total-row td { background: var(--gray-50); font-weight: 800; }
.seizure-row { display: grid; grid-template-columns: 150px 1.6fr .8fr 1.2fr auto; gap: 8px; align-items: center; }
.seizure-row input { width: 100%; padding: 9px 12px; border: 1px solid var(--gray-300); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-size: .88rem; }
.seizure-cat { display: inline-flex; padding: 3px 10px; border-radius: var(--radius-xs); font-size: .74rem; font-weight: 800; background: var(--gray-100); color: var(--gray-700); }
.seizure-cat--weapon { background: var(--red-100); color: var(--red-600); }
.seizure-cat--drug { background: var(--green-100); color: var(--green-600); }
.seizure-cat--money { background: var(--gold-100); color: var(--gold-700); }

/* Code pénal */
.penal-list { display: grid; gap: 16px; }
.penal-form { display: grid; grid-template-columns: 100px 1.4fr 2fr 120px 110px auto; gap: 12px; align-items: end; padding: 20px 24px; background: var(--gray-25); border-bottom: 1px solid var(--gray-200); }
.penal-form__actions { display: flex; gap: 8px; }
.penal-form .btn { height: 44px; }

/* Galerie photos */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.gallery__item, .gallery__add { position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius-sm); overflow: hidden; }
.gallery__item { padding: 0; border: 1px solid var(--gray-200); background: var(--gray-100); cursor: zoom-in; transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.gallery__item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; }
.gallery__caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 6px; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); color: #fff; font-size: .72rem; font-weight: 700; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gallery__add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 2px dashed var(--gray-300); color: var(--gray-500); font-size: .8rem; font-weight: 700; text-align: center; cursor: pointer; transition: border-color var(--t) var(--ease), color var(--t) var(--ease), background var(--t) var(--ease); }
.gallery__add:hover, .gallery__add:focus-visible { outline: none; border-color: var(--navy-600); color: var(--navy-600); background: var(--navy-50); }
.gallery__add small { font-size: .66rem; font-weight: 600; }
.gallery__add.is-loading { pointer-events: none; opacity: .6; }
.gallery__add.is-loading .icon { animation: spin .8s linear infinite; }
.lightbox { margin: 0 0 16px; display: grid; gap: 10px; }
.lightbox img { width: 100%; max-height: 70vh; object-fit: contain; border-radius: var(--radius-sm); background: #000; }
.lightbox figcaption { display: grid; gap: 2px; font-size: var(--fs-sm); color: var(--gray-500); }
.lightbox figcaption strong { color: var(--heading); }

/* Recherche globale */
.gsearch { position: relative; flex: 1 1 360px; max-width: 460px; }
.gsearch__field input, .gsearch__field input:focus { width: 100%; padding-top: 9px; padding-bottom: 9px; }
.gsearch__panel { position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 60; max-height: 70vh; overflow-y: auto; padding: 8px; background: var(--surface); border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow-lg); animation: fadeUp .2s var(--ease) both; }
.gsearch__group + .gsearch__group { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--gray-100); }
.gsearch__label { margin: 4px 8px; font-size: .66rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--gray-500); }
.gsearch__item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.gsearch__item .icon { width: 17px; height: 17px; color: var(--gray-500); flex-shrink: 0; }
.gsearch__item:hover, .gsearch__item.is-active { background: var(--navy-50); }
.gsearch__item.is-active { box-shadow: inset 3px 0 0 var(--gold-500); }
.gsearch__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.gsearch__text strong { color: var(--heading); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gsearch__text span { font-size: var(--fs-xs); color: var(--gray-500); }
.gsearch__state { margin: 0; padding: 14px; text-align: center; font-size: var(--fs-sm); color: var(--gray-500); }

/* Calendrier */
.calendar-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.cal { padding: 16px; }
.cal__head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cal__title { flex: 1; font-family: var(--font-serif); font-size: 1.2rem; text-transform: capitalize; text-align: center; }
.cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; transition: opacity var(--t) var(--ease); }
.cal__grid.is-loading { opacity: .45; }
.cal__weekday { padding: 6px 0; font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; text-align: center; color: var(--gray-500); }
.cal__day { display: flex; flex-direction: column; gap: 3px; min-height: 96px; padding: 6px; border: 1px solid var(--gray-100); border-radius: var(--radius-sm); background: var(--surface); min-width: 0; transition: border-color var(--t) var(--ease), background var(--t) var(--ease); }
.cal__day.is-out { background: var(--gray-25); opacity: .55; }
.cal__day.is-today { border-color: var(--gold-500); box-shadow: inset 0 0 0 1px var(--gold-500); }
.cal__day.is-clickable:hover { border-color: var(--gray-300); }
.cal__num { font-size: .8rem; font-weight: 800; color: var(--gray-500); }
.cal__day.is-today .cal__num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--gold-500); color: var(--navy-950); }
.cal__more { font-size: .68rem; font-weight: 700; color: var(--gray-500); }
.cal__hint { margin: 10px 0 0; font-size: var(--fs-xs); color: var(--gray-500); }
.event-chip { --c: var(--gray-700); --c-soft: var(--gray-100); display: flex; gap: 5px; align-items: center; width: 100%; padding: 3px 6px; border: 0; border-left: 3px solid var(--c); border-radius: 4px; background: var(--c-soft); color: var(--c); font: inherit; font-size: .7rem; font-weight: 700; text-align: left; cursor: pointer; min-width: 0; transition: transform var(--t) var(--ease), filter var(--t) var(--ease); }
.event-chip:hover { transform: translateX(2px); filter: brightness(1.05); }
.event-chip--training { --c: var(--blue-600); --c-soft: var(--blue-100); }
.event-chip--meeting { --c: var(--gold-700); --c-soft: var(--gold-100); }
.event-chip--operation { --c: var(--red-600); --c-soft: var(--red-100); }
.event-chip.is-signed { box-shadow: inset 0 0 0 1px var(--c); }
.event-chip--static { display: inline-flex; width: auto; cursor: default; font-size: .74rem; padding: 4px 10px; }
.event-chip__time { flex-shrink: 0; font-variant-numeric: tabular-nums; opacity: .8; }
.event-chip__title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upcoming-list { list-style: none; display: grid; gap: 8px; }
.upcoming { --c: var(--gray-500); display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; width: 100%; padding: 10px 12px; border: 1px solid var(--gray-200); border-left: 4px solid var(--c); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.upcoming:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.upcoming { grid-template-columns: auto minmax(0, 1fr); }
.upcoming .badge { grid-column: 2; justify-self: start; margin-top: -4px; }
.upcoming__text strong { white-space: normal; }
.upcoming--training { --c: var(--blue-600); }
.upcoming--meeting { --c: var(--gold-500); }
.upcoming--operation { --c: var(--red-600); }
.upcoming__date { display: grid; place-items: center; width: 44px; line-height: 1.1; }
.upcoming__date strong { font-family: var(--font-serif); font-size: 1.3rem; color: var(--heading); }
.upcoming__date span { font-size: .66rem; font-weight: 800; text-transform: uppercase; color: var(--gray-500); }
.upcoming__text { display: flex; flex-direction: column; min-width: 0; }
.upcoming__text strong { color: var(--heading); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upcoming__text span { font-size: var(--fs-xs); color: var(--gray-500); }
.event-view { display: grid; gap: 14px; margin-bottom: 16px; }

/* Absences */
.absence-list { display: grid; gap: 10px; }
.absence { --c: var(--amber-500); display: grid; gap: 6px; padding: 14px 16px; border: 1px solid var(--gray-200); border-left: 4px solid var(--c); border-radius: var(--radius-sm); background: var(--surface); animation: fadeUp .35s var(--ease) both; }
.absence--approved { --c: var(--green-600); }
.absence--rejected { --c: var(--red-600); }
.absence--cancelled { --c: var(--gray-300); opacity: .75; }
.absence__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.absence__head strong { color: var(--heading); }
.absence__kind { margin: 0; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gray-500); }
.absence__reason { margin: 0; color: var(--text); }
.absence .btn { justify-self: start; }

@media (max-width: 1100px) {
  .calendar-layout, .calc__body { grid-template-columns: 1fr; }
  .calc__side { border-left: 0; border-top: 1px solid var(--gray-200); }
  .penal-form { grid-template-columns: 1fr 1fr; }
  .penal-form__label { grid-column: 1 / -1; }
  .gsearch { max-width: none; }
}
@media (max-width: 960px) {
  .app__topbar { flex-wrap: wrap; }
  .gsearch { order: 5; flex-basis: 100%; }
}
@media (max-width: 640px) {
  .citizen-head { grid-template-columns: 1fr; justify-items: start; padding: 18px; }
  .citizen-stats { grid-template-columns: repeat(3, 1fr); width: 100%; }
  .citizen-stats > div { align-items: flex-start; }
  .inline-add, .seizure-row, .penal-form, .kpi-grid--3 { grid-template-columns: 1fr; }
  .calc-row { grid-template-columns: auto 1fr 56px; }
  .calc-row__fine, .calc-row__jail { grid-column: 2; text-align: left; }
  .cal__day { min-height: 64px; padding: 4px; }
  .event-chip__time { display: none; }
}

/* ---------- Impression (fiche de suivi, documents) ---------- */
.print-root { display: none; }
@media print {
  body.is-printing > :not(.print-root) { display: none !important; }
  body.is-printing { background: #fff !important; }
  body.is-printing .print-root { display: block; padding: 0; color: #000; font-size: 11pt; }
  .print-root__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid #0b1a33; }
  .print-root__agency { margin: 0; font-family: var(--font-serif); font-weight: 900; font-size: 14pt; }
  .print-root__title { margin: 0; font-weight: 700; }
  .print-root__date { margin: 0; font-size: 9pt; color: #555; }
  .print-root * { animation: none !important; box-shadow: none !important; }
  .print-root .record, .print-root .eval, .print-root .discipline, .print-root .empty { break-inside: avoid; border-color: #bbb; }
  .print-root .suivi__identity { grid-template-columns: repeat(4, 1fr); }
  .print-root .case-sheet { border: 0; border-top: 3px solid #0b1a33; border-radius: 0; }
  .print-root .case-sheet::after { display: none; }
  .print-root .case-section, .print-root .interview, .print-root .signature { break-inside: avoid; }
  .print-root .case-meta { grid-template-columns: repeat(4, 1fr); }
  .print-root .case-stamp { animation: none; }
  .print-root .gallery__add, .print-root .inline-add, .print-root select { display: none !important; }
  .print-root .mugshot img { animation: none; }
}

/* Divisions (portail) */
.division-card__code { margin: -6px 0 4px; font-size: .7rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-700) !important; flex: 0 !important; }
.division-card__roles { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--gray-100); }
.division-card__roles li { padding: 3px 9px; border-radius: 999px; background: var(--navy-50); color: var(--navy-700); font-size: .72rem; font-weight: 700; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi {
  --k: var(--navy-700);
  --k-soft: var(--navy-50);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
  animation: fadeUp .5s var(--ease) both;
}
.kpi:nth-child(2) { animation-delay: .06s; }
.kpi:nth-child(3) { animation-delay: .12s; }
.kpi:nth-child(4) { animation-delay: .18s; }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.kpi--success { --k: var(--green-600); --k-soft: var(--green-100); }
.kpi--danger { --k: var(--red-600); --k-soft: var(--red-100); }
.kpi--gold { --k: var(--gold-700); --k-soft: var(--gold-100); }
.kpi__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--k-soft); color: var(--k); }
.kpi__icon .icon { width: 22px; height: 22px; }
.kpi__value { display: block; font-family: var(--font-serif); font-weight: 900; font-size: 1.6rem; line-height: 1; color: var(--heading); font-variant-numeric: tabular-nums; }
.kpi__label { display: block; margin-top: 4px; font-size: var(--fs-xs); color: var(--gray-500); font-weight: 600; }

.panel { background: var(--surface); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; animation: fadeUp .4s var(--ease) both; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px 24px; border-bottom: 1px solid var(--gray-200); }
.panel__title { font-size: 1.05rem; font-family: var(--font-sans); font-weight: 800; }
.panel__subtitle { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--gray-500); }
.panel__tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.search { position: relative; display: block; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--gray-500); pointer-events: none; }
.search input { padding-left: 38px; width: 280px; transition: width var(--t) var(--ease), border-color var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.search input:focus { width: 340px; }

.invite-form { display: grid; grid-template-columns: 1.5fr 1fr .8fr .9fr auto; gap: 16px; align-items: end; padding: 20px 24px; background: var(--gray-25); border-bottom: 1px solid var(--gray-200); }
.invite-form .btn { height: 44px; }
.invite-result {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 24px 0;
  padding: 12px 16px;
  background: var(--green-100);
  border: 1px solid rgba(20, 122, 63, .3);
  border-radius: var(--radius-sm);
  color: var(--green-600);
  font-weight: 600;
  font-size: var(--fs-sm);
  animation: fadeUp .4s var(--ease) both;
}
.invite-result code { background: var(--surface); word-break: break-all; }
.invite-result .btn { margin-left: auto; }
#tab-invites .table-wrap { margin-top: 16px; }

.alert-form { display: grid; gap: 20px; padding: 24px; max-width: 820px; }
.alert-choices { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.alert-choice { --c: var(--green-600); --c-soft: var(--green-100); cursor: pointer; }
.alert-choice--4 { --c: var(--blue-600); --c-soft: var(--blue-100); }
.alert-choice--3 { --c: #b77f00; --c-soft: var(--amber-100); }
.alert-choice--2 { --c: var(--orange-600); --c-soft: var(--orange-100); }
.alert-choice--1 { --c: var(--red-600); --c-soft: var(--red-100); }
.alert-choice input { position: absolute; opacity: 0; pointer-events: none; }
.alert-choice span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 18px 10px;
  border: 2px solid var(--gray-200);
  border-top: 5px solid var(--c);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform var(--t) var(--ease-spring), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.alert-choice strong { font-family: var(--font-serif); font-size: 1.3rem; color: var(--c); }
.alert-choice small { font-size: var(--fs-xs); color: var(--gray-500); font-weight: 600; }
.alert-choice:hover span { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.alert-choice input:checked + span { border-color: var(--c); background: var(--c-soft); box-shadow: 0 0 0 4px var(--c-soft), var(--shadow-md); transform: translateY(-3px); }
.alert-choice input:focus-visible + span { box-shadow: var(--ring); }

/* ---------- 19. Tableaux & badges ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th {
  padding: 12px 20px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  text-align: left;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gray-500);
  white-space: nowrap;
}
.table td { padding: 14px 20px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.table tbody tr { transition: background var(--t-fast) var(--ease); animation: rowIn .35s var(--ease) both; }
.table tbody tr:nth-child(2) { animation-delay: .03s; }
.table tbody tr:nth-child(3) { animation-delay: .06s; }
.table tbody tr:nth-child(4) { animation-delay: .09s; }
.table tbody tr:nth-child(5) { animation-delay: .12s; }
.table tbody tr:nth-child(n+6) { animation-delay: .15s; }
.table tbody tr:hover { background: var(--navy-50); }
.table tbody tr:last-child td { border-bottom: 0; }
.table__right { text-align: right !important; }
.table__empty { padding: 44px 20px !important; text-align: center; color: var(--gray-500); }
.table__actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.table__muted { color: var(--gray-500); font-size: .84rem; }
.table__self { margin-left: 8px; padding: 1px 7px; border-radius: 999px; background: var(--gold-100); color: var(--gold-700); font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.table code { white-space: nowrap; }
.table .avatar {
  display: inline-grid;
  place-items: center;
  width: 32px; height: 32px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--navy-700);
  color: var(--gold-400);
  font-weight: 800;
  font-size: .8rem;
  text-transform: uppercase;
  vertical-align: middle;
}

.rank-select {
  padding: 8px 32px 8px 12px;
  min-width: 170px;
  appearance: none;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231a3263' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  color: var(--heading);
  font: inherit;
  font-size: .86rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.rank-select:hover:not(:disabled) { border-color: var(--navy-600); }
.rank-select:focus { outline: none; border-color: var(--navy-600); box-shadow: var(--ring-blue); }
.rank-select:disabled { background-color: var(--gray-50); color: var(--gray-500); cursor: not-allowed; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--active { background: var(--green-100); color: var(--green-600); }
.badge--active::before { animation: blink 2s ease-in-out infinite; }
.badge--suspended { background: var(--amber-100); color: #8a5d00; }
.badge--banned, .badge--expired { background: var(--red-100); color: var(--red-600); }
.badge--used { background: var(--gray-100); color: var(--gray-500); }
.badge--info { background: var(--blue-100); color: var(--blue-600); }
.badge--gold { background: var(--gold-100); color: var(--gold-700); }

/* ---------- 20. Toasts ---------- */
.toasts { position: fixed; right: 24px; bottom: 84px; z-index: 1100; display: flex; flex-direction: column; gap: 10px; width: min(400px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  --c: var(--blue-600);
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px 16px 16px;
  background: var(--surface);
  border: 1px solid var(--gray-200);
  border-left: 5px solid var(--c);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: .9rem;
  color: var(--text);
  overflow: hidden;
  pointer-events: auto;
  animation: toastIn .45s var(--ease-spring) both;
}
.toast--success { --c: var(--green-600); }
.toast--error { --c: var(--red-600); }
.toast--warning { --c: var(--amber-500); }
.toast__icon { width: 22px; height: 22px; color: var(--c); margin-top: 1px; }
.toast__msg { flex: 1; line-height: 1.45; }
.toast__close { display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 50%; background: transparent; color: var(--gray-500); cursor: pointer; transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.toast__close:hover { background: var(--gray-100); color: var(--text); }
.toast__progress { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--c); opacity: .5; transform-origin: left; animation: toastTimer var(--toast-duration, 4.5s) linear forwards; }
.toast:hover .toast__progress { animation-play-state: paused; }
.toast.is-leaving { animation: toastOut .35s var(--ease) forwards; }

/* ---------- 21. Effets ---------- */
/* Apparition au défilement (délai en cascade fourni par script.js via --reveal-delay) */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
  transition-delay: var(--reveal-delay, 0s);
}
.reveal.is-visible { opacity: 1; transform: none; }
/* Les cartes à effet 3D ont leur propre transform : on n'anime que l'opacité après apparition */
.service-tile.reveal { transform: perspective(900px) translateY(28px); }
.service-tile.reveal.is-visible,
.division-card.reveal.is-visible { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0)); transition: opacity .8s var(--ease) var(--reveal-delay, 0s), transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease); }

/* Ondulation au clic */
.ripple {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  background: currentColor;
  opacity: .25;
  transform: scale(0);
  animation: ripple .6s var(--ease) forwards;
  pointer-events: none;
}

/* Lignes squelette (tableaux admin) */
.skeleton-row td { padding: 16px 20px; }
.skeleton {
  display: block;
  height: 12px;
  border-radius: var(--radius-xs);
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 50%, var(--gray-100) 75%) 0 0 / 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
.skeleton--short { width: 40%; }
.skeleton--mid { width: 65%; }
.skeleton--long { width: 90%; }

/* ---------- 22. Animations ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes barGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes bootBar { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes rowIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@keyframes gateIn { from { opacity: 0; transform: translateY(40px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes sealIn { from { opacity: 0; transform: scale(.4) rotate(-120deg); } to { opacity: 1; transform: none; } }
@keyframes gateOut { to { opacity: 0; backdrop-filter: blur(0); visibility: hidden; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-100%); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateX(110%) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(110%); } }
@keyframes toastTimer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 var(--c); } 80%, 100% { box-shadow: 0 0 0 8px transparent; } }
@keyframes radar { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(2.8); opacity: 0; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes strobe { 0% { background: #ff5a4f; } 50% { background: #4d8dff; } }
@keyframes lightbar { 0% { background: var(--red-600); } 50% { background: var(--blue-600); } }
@keyframes alertFlash { 0% { background: var(--red-600); } 50% { background: #1d3f99; } }
@keyframes stripes { to { background-position: 34px 0; } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-12deg); } 40% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } 80% { transform: rotate(0); } }
@keyframes drift { to { transform: translate3d(80px, 40px, 0); } }
@keyframes sweep { 0% { left: -60%; } 60%, 100% { left: 130%; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.035); } 100% { transform: scale(1); } }
@keyframes growX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes growY { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }

/* ---------- 23. Responsive ---------- */
@media (max-width: 1100px) {
  .app__crumb > span, .app__crumb > .icon { display: none; }
  .division-grid { grid-template-columns: repeat(3, 1fr); }
  .dash-grid, .split { grid-template-columns: 1fr; }
  .utility-bar__state { display: none; }
  .utility-bar__inner { justify-content: flex-end; }
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .invite-form { grid-template-columns: 1fr 1fr; }
  .invite-form .btn { grid-column: 1 / -1; }
  .site-footer__main { grid-template-columns: 1fr 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 960px) {
  .masthead__contacts { display: none; }
  .nav-toggle { display: inline-flex; }
  .primary-nav__inner { flex-wrap: wrap; padding-block: 8px; }
  .primary-nav__list {
    order: 3;
    width: 100%;
    flex-direction: column;
    max-height: 0;
    overflow: hidden;
    transition: max-height .4s var(--ease);
  }
  .primary-nav__list.is-open { max-height: 400px; }
  .primary-nav__list a { padding: 12px 4px; border-top: 1px solid rgba(255, 255, 255, .08); }
  .primary-nav__list a::after { display: none; }

  .hero { padding: 64px 0 120px; }
  .hero__grid, .recruit { grid-template-columns: 1fr; gap: 40px; }
  .recruit__info { position: static; }
  .news-grid { grid-template-columns: 1fr; }
  .facts__grid { grid-template-columns: repeat(2, 1fr); gap: 24px 0; }
  .fact:nth-child(3) { border-left: 0; }
  .agent-card { grid-template-columns: 1fr; }
  .agent-card__id { border-right: 0; padding-right: 0; padding-bottom: 20px; border-bottom: 1px solid var(--gray-200); }
  .section-head--split { flex-direction: column; align-items: flex-start; }

  .search input, .search input:focus { width: 100%; }

  /* Espace Agent : barre latérale escamotable */
  .app { grid-template-columns: 1fr; }
  .app__sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .35s var(--ease); box-shadow: var(--shadow-xl); }
  body.sidebar-open .app__sidebar { transform: none; }
  .app__scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(6, 16, 31, .5); backdrop-filter: blur(2px); animation: fadeIn .25s var(--ease); }
  .app__menu-btn { display: grid; }
  .app__topbar, .app__content { padding-inline: 18px; }
  .division-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1100px) {
  .scale { grid-template-columns: repeat(2, 1fr); }
  .doc-types { grid-template-columns: repeat(2, 1fr); }
  .suivi__identity { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .scale, .doc-types, .doc-view__fields { grid-template-columns: 1fr; }
  .doc-card { grid-template-columns: auto 1fr; }
  .doc-card .badge { grid-column: 2; justify-self: start; }
  .container { padding: 0 16px; }
  .utility-bar__state { display: none; }
  .utility-bar__inner { justify-content: center; }
  .brand__seal { width: 56px; height: 56px; }
  .brand__name { font-size: 1.15rem; }
  .brand__tag { display: none; }
  .primary-nav__cta { font-size: 0; gap: 0; padding: 9px; }
  .primary-nav__cta .icon { font-size: 1rem; }

  .service-grid, .division-grid, .form-row, .invite-form, .kpi-grid, .spec-groups, .id-list { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .welcome { padding: 22px; }
  .welcome__seal { display: none; }
  .bar-chart__row { grid-template-columns: 100px 1fr 30px; }
  .app__content { padding: 18px 14px; }
  .drawer__head { padding: 18px; }
  .table--interactive td:first-child::before { content: none; }
  .alert-choices { grid-template-columns: 1fr 1fr; }
  .status-legend { grid-template-columns: repeat(3, 1fr); }
  .agent-card__grid { grid-template-columns: 1fr 1fr; }
  .section { padding: 64px 0; }
  .form-card__body, .modal__body { padding: 20px; }
  .form-card__foot { padding: 0 20px 20px; }
  .site-footer__main { grid-template-columns: 1fr; }
  .rp-gate__dialog { padding: 36px 22px 22px; }
  .toasts { right: 16px; bottom: 80px; }
  .back-to-top { right: 16px; bottom: 16px; }

  /* Tableaux en cartes */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 10px 0; border-bottom: 1px solid var(--gray-200); }
  .table td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 16px; border: 0; }
  .table td::before { content: attr(data-label); font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gray-500); }
  .table td.table__empty { justify-content: center; }
  .table td.table__empty::before, .skeleton-row td::before { content: none; }
}

/* ---------- 24. Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero__watermark { transform: translate3d(0, -50%, 0); }
}

/* ---------- 25. Thème sombre institutionnel (Espace Agent / Panel Admin) ----------
   Activé par script.js via <body data-theme="dark"> (réglage par défaut dans
   config.js › theme, bouton clair/sombre dans la barre du haut).
   Désactivé pendant l'impression (.is-printing) : les documents sortent sur fond blanc. */
body[data-theme="dark"]:not(.is-printing) {
  color-scheme: dark;
  --surface: #111d31;
  --text: #dfe5ee;
  --heading: #f2f5fa;
  --danger-tint: rgba(229, 72, 77, .1);

  --gray-25: #0f1a2c;
  --gray-50: #0a1424;
  --gray-100: #1a283f;
  --gray-200: #22324d;
  --gray-300: #33476a;
  --gray-500: #8d9bb3;
  --gray-700: #c3ccda;

  --navy-50: #16274a;
  --navy-100: #203763;

  --gold-700: #e3c46a;
  --gold-100: rgba(201, 161, 59, .16);
  --green-600: #3ecf7c;
  --green-100: rgba(62, 207, 124, .13);
  --amber-100: rgba(240, 170, 40, .15);
  --orange-600: #f08a3c;
  --orange-100: rgba(240, 138, 60, .15);
  --red-600: #e5484d;
  --red-100: rgba(229, 72, 77, .15);
  --blue-600: #6aa6ff;
  --blue-100: rgba(106, 166, 255, .15);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .35), 0 1px 2px rgba(0, 0, 0, .25);
  --shadow-md: 0 8px 20px -6px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .3);
  --shadow-lg: 0 20px 40px -12px rgba(0, 0, 0, .7), 0 6px 14px rgba(0, 0, 0, .35);
  --ring-blue: 0 0 0 3px rgba(106, 166, 255, .3);
}
body[data-theme="dark"]:not(.is-printing) a:not([class]) { color: #8fb4f0; }
body[data-theme="dark"]:not(.is-printing) a:not([class]):hover { color: var(--white); }
body[data-theme="dark"]:not(.is-printing) .link-more { color: #8fb4f0; }

body[data-theme="dark"]:not(.is-printing) .app__topbar { background: rgba(10, 20, 36, .88); }
body[data-theme="dark"]:not(.is-printing) .app__menu-btn { color: var(--heading); }
body[data-theme="dark"]:not(.is-printing) .btn--primary { --btn-bg: #2a55a8; }
body[data-theme="dark"]:not(.is-printing) .btn--primary:hover { --btn-bg: #3363c0; }
body[data-theme="dark"]:not(.is-printing) .btn--secondary { --btn-fg: var(--heading); }
body[data-theme="dark"]:not(.is-printing) .btn--ghost { --btn-fg: #aac4ef; }
body[data-theme="dark"]:not(.is-printing) code { background: var(--navy-50); color: #b9cdf2; }
body[data-theme="dark"]:not(.is-printing) .rank-badge { background: var(--navy-50); color: #b9cdf2; border-color: var(--navy-100); }
body[data-theme="dark"]:not(.is-printing) .rank-badge--command { background: #0b1a33; color: var(--gold-400); border-color: #24427f; }
body[data-theme="dark"]:not(.is-printing) .kpi { --k: #8fb4f0; }
body[data-theme="dark"]:not(.is-printing) .th-sort.is-asc::after,
body[data-theme="dark"]:not(.is-printing) .th-sort.is-desc::after { color: #8fb4f0; }
body[data-theme="dark"]:not(.is-printing) .select-wrap::after { border-color: var(--gray-500); }
body[data-theme="dark"]:not(.is-printing) .filter select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238d9bb3' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}
body[data-theme="dark"]:not(.is-printing) .bar-chart__fill { background: linear-gradient(90deg, #3a6fd0, #6aa6ff); }
body[data-theme="dark"]:not(.is-printing) .badge--suspended,
body[data-theme="dark"]:not(.is-printing) .kind--warning,
body[data-theme="dark"]:not(.is-printing) .suspicion--medium { color: #f0b43c; }
body[data-theme="dark"]:not(.is-printing) .notice { color: #f0c060; }
body[data-theme="dark"]:not(.is-printing) .timeline__item--warning { --c: #f0b43c; }
body[data-theme="dark"]:not(.is-printing) .timeline__dot { box-shadow: 0 0 0 4px var(--gray-50); }
body[data-theme="dark"]:not(.is-printing) .segmented__btn.is-active { background: #2a55a8; }
body[data-theme="dark"]:not(.is-printing) .field input::placeholder,
body[data-theme="dark"]:not(.is-printing) .field textarea::placeholder,
body[data-theme="dark"]:not(.is-printing) .case-input::placeholder { color: #5f6f8a; }
body[data-theme="dark"]:not(.is-printing) .case-section__head { color: #8fb4f0; }
body[data-theme="dark"]:not(.is-printing) .case-section__num,
body[data-theme="dark"]:not(.is-printing) .qa__tag { background: #1d3a73; }
body[data-theme="dark"]:not(.is-printing) .case-sheet { border-top-color: #2a55a8; }
body[data-theme="dark"]:not(.is-printing) .case-sheet.is-confidential { border-top-color: var(--red-600); }
body[data-theme="dark"]:not(.is-printing) .case-sheet::after { opacity: .05; }
body[data-theme="dark"]:not(.is-printing) .toast { background: #16233a; color: var(--text); }

/* Bouton clair / sombre */
.theme-toggle .icon--sun { display: none; }
body[data-theme="dark"] .theme-toggle .icon--sun { display: block; }
body[data-theme="dark"] .theme-toggle .icon--moon { display: none; }
body[data-theme="dark"]:not(.is-printing) .case-person--link,
body[data-theme="dark"]:not(.is-printing) .citizen-pick__action { color: #8fb4f0; }
body[data-theme="dark"]:not(.is-printing) .calc-total > div { background: #0b1a33; }
body[data-theme="dark"]:not(.is-printing) .calc-total > div:first-child { background: linear-gradient(135deg, #16274a, #2a55a8); }
body[data-theme="dark"]:not(.is-printing) .gallery__add:hover { color: #8fb4f0; border-color: #8fb4f0; }
