/* Copie du thème du BackOffice (BackOffice/public/css/iep-theme.css) : garder les deux fichiers synchronisés. */
/* =============================================================================
   i-Concours BackOffice : thème Bootstrap 5.3 aux couleurs de Sciences Po Bordeaux
   Charte : rouge #dd1019 et anthracite #2f3235 (logo), palette complémentaire,
   Bitter (titres) + Open Sans (texte). Proposition validée le 08/11/2026.
   ========================================================================== */

/* ---------- Polices auto-hébergées ---------- */
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("../vendor/fonts/open-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-style: italic; font-weight: 400; font-display: swap; src: url("../vendor/fonts/open-sans-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("../vendor/fonts/open-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("../vendor/fonts/open-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("../vendor/fonts/open-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Bitter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../vendor/fonts/bitter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Bitter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../vendor/fonts/bitter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Bitter"; font-style: normal; font-weight: 700; font-display: swap; src: url("../vendor/fonts/bitter-latin-700-normal.woff2") format("woff2"); }

/* ---------- Jetons ---------- */
:root {
  --iep-rouge: #dd1019;
  --iep-anthracite: #2f3235;
  --iep-bleu: #0072bc;
  --iep-bleu-nuit: #0f315e;
  --iep-canard: #00999a;
  --iep-vert: #00854a;
  --iep-orange: #f7941e;
  --iep-jaune: #fbd238;
  --iep-framboise: #ab1e52;

  --primary: var(--iep-bleu);
  --primary-hover: #005f9e;
  --primary-soft: #e6f1f8;
  --primary-ring: rgba(0, 114, 188, .22);
  --danger-soft: #fce8e9;
  --success-soft: #e5f3ec;
  --warning-soft: #fef1e1;
  --info-soft: #e0f3f3;

  --bg: #f7f6f3;
  --surface: #ffffff;
  --surface-2: #f1efea;
  --border: #e6e2da;
  --border-strong: #d3cec4;
  --text: var(--iep-anthracite);
  --text-muted: #6b6f74;

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(47, 50, 53, .06);
  --shadow: 0 1px 2px rgba(47, 50, 53, .05), 0 4px 14px rgba(47, 50, 53, .06);
  --shadow-lg: 0 10px 40px rgba(47, 50, 53, .16);
  --ease: 160ms cubic-bezier(.2, .7, .3, 1);

  --font-title: "Bitter", "Rokkitt", Georgia, serif;
  --font-ui: "Open Sans", "Segoe UI", Arial, sans-serif;

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

  /* Surcharge Bootstrap 5.3 */
  --bs-body-font-family: var(--font-ui);
  --bs-body-font-size: .875rem;
  --bs-body-line-height: 1.55;
  --bs-body-color: var(--text);
  --bs-body-bg: var(--bg);
  --bs-primary: var(--iep-bleu);
  --bs-primary-rgb: 0, 114, 188;
  --bs-danger: var(--iep-rouge);
  --bs-danger-rgb: 221, 16, 25;
  --bs-success: var(--iep-vert);
  --bs-success-rgb: 0, 133, 74;
  --bs-warning: var(--iep-orange);
  --bs-warning-rgb: 247, 148, 30;
  --bs-info: var(--iep-canard);
  --bs-info-rgb: 0, 153, 154;
  --bs-secondary-color: var(--text-muted);
  --bs-border-color: var(--border);
  --bs-border-radius: var(--radius);
  --bs-border-radius-sm: var(--radius-sm);
  --bs-border-radius-lg: var(--radius-lg);
  --bs-link-color: var(--iep-bleu);
  --bs-link-color-rgb: 0, 114, 188;
  --bs-link-hover-color: var(--primary-hover);
  --bs-link-hover-color-rgb: 0, 95, 158;
  --bs-focus-ring-color: var(--primary-ring);
  --bs-heading-color: var(--iep-anthracite);
}

/* ---------- Base ---------- */
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
h1, h2, h3, .h1, .h2, .h3 { font-family: var(--font-title); font-weight: 700; color: var(--iep-anthracite); }
h1, .h1 { font-size: 1.6rem; }
h2, .h2 { font-size: 1.3rem; font-weight: 600; }
h3, .h3 { font-size: 1.1rem; font-weight: 600; }
h4, h5, h6, .h4, .h5, .h6 { font-family: var(--font-ui); font-weight: 600; color: var(--iep-anthracite); }
h4, .h4 { font-size: 1rem; }
h5, .h5 { font-size: .95rem; }
h6, .h6 { font-size: .85rem; }
legend { font-family: var(--font-title); font-size: 1.05rem; font-weight: 600; color: var(--iep-anthracite); border-bottom: 1px solid var(--border); padding-bottom: .4rem; margin-bottom: 1rem; float: none; width: 100%; }
a { text-decoration: none; transition: color var(--ease); }
a:hover { text-decoration: underline; }
hr { border-color: var(--border); opacity: 1; }
::selection { background: var(--primary-soft); }
.text-muted, .muted { color: var(--text-muted) !important; }
.text-error { color: var(--iep-rouge) !important; }
.page-header { border-bottom: 1px solid var(--border); padding-bottom: .5rem; margin: 0 0 1.25rem; }

/* ---------- Mise en page ---------- */
.app-topbar {
  position: sticky; top: 0; z-index: 1030;
  height: var(--topbar-h); background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 20px;
}
/* Liseré rouge de la charte, qui sert aussi de barre de progression (js/iep-progress.js) */
.app-progress { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--iep-rouge); overflow: hidden; pointer-events: none; }
.app-progress i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--iep-rouge); box-shadow: 0 0 8px rgba(221, 16, 25, .55); opacity: 0; }
body.is-loading .app-progress { background: rgba(221, 16, 25, .18); }
body.is-loading .app-progress i { opacity: 1; animation: iep-progress 8s cubic-bezier(.08, .7, .2, 1) forwards; }
body.is-loading .app-progress::after { content: ""; position: absolute; top: 0; bottom: 0; width: 30%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); animation: iep-shimmer 1.1s linear infinite; }
body.is-done .app-progress i { opacity: 1; width: 100% !important; transition: width .2s ease-out; animation: none; }
/* Progression locale : composant (carte, bloc, tableau, modale) dans lequel une action est en cours */
.is-busy { position: relative; cursor: progress; }
.is-busy::before { content: ""; position: absolute; z-index: 5; left: 10px; right: 10px; top: 0; height: 3px; border-radius: 0 0 3px 3px; pointer-events: none;
  background: linear-gradient(90deg, rgba(221, 16, 25, .15) 0%, var(--iep-rouge) 30%, var(--iep-rouge) 55%, rgba(221, 16, 25, .15) 85%);
  background-size: 200% 100%; animation: iep-busy 1.1s linear infinite; }
