/* ==========================================================================
   OCEM — feuille de style unique (sans compilation)
   Mobile d'abord. Points de rupture : 640px (tablette), 1024px (PC), 1280px (large).
   Règle d'or : aucun défilement horizontal. Ce qui ne tient pas passe à la ligne,
   s'empile, ou rejoint le bouton « Plus » (☰) des barres de navigation.
   ========================================================================== */

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/plus-jakarta-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/plus-jakarta-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/fraunces-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/fraunces-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --------------------------------------------------------------------------
   Jetons de design (repris de la maquette)
   -------------------------------------------------------------------------- */
:root {
  --navy: #0A2249;
  --navy-2: #17346A;
  --navy-3: #1C3A6E;
  --navy-4: #2B4C86;
  --red: #C8260F;
  --red-bright: #E82B0D;
  --red-dark: #B8240F;
  --red-darker: #8F1C0B;
  --red-soft: #FCE8E4;
  --red-tint: #FFF6F4;
  --red-line: #F8D3CB;
  --coral: #FF7A5C;

  --text: #0A2249;
  --muted: #45526B;
  --muted-2: #6A7690;
  --muted-3: #9AA6BC;

  --bg: #F5F7FB;
  --surface: #FFFFFF;
  --line: #E3E8F1;
  --line-2: #D5DCE8;
  --line-3: #EEF1F6;
  --chip: #F0F3F8;
  --blue-soft: #EAF0FA;

  --green: #1F7A4D;
  --green-dark: #155C3A;
  --green-soft: #E7F5EE;
  --green-bright: #5EE0A0;
  --amber: #8A5300;
  --amber-soft: #FFF3DC;
  --amber-line: #F5D9A8;
  --blue: #1D4ED8;

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-xl: 28px;
  --shadow: 0 1px 2px rgba(10, 34, 73, .06), 0 4px 16px rgba(10, 34, 73, .06);
  --shadow-lg: 0 12px 40px rgba(10, 34, 73, .18);

  --sidebar-w: 264px;
  --topbar-h: 64px;
  --bottomnav-h: 68px;
  --page-pad: 16px;
  --content-max: 1200px;
}
@media (min-width: 640px) { :root { --page-pad: 24px; } }
@media (min-width: 1280px) { :root { --page-pad: 32px; } }

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  overflow-x: clip;               /* filet de sécurité : jamais de défilement horizontal */
  -webkit-font-smoothing: antialiased;
}
img, svg, video, canvas, iframe { max-width: 100%; }
img, video { height: auto; }
svg { flex: none; }
a { color: var(--red-dark); text-decoration: none; }
a:hover { color: var(--red-darker); }
h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }
table { border-collapse: collapse; width: 100%; }
p, li, td, th, dd, h1, h2, h3, h4, span, a, label { overflow-wrap: anywhere; }
pre, code { white-space: pre-wrap; overflow-wrap: anywhere; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(200, 38, 15, .45); outline-offset: 2px; border-radius: 6px; }

.sr-only {
  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: 8px; top: -60px; z-index: 100; background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 10px; }
.skip-link:focus { top: 8px; color: #fff; }

/* --------------------------------------------------------------------------
   Typographie
   -------------------------------------------------------------------------- */
.h1, .page-title { font-size: 24px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; }
.h2 { font-size: 19px; line-height: 1.25; font-weight: 800; letter-spacing: -.01em; }
.h3 { font-size: 16px; line-height: 1.3; font-weight: 800; }
.h4 { font-size: 15px; line-height: 1.35; font-weight: 700; }
@media (min-width: 1024px) {
  .h1, .page-title { font-size: 28px; }
  .h2 { font-size: 20px; }
}
.display { font-size: 32px; line-height: 1.1; font-weight: 800; letter-spacing: -.03em; }
@media (min-width: 1024px) { .display { font-size: 48px; } }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--red-dark); }
.lead { font-size: 16px; line-height: 1.6; color: var(--muted); }
.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.bold { font-weight: 700; }
.black { font-weight: 800; }
.italic { font-style: italic; }
.serif { font-family: 'Fraunces', Georgia, serif; font-weight: 600; }
.text-red { color: var(--red); }
.text-green { color: var(--green); }
.text-amber { color: var(--amber); }
.text-navy { color: var(--navy); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.clamp-2, .clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-2 { -webkit-line-clamp: 2; }
.clamp-3 { -webkit-line-clamp: 3; }
.prose { font-size: 15px; line-height: 1.7; color: var(--text); }
.prose > * + * { margin-top: .9em; }
.prose h2 { font-size: 19px; font-weight: 800; margin-top: 1.4em; }
.prose h3 { font-size: 16px; font-weight: 800; margin-top: 1.2em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose a { text-decoration: underline; }
.prose table { width: 100%; font-size: 14px; border: 1px solid var(--line); border-radius: 12px; border-collapse: separate; border-spacing: 0; overflow: hidden; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line-3); overflow-wrap: break-word; }
.prose th { background: var(--chip); font-size: 13px; color: var(--muted); }
.prose tr:last-child td { border-bottom: 0; }
.prose code { font-size: 13px; background: var(--chip); padding: 1px 6px; border-radius: 6px; }
.prose em:first-child { color: var(--muted); }
@media (max-width: 639.98px) {
  /* Tableaux de texte : chaque ligne s'empile, jamais de défilement horizontal */
  .prose table, .prose tbody, .prose tr, .prose td { display: block; width: 100%; }
  .prose thead { display: none; }
  .prose tr { border-bottom: 1px solid var(--line); padding: 6px 0; }
  .prose td { border: 0; padding: 4px 12px; }
  .prose td:first-child { font-weight: 700; }
}
.verse { font-size: 15px; line-height: 1.6; font-style: italic; }

/* --------------------------------------------------------------------------
   Mise en page : piles, grappes, grilles
   -------------------------------------------------------------------------- */
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stack-xs { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.stack-md { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.stack-lg { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.stack-xl { display: flex; flex-direction: column; gap: 32px; min-width: 0; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.cluster-md { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-width: 0; }
.cluster-lg { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; min-width: 0; }
.row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.row > * { min-width: 0; }
.between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; min-width: 0; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.grow { flex: 1 1 auto; min-width: 0; }
.none { flex: none; }
.w-full { width: 100%; }
.mx-auto { margin-left: auto; margin-right: auto; }
.ml-auto { margin-left: auto; }

.grid { display: grid; gap: 16px; min-width: 0; }
.grid > * { min-width: 0; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.grid-2 > *, .grid-3 > *, .grid-4 > * { min-width: 0; }
@media (min-width: 640px) {
  .grid-2, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* Grilles automatiques : autant de colonnes que la largeur le permet */
.auto-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.auto-grid-sm { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); }
.auto-grid-lg { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.auto-grid > *, .auto-grid-sm > *, .auto-grid-lg > * { min-width: 0; }
.grid-2-fixed { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-2-fixed > * { min-width: 0; }

/* Colonne principale + colonne latérale (empilées sous 1024px) */
.split { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1024px) {
  .split { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .split--wide-aside { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .split--narrow-aside { grid-template-columns: minmax(0, 1fr) 320px; }
  .split--aside-left { grid-template-columns: 300px minmax(0, 1fr); }
}
.sticky-aside { position: static; }
@media (min-width: 1024px) { .sticky-aside { position: sticky; top: calc(var(--topbar-h) + 16px); } }

.container { width: 100%; max-width: var(--content-max); margin: 0 auto; }
.narrow { width: 100%; max-width: 720px; margin-left: auto; margin-right: auto; }
.narrow-sm { width: 100%; max-width: 520px; margin-left: auto; margin-right: auto; }

.gap-0 { gap: 0 !important; }
.gap-xs { gap: 4px !important; }
.gap-sm { gap: 8px !important; }
.gap-lg { gap: 24px !important; }
.mt-xs { margin-top: 4px; } .mt-sm { margin-top: 8px; } .mt { margin-top: 16px; } .mt-lg { margin-top: 24px; } .mt-xl { margin-top: 40px; }
.mb-sm { margin-bottom: 8px; } .mb { margin-bottom: 16px; } .mb-lg { margin-bottom: 24px; }
.p-0 { padding: 0 !important; }

/* Visibilité selon l'écran */
@media (max-width: 639.98px) { .hide-mobile { display: none !important; } }
@media (min-width: 640px) { .show-mobile { display: none !important; } }
@media (max-width: 1023.98px) { .hide-tablet { display: none !important; } }
@media (min-width: 1024px) { .show-tablet { display: none !important; } .hide-desktop { display: none !important; } }

/* --------------------------------------------------------------------------
   Boutons
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--navy); --btn-bd: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; max-width: 100%;
  border-radius: var(--radius); border: 1px solid var(--btn-bd);
  background: var(--btn-bg); color: var(--btn-fg);
  font-size: 15px; font-weight: 700; line-height: 1.2; text-align: center;
  cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { color: var(--btn-fg); filter: brightness(.97); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-primary { --btn-bg: var(--red); --btn-fg: #fff; --btn-bd: var(--red); }
.btn-primary:hover { --btn-bg: var(--red-dark); --btn-bd: var(--red-dark); filter: none; }
.btn-navy { --btn-bg: var(--navy); --btn-fg: #fff; --btn-bd: var(--navy); }
.btn-navy:hover { --btn-bg: var(--navy-2); --btn-bd: var(--navy-2); filter: none; }
.btn-outline { --btn-bg: #fff; --btn-fg: var(--navy); --btn-bd: var(--navy); border-width: 1.5px; }
.btn-soft { --btn-bg: var(--chip); --btn-fg: var(--navy); --btn-bd: var(--chip); }
.btn-red-soft { --btn-bg: var(--red-soft); --btn-fg: var(--red-dark); --btn-bd: var(--red-soft); }
.btn-ghost { --btn-bg: transparent; --btn-fg: var(--navy); --btn-bd: transparent; }
.btn-ghost:hover { --btn-bg: var(--chip); filter: none; }
.btn-link { --btn-bg: transparent; --btn-bd: transparent; --btn-fg: var(--red-dark); min-height: 0; padding: 4px 2px; }
.btn-danger { --btn-bg: #fff; --btn-fg: var(--red-dark); --btn-bd: var(--red-line); }
.btn-success { --btn-bg: var(--green); --btn-fg: #fff; --btn-bd: var(--green); }
.btn-white { --btn-bg: #fff; --btn-fg: var(--navy); --btn-bd: #fff; }
.btn-on-dark { --btn-bg: rgba(255,255,255,.1); --btn-fg: #fff; --btn-bd: rgba(255,255,255,.25); }
.btn-lg { min-height: 54px; padding: 14px 22px; font-size: 16px; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-xs { min-height: 30px; padding: 4px 10px; font-size: 12px; border-radius: 8px; }
.btn-block { display: flex; width: 100%; }
.btn-icon { width: 44px; height: 44px; min-height: 0; padding: 0; border-radius: 12px; }
.btn-icon.btn-sm { width: 36px; height: 36px; }
.btn-group { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 639.98px) {
  .btn-group--stack-mobile { flex-direction: column; }
  .btn-group--stack-mobile > .btn, .btn-group--stack-mobile > form, .btn-group--stack-mobile > form > .btn { width: 100%; }
}
form.inline { display: inline; }

/* --------------------------------------------------------------------------
   Cartes et surfaces
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 16px; min-width: 0;
}
@media (min-width: 640px) { .card { padding: 20px; } }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 12px; }
.card-head > h2, .card-head > h3 { font-size: 16px; font-weight: 800; }
.card-foot { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
:where(.card-link) { display: block; }   /* priorité nulle : .stack, .row… restent prioritaires */
.card-link { color: var(--navy); transition: border-color .15s, box-shadow .15s; }
.card-link:hover { color: var(--navy); border-color: var(--line-2); box-shadow: var(--shadow); }
.card-soft { background: var(--chip); border-color: var(--chip); }
.card-red { background: var(--red-tint); border-color: var(--red-line); }
.card-green { background: var(--green-soft); border-color: #CBE9D9; }
.card-amber { background: var(--amber-soft); border-color: var(--amber-line); }
.card-navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.card-navy .muted, .card-navy .muted-2 { color: #C9D3E6; }
.card-section + .card-section { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; }

/* Bandeau sombre (tête de tableau de bord) */
.hero {
  background: var(--navy); color: #fff; border-radius: var(--radius-lg); padding: 20px;
  position: relative; overflow: hidden;
}
.hero .muted, .hero .muted-2 { color: #C9D3E6; }
.hero a:not(.btn) { color: #fff; }
.hero-tile { background: var(--navy-2); border-radius: 16px; padding: 12px; color: #fff; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
a.hero-tile:hover { color: #fff; background: var(--navy-3); }
.hero-deco { position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; border: 28px solid var(--navy-3); pointer-events: none; }
.hero > *:not(.hero-deco) { position: relative; }
@media (max-width: 639.98px) {
  .hero--bleed { margin: -20px calc(-1 * var(--page-pad)) 0; border-radius: 0 0 24px 24px; }
}

/* Ligne d'action cliquable (« Ce qu'OCEM peut faire pour vous ») */
.action-row {
  display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); color: var(--navy); min-width: 0;
}
a.action-row:hover { color: var(--navy); border-color: var(--line-2); box-shadow: var(--shadow); }
.action-row__body { flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 600; line-height: 1.4; }
.action-row__chev { color: var(--muted-2); flex: none; }

/* Pastille d'icône */
.icon-badge { width: 40px; height: 40px; flex: none; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--blue-soft); color: var(--navy); }
.icon-badge--lg { width: 52px; height: 52px; border-radius: 16px; }
.icon-badge--sm { width: 32px; height: 32px; border-radius: 10px; }
.icon-badge--red { background: var(--red-soft); color: var(--red); }
.icon-badge--green { background: var(--green-soft); color: var(--green); }
.icon-badge--amber { background: var(--amber-soft); color: var(--amber); }
.icon-badge--navy { background: var(--navy); color: #fff; }
.icon-badge--white { background: #fff; border: 1px solid var(--line); color: var(--navy); }

/* Tuiles de modules (raccourcis) */
.tiles { display: grid; gap: 12px 8px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); } }
.tile { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--navy); text-align: center; min-width: 0; }
.tile:hover { color: var(--red-dark); }
.tile__icon { width: 52px; height: 52px; border-radius: 16px; background: #fff; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--navy); }
.tile:hover .tile__icon { border-color: var(--red-line); }

/* Statistiques */
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat__label { font-size: 13px; color: var(--muted); }
.stat__value { font-size: 26px; line-height: 1.15; font-weight: 800; letter-spacing: -.01em; }
.stat__hint { font-size: 12px; color: var(--muted); }
.stat__hint--up { color: var(--green-dark); font-weight: 700; }
.stat__hint--down { color: var(--red-dark); font-weight: 700; }
@media (min-width: 1024px) { .stat__value { font-size: 30px; } }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); } }
.stats > * { min-width: 0; }

/* --------------------------------------------------------------------------
   Badges, puces, avatars, progression
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; line-height: 1.5;
  background: var(--chip); color: var(--muted); white-space: nowrap;
}
.badge--success { background: var(--green-soft); color: var(--green-dark); }
.badge--warning { background: var(--amber-soft); color: var(--amber); }
.badge--danger { background: var(--red-soft); color: var(--red-dark); }
.badge--info { background: var(--blue-soft); color: var(--navy); }
.badge--brand { background: var(--red); color: #fff; }
.badge--navy { background: var(--navy); color: #fff; }
.badge--outline { background: transparent; border: 1px solid var(--line-2); color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; flex: none; }
.dot--green { background: var(--green-bright); }
.dot--red { background: var(--red-bright); }
.count-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--red-bright); color: #fff; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 14px;
  border-radius: 99px; border: 1px solid var(--line-2); background: #fff; color: var(--navy);
  font-size: 13px; font-weight: 700; white-space: nowrap; cursor: pointer;
}
.chip:hover { color: var(--navy); border-color: var(--navy); }
.chip.is-active, .chip[aria-current="page"], .chip[aria-pressed="true"], input:checked + .chip { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip--sm { min-height: 28px; padding: 3px 10px; font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 8px; background: var(--chip); color: var(--navy); font-size: 12px; font-weight: 700; }

.avatar {
  --size: 44px;
  width: var(--size); height: var(--size); flex: none; border-radius: 14px; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--red-bright); color: #fff; font-weight: 800; font-size: calc(var(--size) * .36);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--xs { --size: 28px; border-radius: 8px; }
.avatar--sm { --size: 36px; border-radius: 10px; }
.avatar--lg { --size: 64px; border-radius: 18px; }
.avatar--xl { --size: 96px; border-radius: 24px; }
.avatar--round { border-radius: 50%; }
.avatar--navy { background: var(--navy); }
.avatar--soft { background: var(--blue-soft); color: var(--navy); }

.progress { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: var(--red); width: 0; }
.progress--green > span { background: var(--green); }
.progress--navy > span { background: var(--navy); }
.progress--on-dark { background: var(--navy-4); }
.progress--on-dark > span { background: var(--coral); }
.progress--sm { height: 6px; }
.progress--lg { height: 12px; }

/* Anneau de score (valeur via --value: 0..100) */
.ring {
  --value: 0; --size: 120px; --ring-color: var(--red);
  width: var(--size); height: var(--size); border-radius: 50%; flex: none;
  background: conic-gradient(var(--ring-color) calc(var(--value) * 1%), var(--line) 0);
  display: grid; place-items: center;
}
.ring::before { content: ""; grid-area: 1 / 1; width: calc(100% - 20px); height: calc(100% - 20px); border-radius: 50%; background: var(--surface); }
.ring > * { grid-area: 1 / 1; position: relative; text-align: center; }
.ring--sm { --size: 72px; }
.ring--sm::before { width: calc(100% - 12px); height: calc(100% - 12px); }

/* Barres horizontales (comparaisons) */
.bars { display: grid; grid-template-columns: minmax(0, 120px) minmax(0, 1fr) auto; gap: 10px 12px; align-items: center; font-size: 13px; }
.bars__bar { height: 12px; border-radius: 99px; background: var(--navy); }
.bars__bar--muted { background: var(--muted-3); }
.bars__bar--red { background: var(--red); }

/* Étapes J.O.S.E.P.H. et étapes de parcours */
.steps-letters { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.step-letter { height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 800; background: var(--chip); color: var(--muted-2); border: 1.5px solid transparent; }
.step-letter.is-done { background: var(--navy); color: #fff; }
.step-letter.is-current { background: var(--red-soft); color: var(--red); border-color: var(--red); }
a.step-letter:hover { filter: brightness(.96); }

.stepper { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; font-weight: 700; color: var(--muted); }
.stepper__item { display: inline-flex; align-items: center; gap: 6px; }
.stepper__num { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--chip); font-size: 12px; }
.stepper__item.is-done .stepper__num { background: var(--navy); color: #fff; }
.stepper__item.is-current { color: var(--navy); }
.stepper__item.is-current .stepper__num { background: var(--red); color: #fff; }
.stepper__sep { width: 16px; height: 2px; background: var(--line-2); }

/* Chronologie */
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline__item { position: relative; padding: 0 0 20px 28px; }
.timeline__item::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item:last-child::before { display: none; }
.timeline__dot { position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--line-2); }
.timeline__item.is-done .timeline__dot { background: var(--navy); border-color: var(--navy); }
.timeline__item.is-current .timeline__dot { background: var(--red); border-color: var(--red-soft); box-shadow: 0 0 0 3px var(--red-soft); }

/* Listes à séparateurs */
.list { display: flex; flex-direction: column; }
.list > * + * { border-top: 1px solid var(--line); }
.list__item { display: flex; align-items: center; gap: 12px; padding: 12px 0; min-width: 0; color: var(--navy); }
.list__item > * { min-width: 0; }
a.list__item:hover { color: var(--navy); background: var(--bg); }
.card > .list:first-child .list__item:first-child { padding-top: 0; }
.list--padded .list__item { padding-left: 16px; padding-right: 16px; }
.dl { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px 16px; }
.dl dt { font-size: 13px; color: var(--muted); }
.dl dd { font-weight: 600; margin-bottom: 8px; }
@media (min-width: 640px) {
  .dl { grid-template-columns: minmax(0, 200px) minmax(0, 1fr); }
  .dl dd { margin-bottom: 0; }
}

/* --------------------------------------------------------------------------
   Alertes et messages flash
   -------------------------------------------------------------------------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; font-size: 14px; min-width: 0; }
.alert > svg { margin-top: 1px; }
.alert__body { flex: 1 1 auto; min-width: 0; }
.alert--success { background: var(--green-soft); border-color: #CBE9D9; color: var(--green-dark); }
.alert--warning { background: var(--amber-soft); border-color: var(--amber-line); color: var(--amber); }
.alert--danger, .alert--error { background: var(--red-tint); border-color: var(--red-line); color: var(--red-darker); }
.alert--info { background: var(--blue-soft); border-color: #D3DEF2; color: var(--navy); }
.alert__close { background: none; border: 0; color: inherit; opacity: .6; padding: 0 2px; line-height: 1; font-size: 20px; }
.flash-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }

/* État vide */
.empty { text-align: center; padding: 32px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty__icon { width: 56px; height: 56px; border-radius: 18px; background: var(--chip); color: var(--muted-2); display: flex; align-items: center; justify-content: center; }
.empty__title { color: var(--navy); font-weight: 800; font-size: 16px; }

/* --------------------------------------------------------------------------
   Formulaires
   -------------------------------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.form-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) {
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid .span-2, .form-grid .col-span-2 { grid-column: 1 / -1; }
}
.form-grid > * { min-width: 0; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: 14px; font-weight: 700; color: var(--navy); }
.label .req { color: var(--red); }
.label .opt { font-weight: 500; color: var(--muted-2); font-size: 12px; }
.input, .select, .textarea {
  width: 100%; min-width: 0; min-height: 48px; padding: 11px 14px;
  border: 1px solid var(--line-2); border-radius: 12px; background: #fff; color: var(--navy);
  font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(10, 34, 73, .12); }
.input[readonly], .input:disabled, .select:disabled, .textarea:disabled { background: var(--chip); color: var(--muted); }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--red); }
.input-sm, .select-sm { min-height: 38px; padding: 7px 12px; font-size: 14px; border-radius: 10px; }
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236A7690' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
select[multiple].select { background-image: none; padding-right: 14px; min-height: 120px; }
input[type="file"].input { padding: 10px; min-height: 0; }
input[type="color"].input { padding: 4px; height: 48px; }
.help { font-size: 12px; color: var(--muted); }
.error, .field-error { font-size: 13px; font-weight: 600; color: var(--red-dark); }
.input-group { display: flex; min-width: 0; }
.input-group > .input { border-radius: 12px 0 0 12px; }
.input-group > .input-addon { display: inline-flex; align-items: center; padding: 0 14px; border: 1px solid var(--line-2); border-left: 0; border-radius: 0 12px 12px 0; background: var(--chip); font-weight: 700; font-size: 14px; color: var(--muted); white-space: nowrap; }
.input-group > .input-addon:first-child { border-left: 1px solid var(--line-2); border-right: 0; border-radius: 12px 0 0 12px; }
.input-group > .input-addon:first-child + .input { border-radius: 0 12px 12px 0; }
.input-icon { position: relative; min-width: 0; }
.input-icon > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted-2); pointer-events: none; }
.input-icon > .input { padding-left: 44px; }

.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; min-width: 0; }
.check input[type="checkbox"], .check input[type="radio"] { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--red); }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; font-weight: 600; }
.switch input { appearance: none; -webkit-appearance: none; width: 44px; height: 26px; border-radius: 99px; background: var(--line-2); position: relative; flex: none; margin: 0; cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked { background: var(--green); }
.switch input:checked::after { transform: translateX(18px); }

/* Cartes de choix (radio / case à cocher stylés) */
.choice { position: relative; display: block; min-width: 0; }
.choice > input { position: absolute; opacity: 0; pointer-events: none; }
.choice__box { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border-radius: 16px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; transition: border-color .15s, background .15s; min-width: 0; }
.choice__box:hover { border-color: var(--line-2); }
.choice > input:checked + .choice__box { border-color: var(--red); background: var(--red-tint); }
.choice > input:focus-visible + .choice__box { outline: 3px solid rgba(200, 38, 15, .45); outline-offset: 2px; }
.choice__mark { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 2px solid var(--line-2); margin-top: 1px; display: flex; align-items: center; justify-content: center; }
.choice > input:checked + .choice__box .choice__mark { border-color: var(--red); background: var(--red); box-shadow: inset 0 0 0 3px #fff; }
.choices { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .choices--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .choices--3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }

/* Groupe de champs sans cadre par défaut */
.fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.fieldset > legend { padding: 0; margin-bottom: 4px; font-size: 14px; font-weight: 800; }

/* Bloc repliable */
.disclosure { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.disclosure > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; font-weight: 700; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--muted-2); border-bottom: 2px solid var(--muted-2); transform: rotate(45deg); transition: transform .15s; flex: none; margin-top: -4px; }
.disclosure[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.disclosure__body { padding: 0 16px 16px; }

/* Code OTP */
.otp { display: flex; gap: 10px; justify-content: center; }
.otp__input { width: 56px; height: 64px; min-width: 0; flex: 0 1 56px; text-align: center; font-size: 26px; font-weight: 800; border: 1.5px solid var(--line-2); border-radius: 14px; background: #fff; color: var(--navy); }
.otp__input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }

/* Barre de filtres : se replie dans un <details> sur mobile */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters > .field { flex: 1 1 180px; }
.filters > .btn { flex: none; }
.filter-panel > summary { list-style: none; }
.filter-panel > summary::-webkit-details-marker { display: none; }
@media (min-width: 1024px) {
  .filter-panel > summary.filter-panel__toggle { display: none; }
  .filter-panel:not([open]) > .filter-panel__body { display: block; }
}

/* Barre de recherche */
.search-bar { display: flex; gap: 8px; min-width: 0; }
.search-bar > .input-icon { flex: 1 1 auto; }

/* --------------------------------------------------------------------------
   Tableaux : jamais de défilement horizontal.
   .table-stack : sous 768px, chaque ligne devient une carte (libellés via data-label).
   .table-stack-lg : idem sous 1100px (tableaux à nombreuses colonnes).
   .col-opt : colonne masquée sous 1024px (information secondaire).
   -------------------------------------------------------------------------- */
.table { width: 100%; font-size: 14px; table-layout: auto; }
.table th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
/* break-word (et non anywhere) : les colonnes ne se réduisent pas à une lettre de large */
.table td { padding: 12px; border-bottom: 1px solid var(--line-3); vertical-align: middle; overflow-wrap: break-word; hyphens: auto; }
.table td.wrap-any { overflow-wrap: anywhere; }
.table td.actions { white-space: nowrap; }
@media (min-width: 768px) { .table td.actions .cluster { flex-wrap: nowrap; } }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #FAFBFD; }
.table .num { text-align: right; white-space: nowrap; }
.table .actions { text-align: right; }
.table .actions .cluster { justify-content: flex-end; }
.card > .table:first-child th { padding-top: 0; }
@media (max-width: 1023.98px) { .table .col-opt { display: none; } }

@media (max-width: 767.98px) {
  /* La carte qui contient un tableau empilé s'efface : chaque ligne devient sa propre carte */
  .card-flush:has(> .table-stack) { background: transparent; border: 0; overflow: visible; }
  .table-stack td.actions { white-space: normal; }
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { border: 1px solid var(--line); border-radius: 14px; padding: 6px 12px; margin-bottom: 10px; background: #fff; }
  .table-stack tbody tr:hover td { background: transparent; }
  .table-stack td { display: grid; grid-template-columns: minmax(0, 40%) minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-3); text-align: left !important; }
  .table-stack tr td:last-child { border-bottom: 0; }
  .table-stack td::before { content: attr(data-label); font-size: 12px; font-weight: 700; color: var(--muted); }
  .table-stack td[data-label=""]::before, .table-stack td:not([data-label])::before { display: none; }
  .table-stack td[data-label=""], .table-stack td:not([data-label]) { grid-template-columns: minmax(0, 1fr); }
  .table-stack td.actions .cluster { justify-content: flex-start; }
  .table-stack .col-opt { display: grid; }
}
@media (max-width: 1099.98px) {
  .card-flush:has(> .table-stack-lg) { background: transparent; border: 0; overflow: visible; }
  .table-stack-lg td.actions { white-space: normal; }
  .table-stack-lg thead { display: none; }
  .table-stack-lg, .table-stack-lg tbody, .table-stack-lg tr, .table-stack-lg td { display: block; width: 100%; }
  .table-stack-lg tr { border: 1px solid var(--line); border-radius: 14px; padding: 6px 12px; margin-bottom: 10px; background: #fff; }
  .table-stack-lg tbody tr:hover td { background: transparent; }
  .table-stack-lg td { display: grid; grid-template-columns: minmax(0, 40%) minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-3); text-align: left !important; }
  .table-stack-lg tr td:last-child { border-bottom: 0; }
  .table-stack-lg td::before { content: attr(data-label); font-size: 12px; font-weight: 700; color: var(--muted); }
  .table-stack-lg td[data-label=""]::before, .table-stack-lg td:not([data-label])::before { display: none; }
  .table-stack-lg td[data-label=""], .table-stack-lg td:not([data-label]) { grid-template-columns: minmax(0, 1fr); }
  .table-stack-lg td.actions .cluster { justify-content: flex-start; }
  .table-stack-lg .col-opt { display: grid; }
}

/* --------------------------------------------------------------------------
   Navigation prioritaire (« Plus » ☰)
   Les éléments qui ne tiennent pas sur la ligne sont déplacés par ocem.js dans
   le menu du bouton « Plus ». Sans JavaScript, la liste passe simplement à la ligne.
   -------------------------------------------------------------------------- */
.pnav { position: relative; display: flex; align-items: center; gap: 4px; min-width: 0; width: 100%; }
.pnav__list { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; flex: 1 1 auto; margin: 0; padding: 0; list-style: none; }
.js .pnav__list { flex-wrap: nowrap; overflow: hidden; }
.pnav__item { flex: none; }
.pnav__item.is-overflow { display: none; }
.pnav__more { position: relative; flex: none; display: none; }
.pnav.has-overflow .pnav__more { display: block; }
.pnav__more-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px;
  border-radius: 12px; border: 1px solid var(--line-2); background: #fff; color: var(--navy);
  font-size: 14px; font-weight: 700; white-space: nowrap;
}
.pnav__more-btn:hover, .pnav__more-btn[aria-expanded="true"] { border-color: var(--navy); }
.pnav__more-btn.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.pnav__menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 220px; max-width: min(320px, calc(100vw - 32px));
  background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
  padding: 6px; display: flex; flex-direction: column; max-height: 70vh; overflow-y: auto;
}
.pnav__menu[hidden] { display: none; }
.pnav__menu a, .pnav__menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 10px;
  color: var(--navy); font-size: 14px; font-weight: 600; background: none; border: 0; text-align: left; white-space: normal;
}
.pnav__menu a:hover, .pnav__menu button:hover { background: var(--chip); color: var(--navy); }
.pnav__menu .is-active, .pnav__menu [aria-current="page"] { background: var(--red-soft); color: var(--red-dark); }
.pnav__menu .chip, .pnav__menu .tab { border: 0; min-height: 0; border-radius: 10px; }

/* Onglets (sous-navigation d'un espace ou d'une page) */
.tabs { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.tab {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px; border-radius: 12px;
  color: var(--muted); font-size: 14px; font-weight: 700; white-space: nowrap; background: none; border: 0;
}
.tab:hover { color: var(--navy); background: var(--chip); }
.tab.is-active, .tab[aria-current="page"] { color: #fff; background: var(--navy); }
.tab .count-badge { background: var(--red); }
.tab.is-active .count-badge, .tab[aria-current="page"] .count-badge { background: #fff; color: var(--navy); }

/* Menu déroulant (details/summary) */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown__menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; min-width: 240px; max-width: calc(100vw - 32px);
  background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px;
  display: flex; flex-direction: column;
}
.dropdown__menu--left { right: auto; left: 0; }
.dropdown__menu a, .dropdown__menu button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--navy); font-size: 14px; font-weight: 600; background: none; border: 0; width: 100%; text-align: left; }
.dropdown__menu a:hover, .dropdown__menu button:hover { background: var(--chip); color: var(--navy); }
.dropdown__menu hr { margin: 6px 0; }
.dropdown__head { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }

/* --------------------------------------------------------------------------
   Fenêtre modale (<dialog>)
   -------------------------------------------------------------------------- */
dialog.modal {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; border: 0;
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); color: var(--navy); overflow: auto;
}
dialog.modal--lg { width: min(820px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(10, 34, 73, .55); }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 1; }
.modal__head h2 { font-size: 17px; font-weight: 800; }
.modal__body { padding: 20px; }
.modal__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--bg); }
@media (max-width: 639.98px) {
  dialog.modal { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 22px 22px 0 0; max-height: 92vh; }
}

/* Pagination */
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; }
.pagination__pages { display: flex; flex-wrap: wrap; gap: 4px; }
.pagination__link { min-width: 40px; height: 40px; padding: 0 10px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line-2); background: #fff; color: var(--navy); font-weight: 700; font-size: 14px; }
.pagination__link:hover { border-color: var(--navy); color: var(--navy); }
.pagination__link.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.pagination__link.is-disabled { opacity: .45; pointer-events: none; }
@media (max-width: 639.98px) { .pagination__pages .pagination__link:not(.is-active):not(.is-edge) { display: none; } }

/* --------------------------------------------------------------------------
   Structure de l'application connectée
   -------------------------------------------------------------------------- */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 80; width: min(var(--sidebar-w), 86vw);
  background: var(--navy); color: #C9D3E6; display: flex; flex-direction: column;
  transform: translateX(-100%); transition: transform .2s ease; overflow-y: auto; overscroll-behavior: contain;
}
.sidebar.is-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
.sidebar__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 16px 10px; }
.sidebar__logo { background: #fff; border-radius: 12px; padding: 7px 12px; display: inline-flex; }
.sidebar__logo img { height: 26px; width: auto; display: block; }
.sidebar__close { background: var(--navy-2); color: #fff; border: 0; width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; }
.sidebar__section { padding: 8px 12px; }
.sidebar__title { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #FFB4A6; padding: 10px 12px 6px; }
.sidebar__nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar__link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #C9D3E6; font-size: 14px; font-weight: 600; min-width: 0; }
.sidebar__link:hover { color: #fff; background: rgba(255,255,255,.06); }
.sidebar__link.is-active { background: var(--navy-2); color: #fff; }
.sidebar__link.is-active svg { color: var(--coral); }
.sidebar__link span { flex: 1 1 auto; min-width: 0; }
.sidebar__more { margin-top: 2px; }
.sidebar__more > summary { list-style: none; cursor: pointer; }
.sidebar__more > summary::-webkit-details-marker { display: none; }
.sidebar__more-chev { transition: transform .15s; opacity: .7; }
.sidebar__more[open] > summary .sidebar__more-chev { transform: rotate(180deg); }
.sidebar__more > .sidebar__nav { padding-left: 12px; margin-top: 2px; border-left: 1px solid rgba(255,255,255,.1); margin-left: 21px; }
.sidebar__more .sidebar__link { padding-top: 8px; padding-bottom: 8px; }
.sidebar__foot { margin-top: auto; padding: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.backdrop { position: fixed; inset: 0; z-index: 75; background: rgba(10, 34, 73, .5); }
body.nav-open { overflow: hidden; }

.app-main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 50; height: var(--topbar-h);
  display: flex; align-items: center; gap: 10px; padding: 0 var(--page-pad);
  background: rgba(255,255,255,.96); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line);
}
.topbar__logo img { height: 30px; width: auto; display: block; }
.topbar__search { flex: 1 1 auto; max-width: 520px; min-width: 0; }
.topbar__search .input { min-height: 42px; background: var(--bg); border-color: var(--bg); }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topbar__icon { position: relative; width: 42px; height: 42px; border-radius: 12px; background: var(--chip); color: var(--navy); display: inline-flex; align-items: center; justify-content: center; border: 0; }
.topbar__icon:hover { color: var(--navy); background: var(--line); }
.topbar__icon .count-badge { position: absolute; top: -4px; right: -4px; border: 2px solid #fff; }
.topbar__user > summary { display: flex; align-items: center; gap: 10px; padding: 3px; border-radius: 14px; }
.topbar__user > summary:hover { background: var(--chip); }

.page { flex: 1 1 auto; width: 100%; max-width: calc(var(--content-max) + 2 * var(--page-pad)); margin: 0 auto; padding: 20px var(--page-pad) calc(var(--bottomnav-h) + 32px); min-width: 0; }
.page--wide { max-width: none; }
.page--flush { padding: 0 0 calc(var(--bottomnav-h) + 16px); max-width: none; }
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; margin-bottom: 20px; }
.page-header__main { display: flex; align-items: flex-start; gap: 12px; min-width: 0; flex: 1 1 320px; }
.page-header__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.page-header__sub { font-size: 14px; color: var(--muted); }
.page-header__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.back-btn { width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--chip); color: var(--navy); display: inline-flex; align-items: center; justify-content: center; }
.back-btn:hover { color: var(--navy); background: var(--line); }
.subnav { margin: -4px 0 20px; }

/* Barre de navigation basse (mobile et tablette) */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  background: #fff; border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.bottom-nav__item { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; font-size: 11px; font-weight: 700; color: #5A6681; background: none; border: 0; min-width: 0; }
.bottom-nav__item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bottom-nav__item.is-active, .bottom-nav__item:hover { color: var(--red); }

@media (min-width: 1024px) {
  .sidebar { transform: none; width: var(--sidebar-w); box-shadow: none; }
  .sidebar__close, .backdrop { display: none !important; }
  body.nav-open { overflow: auto; }
  .app-shell--with-sidebar .app-main { margin-left: var(--sidebar-w); }
  .bottom-nav, .topbar__menu, .topbar__logo--mobile { display: none !important; }
  .page { padding-bottom: 48px; }
  .page--flush { padding-bottom: 0; }
}
@media (max-width: 1023.98px) {
  .topbar__search { display: none; }
}

/* Application sans compte (offres, événements publics) */
.guest-bar { display: flex; align-items: center; gap: 12px; }

/* --------------------------------------------------------------------------
   Écrans d'accueil, connexion, inscription (layout « auth »)
   -------------------------------------------------------------------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); background: #fff; }
.auth__aside { display: none; }
.auth__main { display: flex; flex-direction: column; min-width: 0; padding: 20px var(--page-pad) 36px; }
.auth__inner { width: 100%; max-width: 460px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; flex: 1 1 auto; }
.auth__inner--wide { max-width: 760px; }
.auth__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
@media (min-width: 1024px) {
  .auth { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .auth__aside {
    display: flex; flex-direction: column; justify-content: space-between; gap: 24px; padding: 40px;
    background: var(--navy); color: #fff; position: sticky; top: 0; height: 100vh; overflow: hidden;
  }
  .auth__main { padding: 40px; justify-content: center; }
}
.auth__aside-logo { background: #fff; border-radius: 14px; padding: 10px 14px; align-self: flex-start; }
.auth__aside-logo img { height: 34px; width: auto; display: block; }
.brand-art { position: relative; border-radius: var(--radius-xl); background: var(--navy); overflow: hidden; min-height: 220px; display: flex; align-items: flex-end; padding: 24px; color: #fff; }
.brand-art__ring { position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%; border: 30px solid var(--navy-3); }
.brand-art__dot { position: absolute; right: 70px; top: 70px; width: 34px; height: 34px; border-radius: 50%; background: var(--red-bright); }
.brand-art__arc { position: absolute; left: -40px; bottom: 96px; width: 300px; height: 54px; border-radius: 0 0 300px 300px / 0 0 54px 54px; background: var(--red-bright); opacity: .9; }
.brand-art > *:not([class^="brand-art__"]) { position: relative; }
.brand-art__letter { position: relative; font-size: 120px; line-height: .8; font-weight: 800; letter-spacing: -.04em; }
.dots { display: flex; gap: 8px; justify-content: center; }
.dots > * { width: 8px; height: 8px; border-radius: 99px; border: 0; padding: 0; background: var(--line-2); }
.dots > .is-active { width: 28px; background: var(--red); }

/* --------------------------------------------------------------------------
   Site public
   -------------------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.97); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
.site-header__inner { max-width: 1240px; margin: 0 auto; padding: 10px var(--page-pad); display: flex; align-items: center; gap: 16px; min-height: 68px; }
.site-header__logo img { height: 36px; width: auto; display: block; }
.site-header__nav { flex: 1 1 auto; min-width: 0; }
.site-header__nav .pnav__list { justify-content: center; }
.site-nav-link { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 12px; border-radius: 10px; color: var(--navy); font-size: 14px; font-weight: 700; white-space: nowrap; }
.site-nav-link:hover, .site-nav-link.is-active { color: var(--red-dark); background: var(--red-tint); }
.site-header__cta { display: flex; gap: 8px; flex: none; }
.section { padding: 48px var(--page-pad); }
@media (min-width: 1024px) { .section { padding: 80px var(--page-pad); } }
.section__inner { max-width: 1240px; margin: 0 auto; }
.section--navy { background: var(--navy); color: #fff; }
.section--navy .muted, .section--navy .lead { color: #C9D3E6; }
.section--white { background: #fff; }
.site-footer { background: var(--navy); color: #C9D3E6; padding: 40px var(--page-pad) 32px; }
.site-footer a { color: #fff; }
.site-footer__inner { max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }

/* --------------------------------------------------------------------------
   Administration
   -------------------------------------------------------------------------- */
.admin .sidebar__title { color: #FFB4A6; }
.kanban { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); align-items: start; }
.kanban__col { background: var(--chip); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.kanban__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px; font-size: 13px; font-weight: 800; }
.kanban__card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; color: var(--navy); }
a.kanban__card:hover { color: var(--navy); border-color: var(--line-2); box-shadow: var(--shadow); }

/* --------------------------------------------------------------------------
   Éléments spécifiques réutilisables
   -------------------------------------------------------------------------- */
.qr { background: #fff; border-radius: 16px; padding: 12px; display: inline-flex; border: 1px solid var(--line); }
.qr svg { width: 180px; height: 180px; display: block; }
.member-card {
  position: relative; overflow: hidden; border-radius: 22px; padding: 20px; color: #fff;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 70%, var(--navy-4) 100%);
  width: 100%; max-width: 440px; aspect-ratio: 1.586 / 1; display: flex; flex-direction: column; justify-content: space-between; gap: 10px;
}
@media (max-width: 379.98px) { .member-card { aspect-ratio: auto; } }
.video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #071833; border-radius: var(--radius-lg); overflow: hidden; }
.video-frame iframe, .video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.chat { display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: min(80%, 520px); padding: 10px 14px; border-radius: 18px; font-size: 14px; line-height: 1.5; background: #fff; border: 1px solid var(--line); align-self: flex-start; overflow-wrap: anywhere; }
.bubble--me { align-self: flex-end; background: var(--navy); border-color: var(--navy); color: #fff; }
.bubble__meta { display: block; font-size: 11px; opacity: .7; margin-top: 4px; }
.price { font-size: 22px; font-weight: 800; }
.cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); background: var(--chip); display: block; }
.thumb { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: var(--chip); flex: none; }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--muted-2); font-size: 13px; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.kbd { font-family: ui-monospace, monospace; font-size: 13px; background: var(--chip); padding: 2px 8px; border-radius: 6px; }
.ref { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.certificate { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px 20px; text-align: center; position: relative; overflow: hidden; }
.certificate::before { content: ""; position: absolute; inset: 10px; border: 2px solid var(--red-line); border-radius: 12px; pointer-events: none; }
.certificate > * { position: relative; }

/* Impression */
@media print {
  .sidebar, .topbar, .bottom-nav, .no-print, .site-header, .site-footer { display: none !important; }
  .app-shell--with-sidebar .app-main { margin-left: 0; }
  body { background: #fff; }
  .page { padding: 0; }
}