.is-busy > * { transition: opacity var(--ease); }
.is-busy.is-busy-dim > :not(.modal-header):not(.dropdown-menu) { opacity: .6; }
.btn.is-pending { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-pending::after { content: ""; position: absolute; left: 50%; top: 50%; width: 1em; height: 1em; margin: -.5em 0 0 -.5em; border-radius: 50%; border: 2px solid currentColor; border-color: var(--bs-btn-color, #fff) transparent var(--bs-btn-color, #fff) transparent; animation: iep-spin .7s linear infinite; }
input.btn.is-pending { color: var(--bs-btn-color) !important; opacity: .65; cursor: progress; } /* pas de ::after sur <input> */
.btn-primary.is-pending::after { border-color: #fff transparent #fff transparent; }
.btn:not(.btn-primary).is-pending::after { border-color: var(--iep-bleu) transparent var(--iep-bleu) transparent; }
@keyframes iep-busy { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes iep-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .is-busy::before, .btn.is-pending::after { animation-duration: 3s; } }
@keyframes iep-progress { 0% { width: 0; } 15% { width: 35%; } 50% { width: 70%; } 100% { width: 92%; } }
@keyframes iep-shimmer { from { left: -30%; } to { left: 100%; } }
@media (prefers-reduced-motion: reduce) {
  body.is-loading .app-progress i { animation: none; width: 70%; }
  body.is-loading .app-progress::after { animation: none; display: none; }
}
.app-brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.app-brand:hover { text-decoration: none; }
.app-brand .logo-spb { height: 36px; width: auto; }
.app-brand .logo-ic { height: 32px; width: auto; }
.app-brand .sep { width: 1px; height: 30px; background: var(--border-strong); }
.app-title { font-size: .8rem; color: var(--text-muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-env { font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: var(--warning-soft); color: #b36200; }
.app-env-prod { display: none; }
.app-user { display: flex; align-items: center; gap: 10px; font-size: .82rem; color: var(--text); }
.app-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 700; font-size: .72rem; text-transform: uppercase; }
.app-burger { display: none; border: 0; background: transparent; font-size: 1.4rem; color: var(--text); padding: 4px 6px; border-radius: var(--radius-sm); }
.app-burger:hover { background: var(--surface-2); }

.app-shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: calc(100vh - var(--topbar-h)); }
.app-shell.no-menu { grid-template-columns: minmax(0, 1fr); }
.app-sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 18px 12px; position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto; }
.app-main { padding: 24px 28px 48px; min-width: 0; }
.app-main > .app-content { max-width: 1400px; }

/* Menu latéral */
.side-nav { list-style: none; margin: 0; padding: 0; }
.side-nav .side-group { margin-bottom: 18px; }
.side-nav .side-label { display: block; padding: 0 10px 6px; font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-muted); }
.side-nav ul { list-style: none; margin: 0; padding: 0; }
.side-nav a { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 7px 10px; border-radius: var(--radius); color: var(--text); font-weight: 500; line-height: 1.3; transition: background var(--ease), color var(--ease); }
.side-nav a:hover { background: var(--surface-2); text-decoration: none; }
.side-nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.side-nav a .bi { font-size: 1.05rem; width: 18px; text-align: center; opacity: .85; flex: none; }

/* En-tête de page */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head .crumb { font-size: .78rem; color: var(--text-muted); margin-bottom: 2px; }

/* ---------- Cartes / blocs ---------- */
.card, .panel-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-header { background: transparent; border-bottom: 1px solid var(--border); padding: 14px 16px; }
.card-header h2, .card-header h3 { margin: 0; font-size: 1rem; }
.card-body { padding: 16px; }
.well { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 16px 18px; margin-bottom: 20px; }
.well-small { padding: 12px 14px; }

/* Bloc d'écran historique (.iep-group) : carte blanche, titre h5 en titre de page */
.iep-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 20px 22px; margin-bottom: 20px; }
.iep-group > h5, .iep-group > h4 { font-family: var(--font-title); font-size: 1.3rem; font-weight: 700; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; }
.iep-group > h5 .float-end, .iep-group > h4 .float-end { float: none !important; margin-left: auto; }
.iep-group .iep-group { box-shadow: none; padding: 16px; background: #fcfbf9; }
.iep-group .well { background: #fbfaf8; box-shadow: none; }
.iep-group .table-wrap { box-shadow: none; }
.row > [class*="col-"] > .iep-group:only-child { margin-bottom: 0; }
br.clearfix { display: none; }

/* Indicateurs (accueil) */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.kpi .kpi-value { font-family: var(--font-title); font-size: 1.75rem; font-weight: 700; line-height: 1.15; }
.kpi .kpi-label { font-size: .82rem; color: var(--text-muted); }
.kpi .kpi-bar { height: 4px; border-radius: 4px; margin-top: 10px; background: var(--surface-2); overflow: hidden; }
.kpi .kpi-bar i { display: block; height: 100%; border-radius: 4px; background: var(--iep-bleu); }

/* ---------- Boutons ---------- */
.btn { --bs-btn-font-weight: 600; --bs-btn-font-size: .845rem; --bs-btn-padding-y: .45rem; --bs-btn-padding-x: .9rem; --bs-btn-border-radius: var(--radius); display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background-color var(--ease), border-color var(--ease), box-shadow var(--ease), color var(--ease), transform var(--ease); }
.btn:active { transform: translateY(1px); }
.btn-sm { --bs-btn-padding-y: .28rem; --bs-btn-padding-x: .65rem; --bs-btn-font-size: .8rem; --bs-btn-border-radius: var(--radius-sm); }
.btn-primary { --bs-btn-bg: var(--iep-bleu); --bs-btn-border-color: var(--iep-bleu); --bs-btn-hover-bg: var(--primary-hover); --bs-btn-hover-border-color: var(--primary-hover); --bs-btn-active-bg: #004f84; --bs-btn-active-border-color: #004f84; --bs-btn-disabled-bg: var(--iep-bleu); --bs-btn-disabled-border-color: var(--iep-bleu); box-shadow: 0 1px 2px rgba(0, 114, 188, .25); }
/* Bouton Bootstrap 2 sans variante (.btn seul) : bouton neutre */
.btn:not(.btn-primary):not(.btn-danger):not(.btn-success):not(.btn-warning):not(.btn-info):not(.btn-link):not(.btn-soft):not(.btn-close), .btn-default, .btn-secondary, .btn-light, .btn-outline-secondary {
  --bs-btn-color: var(--text); --bs-btn-bg: var(--surface); --bs-btn-border-color: var(--border-strong);
  --bs-btn-hover-color: var(--text); --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-border-color: #c4beb2;
  --bs-btn-active-color: var(--text); --bs-btn-active-bg: #e8e5de; --bs-btn-active-border-color: #c4beb2;
}
.btn-soft { --bs-btn-color: var(--primary); --bs-btn-bg: var(--primary-soft); --bs-btn-border-color: transparent; --bs-btn-hover-color: var(--primary); --bs-btn-hover-bg: #d7e8f4; --bs-btn-hover-border-color: transparent; --bs-btn-active-bg: #c9e0f0; --bs-btn-active-color: var(--primary); }
.btn-danger { --bs-btn-color: var(--iep-rouge); --bs-btn-bg: var(--surface); --bs-btn-border-color: #f2c3c6; --bs-btn-hover-color: #b70d14; --bs-btn-hover-bg: var(--danger-soft); --bs-btn-hover-border-color: #eaa7ab; --bs-btn-active-color: #b70d14; --bs-btn-active-bg: #f9d7d9; --bs-btn-active-border-color: #eaa7ab; }
.btn-success { --bs-btn-bg: var(--iep-vert); --bs-btn-border-color: var(--iep-vert); --bs-btn-hover-bg: #006c3c; --bs-btn-hover-border-color: #006c3c; }
.btn-warning { --bs-btn-color: #6b3b00; --bs-btn-bg: var(--warning-soft); --bs-btn-border-color: #f6d3a6; --bs-btn-hover-color: #6b3b00; --bs-btn-hover-bg: #fde3c2; --bs-btn-hover-border-color: #f0bf80; }
.btn-info { --bs-btn-color: #006f70; --bs-btn-bg: var(--info-soft); --bs-btn-border-color: transparent; --bs-btn-hover-color: #006f70; --bs-btn-hover-bg: #c9eaea; --bs-btn-hover-border-color: transparent; }
.btn-link { --bs-btn-color: var(--iep-bleu); --bs-btn-hover-color: var(--primary-hover); }
.btn:focus-visible, .btn-check:focus-visible + .btn { box-shadow: 0 0 0 3px var(--primary-ring); }
.btn-group > .btn { flex: 0 1 auto; }
.btn-toolbar { gap: 8px; }

/* ---------- Formulaires ---------- */
.form-control, .form-select, input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="tel"], input[type="url"], input[type="date"], input[type="datetime-local"], input[type="search"], textarea, select {
  font-family: var(--font-ui); font-size: .875rem; color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius); background-color: var(--surface);
  min-height: 38px; padding: .45rem .75rem; max-width: 100%;
  transition: border-color var(--ease), box-shadow var(--ease);
}
select[multiple], textarea { min-height: 0; }
.form-control:hover, .form-select:hover, input[type="text"]:hover, textarea:hover, select:hover { border-color: #b9b3a7; }
.form-control:focus, .form-select:focus, input:focus, textarea:focus, select:focus { outline: 0; border-color: var(--iep-bleu); box-shadow: 0 0 0 3px var(--primary-ring); }
.form-control:disabled, .form-control[readonly], .form-select:disabled, input:disabled, textarea:disabled, select:disabled { background-color: var(--surface-2); color: var(--text-muted); }
input[type="checkbox"], input[type="radio"] { width: 1.05em; height: 1.05em; accent-color: var(--iep-bleu); vertical-align: -.15em; margin: 0 .35em 0 0; min-height: 0; }
input[type="file"] { min-height: 0; border: 0; padding: 0; }
textarea { width: 100%; }
label { font-weight: 600; font-size: .82rem; margin-bottom: .3rem; }
label.radio, label.checkbox { font-weight: 400; font-size: .875rem; display: inline-flex; align-items: center; margin-right: 14px; }
.required-notice { color: var(--iep-rouge); }
.help-block { display: block; font-size: .78rem; color: var(--text-muted); margin-top: .3rem; }
.field-error { list-style: none; padding: 0; margin: .3rem 0 0; color: var(--iep-rouge); font-size: .8rem; }
fieldset { min-width: 0; }

/* Formulaire « horizontal » Bootstrap 2 conservé : libellé à gauche, champ à droite */
.control-group { margin-bottom: 14px; }
.form-horizontal .control-group { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr); column-gap: 18px; align-items: start; }
.form-horizontal .control-label { padding-top: .55rem; margin: 0; text-align: right; }
.form-horizontal .controls { min-width: 0; }
.form-horizontal .controls > .form-control, .form-horizontal .controls > .form-select, .form-horizontal .controls > input[type="text"], .form-horizontal .controls > input[type="email"], .form-horizontal .controls > input[type="password"], .form-horizontal .controls > select:not([multiple]) { width: 100%; max-width: 520px; }
.form-horizontal .controls > textarea { max-width: 100%; }
.form-horizontal .controls > select[multiple] { width: 100%; max-width: 520px; }
.form-horizontal .control-group > .controls:only-child { grid-column: 2; }
.control-group.error .form-control, .control-group.error input, .control-group.error select, .control-group.error textarea { border-color: var(--iep-rouge); }
.control-group.error .control-label { color: var(--iep-rouge); }
.input-append, .input-prepend { display: inline-flex; align-items: stretch; max-width: 100%; }
.input-append .add-on, .input-prepend .add-on { display: inline-flex; align-items: center; padding: 0 .7rem; background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text-muted); font-size: .82rem; }
.input-append > :first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-append .add-on:last-child { border-left: 0; border-radius: 0 var(--radius) var(--radius) 0; }
.input-prepend .add-on:first-child { border-right: 0; border-radius: var(--radius) 0 0 var(--radius); }
.input-prepend > :last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 16px; margin-top: 8px; border-top: 1px solid var(--border); }

/* Moteur de recherche des listings */
.form-filter .control-group { grid-template-columns: minmax(110px, 160px) minmax(0, 1fr); margin-bottom: 10px; }
.form-filter hr { margin: 8px 0 12px; }
.form-filter .btn-group { gap: 8px; }
.form-filter .btn-group > .btn { border-radius: var(--radius) !important; }
.discreet { color: var(--text-muted); font-size: .8rem; }

/* ---------- Éditeur HTML (js/iep-html-editor.js) ---------- */
.he-original { display: none !important; }
.html-editor { border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); transition: border-color var(--ease), box-shadow var(--ease); max-width: 100%; }
.html-editor:focus-within { border-color: var(--iep-bleu); box-shadow: 0 0 0 3px var(--primary-ring); }
.he-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid var(--border); background: #fbfaf8; border-radius: var(--radius) var(--radius) 0 0; position: sticky; top: var(--topbar-h); z-index: 3; }
.he-format { min-height: 30px; height: 30px; padding: 0 28px 0 8px; font-size: .8rem; width: auto; border-radius: var(--radius-sm); background-position: right 8px center; }
.he-btn { display: inline-flex; align-items: center; gap: 4px; height: 30px; min-width: 30px; padding: 0 7px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text); font-size: .95rem; transition: background var(--ease), color var(--ease); }
.he-btn:hover { background: var(--surface-2); }
.he-btn:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--primary-ring); }
.he-btn[aria-pressed="true"], .he-btn.active { background: var(--primary-soft); color: var(--iep-bleu); }
.he-btn-label span { font-size: .72rem; font-weight: 700; letter-spacing: .04em; }
.he-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.he-spacer { flex: 1; }
.he-body { display: grid; grid-template-columns: minmax(0, 1fr); }
.html-editor.he-with-source .he-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.he-visual { min-height: 220px; max-height: 560px; overflow-y: auto; padding: 16px 18px; outline: 0; font-family: var(--font-ui); font-size: .9rem; line-height: 1.6; color: var(--text); }
.he-visual > :first-child { margin-top: 0; }
.he-visual h2, .he-visual h3, .he-visual h4 { font-family: var(--font-ui); font-weight: 700; color: var(--iep-anthracite); margin: 1em 0 .4em; }
.he-visual h2 { font-size: 1.35rem; }
.he-visual h3 { font-size: 1.15rem; }
.he-visual h4 { font-size: 1rem; }
.he-visual p { margin: 0 0 .7em; }
.he-visual ul, .he-visual ol { margin: 0 0 .8em; padding-left: 1.4em; }
.he-visual blockquote { margin: 0 0 .8em; padding: .4em 1em; border-left: 3px solid var(--border-strong); color: var(--text-muted); }
.he-visual a { color: var(--iep-bleu); text-decoration: underline; }
.he-visual:empty::before { content: "Saisissez le texte de présentation…"; color: var(--text-muted); }
.he-source { display: flex; flex-direction: column; border-left: 1px solid var(--border); background: #2b2d31; min-width: 0; }
.he-source[hidden] { display: none; }
.he-source-head { display: flex; justify-content: space-between; gap: 8px; padding: 6px 12px; font-size: .72rem; color: #c9ccd1; border-bottom: 1px solid #3a3d42; }
.he-source-head .he-sync { color: #8fd3b6; }
.he-code { flex: 1; width: 100%; min-height: 220px; max-height: 560px; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; resize: vertical; background: transparent !important; color: #e6e6e6 !important; font: 12.5px/1.6 "Cascadia Code", Consolas, "SFMono-Regular", monospace; padding: 12px 14px; white-space: pre-wrap; tab-size: 2; }
.he-status { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 6px 12px; border-top: 1px solid var(--border); font-size: .72rem; color: var(--text-muted); background: #fbfaf8; border-radius: 0 0 var(--radius) var(--radius); }
.he-status .bi-shield-check { color: var(--iep-vert); }
.he-notice { display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px; font-size: .8rem; background: var(--info-soft); color: #005f60; border-bottom: 1px solid #c4e6e6; }
.he-linkbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--primary-soft); }
.he-linkbar[hidden] { display: none; }
.he-linkbar .he-link-input { flex: 1; min-width: 200px; min-height: 32px; height: 32px; }
.he-link-error { color: var(--iep-rouge); font-size: .78rem; }
.form-horizontal .controls > .html-editor { max-width: 100%; }
@media (max-width: 1199.98px) {
  .html-editor.he-with-source .he-body { grid-template-columns: minmax(0, 1fr); }
  .he-source { border-left: 0; border-top: 1px solid var(--border); }
}

/* Aperçu de la signature (écran campagne) : reproduit le bloc des PDF */
.signature-preview { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-2); overflow: hidden; }
.signature-preview-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; font-size: .78rem; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.signature-preview-paper { background: #fff; margin: 14px; padding: 22px 18px; box-shadow: var(--shadow-sm); display: flex; justify-content: flex-end; min-height: 200px; }
.signature-preview-block { width: 60%; min-width: 200px; text-align: center; font-family: "DejaVu Sans", Arial, sans-serif; font-size: .82rem; color: #000; line-height: 1.5; }
.signature-preview-block .sig-image { display: block; width: 140px; max-width: 100%; margin: 8px auto 0; }
.signature-preview-block .sig-missing { height: 70px; border: 1px dashed var(--border-strong); color: var(--text-muted); display: grid; place-items: center; font-size: .75rem; }

/* Parcours candidat en miniatures (fiche modalité) : deux colonnes, lecture de gauche à droite puis ligne suivante */
.parcours { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 56px; row-gap: 44px; counter-reset: parcours; }
.parcours-step { position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.parcours-title { display: flex; align-items: center; gap: 10px; }
.parcours-title strong { display: block; font-size: .9rem; }
.parcours-title small { display: block; color: var(--text-muted); font-size: .75rem; }
.parcours-num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--iep-bleu); font-weight: 700; font-size: .8rem; }
.parcours-shot { position: relative; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: var(--shadow-sm); aspect-ratio: 960 / 700; }
.parcours-shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.parcours-box { position: absolute; border: 2px solid var(--iep-bleu); border-radius: 4px; background: rgba(230, 241, 248, .96); color: #1d4f6e; font-size: clamp(.55rem, .9vw, .72rem); line-height: 1.3; padding: 3px 6px; overflow: hidden; box-shadow: 0 0 0 3px rgba(0, 114, 188, .18); transition: box-shadow var(--ease), background var(--ease); white-space: pre-line; }
.parcours-box.is-empty { border-style: dashed; color: var(--text-muted); font-style: italic; background: rgba(255, 255, 255, .9); }
.parcours-box.is-focus { box-shadow: 0 0 0 5px rgba(0, 114, 188, .35); }
.parcours-step:not(.has-field) .parcours-shot { opacity: .92; }
.parcours-field .control-group { display: block; margin: 0; }
.parcours-field .control-label { text-align: left; padding: 0 0 .3rem; }
.parcours-field textarea { min-height: 70px; }
/* Flèches : vers la droite entre les deux colonnes, puis retour à la ligne vers la miniature suivante */
.parcours-arrow { position: absolute; pointer-events: none; color: var(--iep-bleu); }
.parcours-step:nth-child(odd) > .parcours-arrow { right: -46px; top: 50%; width: 36px; height: 2px; background: currentColor; }
.parcours-step:nth-child(odd) > .parcours-arrow::after { content: ""; position: absolute; right: -2px; top: -5px; border: 6px solid transparent; border-left: 9px solid currentColor; border-right: 0; }
.parcours-step:nth-child(even) > .parcours-arrow { top: 100%; right: 50%; width: calc(100% + 56px); height: 22px; border: 2px solid currentColor; border-top: 0; border-left: 0; border-radius: 0 0 12px 0; }
.parcours-step:nth-child(even) > .parcours-arrow::before { content: ""; position: absolute; left: -2px; top: 100%; width: 2px; height: 12px; background: currentColor; }
.parcours-step:nth-child(even) > .parcours-arrow::after { content: ""; position: absolute; left: -7px; top: calc(100% + 10px); border: 6px solid transparent; border-top: 9px solid currentColor; border-bottom: 0; }
@media (max-width: 991.98px) {
  .parcours { grid-template-columns: minmax(0, 1fr); row-gap: 48px; }
  .parcours-step > .parcours-arrow, .parcours-step:nth-child(odd) > .parcours-arrow, .parcours-step:nth-child(even) > .parcours-arrow { left: 50%; right: auto; top: auto; bottom: -38px; width: 2px; height: 26px; background: currentColor; border: 0; border-radius: 0; transform: none; }
  .parcours-step > .parcours-arrow::before { display: none; }
  .parcours-step > .parcours-arrow::after, .parcours-step:nth-child(odd) > .parcours-arrow::after, .parcours-step:nth-child(even) > .parcours-arrow::after { left: -5px; right: auto; top: auto; bottom: -8px; border: 6px solid transparent; border-top: 9px solid currentColor; border-bottom: 0; }
}

/* Chosen (listes enrichies) */
.chosen-container { font-size: .875rem; width: 100% !important; max-width: 100%; }
.form-horizontal .controls > .chosen-container { max-width: 520px; }
.chosen-container-single .chosen-single, .chosen-container-multi .chosen-choices { border: 1px solid var(--border-strong) !important; border-radius: var(--radius) !important; background: var(--surface) !important; box-shadow: none !important; min-height: 38px; }
.chosen-container-single .chosen-single { height: 38px; line-height: 36px; padding-left: 12px; color: var(--text); }
.chosen-container-single .chosen-single div b { background-position-y: 10px; }
.chosen-container-active .chosen-single, .chosen-container-active .chosen-choices { border-color: var(--iep-bleu) !important; box-shadow: 0 0 0 3px var(--primary-ring) !important; }
.chosen-container .chosen-drop { border-color: var(--border-strong); border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow); }
.chosen-container .chosen-results li.highlighted { background: var(--iep-bleu); background-image: none; }
.chosen-container-multi .chosen-choices li.search-choice { background: var(--primary-soft); border: 0; border-radius: 999px; box-shadow: none; color: var(--primary); padding: 4px 22px 4px 10px; }
.chosen-container-multi .chosen-choices li.search-field input[type="text"] { min-height: 0; border: 0; box-shadow: none; padding: 4px 6px; height: 30px; }

/* ---------- Tableaux ---------- */
.table { --bs-table-bg: transparent; --bs-table-striped-bg: #fbfaf8; --bs-table-hover-bg: #f6f4f0; --bs-table-border-color: #efece6; margin-bottom: 0; vertical-align: middle; }
.table > :not(caption) > * > * { padding: .65rem .8rem; }
.table thead th, .table > thead > tr > th { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); background: #fbfaf8; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table thead th a { color: var(--text-muted); }
.table thead th a:hover { color: var(--iep-bleu); text-decoration: none; }
.table-sm > :not(caption) > * > * { padding: .45rem .65rem; }
.table-responsive, .table-wrap { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow-x: auto; margin-bottom: 16px; }
.table-wrap > .table > :last-child > tr:last-child > * { border-bottom: 0; }

/* ---------- Badges / étiquettes ---------- */
.badge-status { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: .74rem; font-weight: 600; white-space: nowrap; background: #eeece7; color: #5c6065; }
.badge-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-status.st-initial { background: #eeece7; color: #5c6065; }
.badge-status.st-admis { background: var(--success-soft); color: var(--iep-vert); }
.badge-status.st-attente { background: var(--warning-soft); color: #b36200; }
.badge-status.st-nonadmis { background: #f6e6ec; color: var(--iep-framboise); }
.badge-status.st-annule { background: #e9e9ea; color: var(--iep-anthracite); }
.badge-status.pay-solde { background: var(--info-soft); color: #007a7b; }
.badge-status.pay-encours { background: var(--primary-soft); color: var(--iep-bleu); }
.badge-status.pay-attente { background: var(--warning-soft); color: #b36200; }
.badge-status.pay-defaut { background: var(--danger-soft); color: #b70d14; }
.label, .badge { font-weight: 600; border-radius: 999px; }
.label { display: inline-block; padding: .2em .6em; font-size: .74rem; background: #eeece7; color: #5c6065; }
.label-success, .badge-success { background: var(--success-soft); color: var(--iep-vert); }
.label-important, .label-danger, .badge-important { background: var(--danger-soft); color: #b70d14; }
.label-warning, .badge-warning { background: var(--warning-soft); color: #b36200; }
.label-info, .badge-info { background: var(--info-soft); color: #007a7b; }

/* ---------- Alertes ---------- */
.alert { position: relative; display: block; overflow-wrap: anywhere; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); padding: 12px 40px 12px 18px; overflow: hidden; }
.alert::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--iep-jaune); }
.alert-success::before { background: var(--iep-vert); }
.alert-danger::before { background: var(--iep-rouge); }
.alert ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.alert-info::before { background: var(--iep-canard); }
.alert-warning::before { background: var(--iep-jaune); }
.alert .btn-close { position: absolute; top: 10px; right: 10px; padding: .4rem; font-size: .7rem; }
.flash-zone { margin-bottom: 18px; }

/* ---------- Menus déroulants ---------- */
.dropdown-menu { --bs-dropdown-border-color: var(--border); --bs-dropdown-border-radius: var(--radius); --bs-dropdown-box-shadow: var(--shadow); --bs-dropdown-link-active-bg: var(--iep-bleu); --bs-dropdown-font-size: .85rem; box-shadow: var(--shadow); padding: 6px; }
.dropdown-menu > li > a, .dropdown-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: var(--radius-sm); color: var(--text); white-space: nowrap; }
.dropdown-menu > li > a:hover, .dropdown-item:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.caret { display: inline-block; width: 0; height: 0; margin-left: 2px; vertical-align: middle; border-top: 4px solid; border-right: 4px solid transparent; border-left: 4px solid transparent; }
.dropup .caret { border-top: 0; border-bottom: 4px solid; }

/* ---------- Pagination ---------- */
.pagination { --bs-pagination-color: var(--text); --bs-pagination-bg: transparent; --bs-pagination-border-width: 0; --bs-pagination-hover-bg: var(--surface-2); --bs-pagination-hover-color: var(--text); --bs-pagination-active-bg: var(--iep-bleu); --bs-pagination-active-color: #fff; --bs-pagination-disabled-bg: transparent; --bs-pagination-border-radius: var(--radius-sm); --bs-pagination-focus-box-shadow: 0 0 0 3px var(--primary-ring); gap: 4px; margin: 16px 0 0; }
.pagination .page-link { min-width: 32px; text-align: center; border-radius: var(--radius-sm) !important; }

/* ---------- Modales ---------- */
.modal { --bs-modal-border-radius: var(--radius-lg); --bs-modal-border-color: var(--border); --bs-modal-box-shadow: var(--shadow-lg); --bs-modal-header-border-color: var(--border); --bs-modal-footer-border-color: var(--border); }
.modal-header h3, .modal-header h4, .modal-title { font-family: var(--font-title); font-size: 1.1rem; margin: 0; }
.modal-header .close, .modal-header .btn-close { margin-left: auto; }
.modal-backdrop { --bs-backdrop-bg: #2f3235; --bs-backdrop-opacity: .35; }

/* ---------- Compatibilité Bootstrap 2 (classes conservées) ---------- */
/* Site candidat : .hidden sans !important, car front.js affiche ces blocs avec jQuery .show() */
.hide, .hidden { display: none; }
.close { background: transparent; border: 0; font-size: 1.3rem; line-height: 1; color: var(--text-muted); opacity: .8; padding: 0 4px; text-decoration: none; }
.close:hover { color: var(--text); opacity: 1; text-decoration: none; }
.alert > .close { position: absolute; top: 9px; right: 12px; }
.nav-list { list-style: none; padding-left: 0; }
.nav-header { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); padding: 6px 0; }
.clearfix::after { content: ""; display: table; clear: both; }
.pull-right { float: right; }
.pull-left { float: left; }
.invisible-link, .invisible-link:hover { color: inherit; text-decoration: none; }

/* Écran de connexion */
.login-wrap { min-height: calc(100vh - var(--topbar-h)); display: grid; place-items: center; padding: 32px 16px; }
.login-card { width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 28px; }
.login-card h1 { font-size: 1.35rem; margin-bottom: 6px; }
.login-card p { color: var(--text-muted); }
.login-card .control-group { display: block; }
.login-card .control-label { text-align: left; padding-top: 0; }
.login-card .controls > input { width: 100%; max-width: none; }
.login-alt { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border-strong); font-size: .8rem; color: var(--text-muted); }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .app-burger { display: inline-flex; }
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .app-sidebar { position: fixed; z-index: 1040; top: var(--topbar-h); left: 0; bottom: 0; width: var(--sidebar-w); height: auto; transform: translateX(-100%); transition: transform var(--ease); box-shadow: var(--shadow-lg); }
  body.menu-open .app-sidebar { transform: none; }
  .app-main { padding: 18px 16px 40px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-brand .logo-spb, .app-brand .sep, .app-title { display: none; }
  .form-horizontal .control-group { grid-template-columns: minmax(0, 1fr); }
  .form-horizontal .control-label { text-align: left; padding-top: 0; }
  .form-horizontal .control-group > .controls:only-child { grid-column: 1; }
}
@media print {
  .app-topbar, .app-sidebar { display: none !important; }
  .app-shell { display: block; }
}

/* =============================================================================
   Messages : convention de couleurs (recette du 08/11/2026)
   vert = confirmation · bleu = information · orange = avertissement non bloquant · rouge = message bloquant
   Fond pastel, liseré gauche et texte foncé de la même teinte.
   ========================================================================== */
:root {
  --msg-ok-bg: #e5f3ec;    --msg-ok-border: #b9dfc9;    --msg-ok-text: #0b5a35;    --msg-ok-bar: var(--iep-vert);
  --msg-info-bg: #e6f1f8;  --msg-info-border: #bcd8ec;  --msg-info-text: #0b4f7c;  --msg-info-bar: var(--iep-bleu);
  --msg-warn-bg: #fef1e1;  --msg-warn-border: #f6d3a6;  --msg-warn-text: #7a4300;  --msg-warn-bar: var(--iep-orange);
  --msg-error-bg: #fce8e9; --msg-error-border: #f2c3c6; --msg-error-text: #9e0c12; --msg-error-bar: var(--iep-rouge);
}
.alert, .alert-warning { background: var(--msg-warn-bg); border-color: var(--msg-warn-border); color: var(--msg-warn-text); box-shadow: none; }
.alert::before, .alert-warning::before { background: var(--msg-warn-bar); }
.alert-success { background: var(--msg-ok-bg); border-color: var(--msg-ok-border); color: var(--msg-ok-text); }
.alert-success::before { background: var(--msg-ok-bar); }
.alert-info { background: var(--msg-info-bg); border-color: var(--msg-info-border); color: var(--msg-info-text); }
.alert-info::before { background: var(--msg-info-bar); }
.alert-danger { background: var(--msg-error-bg); border-color: var(--msg-error-border); color: var(--msg-error-text); }
.alert-danger::before { background: var(--msg-error-bar); }
.alert a { color: inherit; text-decoration: underline; font-weight: 600; }
.he-notice { background: var(--msg-info-bg); color: var(--msg-info-text); border-bottom-color: var(--msg-info-border); }
.field-error { color: var(--msg-error-text); }
