/* ══════════════════════════════════════════════
   OSCAR FRANCE · Site associatif et institutionnel
   Dark Tactical Theme · v1.2 · Argenté Tactique
   Fonts: Rajdhani (display) · Barlow (corps)
   Note : palette dorée réservée à formation.oscar-france.org.
          Exception : les boutons d'accès Espace Membres
          conservent un dégradé bleu institutionnel (cf. infra).
══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@300;400;500;600;700&family=Barlow:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Barlow+Condensed:wght@300;400;500;600;700&display=swap');

/* ══ VARIABLES ══ */
:root {
  /* Fonds */
  --bg:       #060810;
  --bg2:      #0b0f1a;
  --surface:  #111825;
  --surface2: #17202e;
  --surface3: #1c2838;

  /* Textes — contrastes maîtrisés */
  --text:     #eae6dc;
  --text2:    #c0bbb0;
  --muted:    #8a909f;
  --muted2:   #545d72;

  /* Bordures · teinte Argenté tactique */
  --border:   rgba(184,196,211,.10);
  --border2:  rgba(184,196,211,.22);
  --border3:  rgba(184,196,211,.38);

  /* Accent Argenté tactique (Thème asso.oscar-france.org) */
  --a1: #1a1f28;
  --a2: #4f5b6e;
  --a3: #b8c4d3;
  --a4: #d6dee8;
  --a5: #ecf0f5;

  /* Bleu institutionnel · réservé aux CTA Espace Membres */
  --membre-1: #002395;
  --membre-2: #3a6dd6;
  --membre-3: #6a93e8;

  /* France */
  --fr-blue: #002395;
  --fr-white:#f5f5f0;
  --fr-red:  #ED2939;

  /* États */
  --success: #2d6a4f;
  --success-light: #52b788;
  --warning: #b5850b;
  --warning-light: #f4a261;
  --danger:  #9b2226;
  --danger-light: #e63946;

  /* Typos */
  --font-display: 'Rajdhani', 'Barlow Condensed', sans-serif;
  --font-sans:    'Barlow', system-ui, sans-serif;
  --font-mono:    'Courier New', monospace;

  /* Espacements */
  --radius:  10px;
  --radius2: 6px;
  --shadow:  0 8px 32px rgba(0,0,0,.5);
  --shadow2: 0 4px 16px rgba(0,0,0,.35);

  /* Sidebar */
  --sidebar-w: 250px;
}

/* ══ RESET ══ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--a3); text-decoration: none; }
a:hover { color: var(--a4); }

img { max-width: 100%; }

input, textarea, select, button {
  font-family: var(--font-sans);
  font-size: inherit;
}

/* ══ SCROLLBAR ══ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--a2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--a3); }

/* ══ UTILITAIRES ══ */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.text-accent  { color: var(--a3); }
.text-muted   { color: var(--muted); }
.text-success { color: var(--success-light); }
.text-danger  { color: var(--danger-light); }
.text-warning { color: var(--warning-light); }

/* ══════════════════════════════════════════════
   PAGE LOGIN — index.php
══════════════════════════════════════════════ */

.login-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 42% 58%;
}

/* Panneau gauche décoratif */
.login-left {
  background: var(--bg2);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
  overflow: hidden;
  border-right: 1px solid var(--border2);
}

.login-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 40%, rgba(184,196,211,.07) 0%, transparent 70%),
    linear-gradient(180deg, rgba(0,35,149,.04) 0%, transparent 50%, rgba(237,41,57,.04) 100%);
  pointer-events: none;
}

/* Grille tactique */
.login-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(184,196,211,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(184,196,211,.04) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* Cercles animés type réticule */
.login-reticle {
  position: absolute;
  width: 360px;
  height: 360px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.login-reticle .ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--a3);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

.login-reticle .ring:nth-child(1) {
  width: 320px; height: 320px;
  opacity: .12;
  animation: rotateRing 30s linear infinite;
}
.login-reticle .ring:nth-child(2) {
  width: 240px; height: 240px;
  opacity: .18;
  border-style: dashed;
  animation: rotateRing 20s linear infinite reverse;
}
.login-reticle .ring:nth-child(3) {
  width: 160px; height: 160px;
  opacity: .12;
  animation: rotateRing 15s linear infinite;
}

.login-reticle .crosshair {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.login-reticle .crosshair::before,
.login-reticle .crosshair::after {
  content: '';
  position: absolute;
  background: var(--a3);
  opacity: .25;
}
.login-reticle .crosshair::before {
  width: 360px; height: 1px;
  top: 0; left: 50%;
  transform: translateX(-50%);
}
.login-reticle .crosshair::after {
  height: 360px; width: 1px;
  left: 0; top: 50%;
  transform: translateY(-50%);
}

@keyframes rotateRing {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

.login-left-content {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.login-logo {
  width: 160px;
  height: 160px;
  object-fit: contain;
  filter: drop-shadow(0 0 30px rgba(184,196,211,.25));
  transition: filter .3s;
}
.login-logo:hover {
  filter: drop-shadow(0 0 45px rgba(184,196,211,.4));
}

.login-brand {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.login-brand-name {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: .25em;
  color: var(--a4);
  text-transform: uppercase;
  line-height: 1;
}
.login-brand-sub {
  font-family: var(--font-display);
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .35em;
  color: var(--muted);
  text-transform: uppercase;
}

.login-separator {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--a3), transparent);
}

.login-stars {
  display: flex;
  gap: .6rem;
  align-items: center;
}
.login-star {
  width: 12px;
  height: 12px;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.login-star.blue  { background: var(--fr-blue); }
.login-star.white { background: var(--fr-white); }
.login-star.red   { background: var(--fr-red); }

.login-quote {
  max-width: 280px;
  font-style: italic;
  font-size: .875rem;
  color: var(--muted);
  line-height: 1.8;
  border-left: 2px solid var(--a3);
  padding-left: 1rem;
  text-align: left;
}

.login-zones {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  justify-content: center;
  margin-top: .5rem;
}
.login-zone-badge {
  font-family: var(--font-display);
  font-size: .65rem;
  letter-spacing: .1em;
  font-weight: 600;
  padding: .2rem .6rem;
  border: 1px solid var(--border2);
  color: var(--muted);
  text-transform: uppercase;
  border-radius: 2px;
}

/* Panneau droit — formulaire */
.login-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  background: var(--bg);
}

.login-form-wrap {
  width: 100%;
  max-width: 400px;
}

.login-form-header {
  margin-bottom: 2.5rem;
}
.login-form-header h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: .4rem;
}
.login-form-header p {
  color: var(--muted);
  font-size: .875rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-family: var(--font-display);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--text2);
  margin-bottom: .5rem;
}

.form-input {
  width: 100%;
  padding: .75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius2);
  color: var(--text);
  font-size: .925rem;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.form-input::placeholder { color: var(--muted2); }
.form-input:focus {
  border-color: var(--a3);
  box-shadow: 0 0 0 3px rgba(184,196,211,.12);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1.5rem;
  border: none;
  border-radius: var(--radius2);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .875rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--a2), var(--a3));
  color: var(--bg);
  padding: .875rem;
  font-size: .95rem;
}
/* Le bouton primary prend toute la largeur dans les formulaires standalone (login, modals)
   mais reste à sa taille naturelle dans les flex-rows comme section-header */
form > .btn-primary:only-child,
.login-form-wrap .btn-primary,
.modal .btn-primary[type="submit"]:only-child {
  width: 100%;
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--a3), var(--a4));
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(184,196,211,.25);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--surface2);
  color: var(--text2);
  border: 1px solid var(--border2);
}
.btn-secondary:hover {
  background: var(--surface3);
  color: var(--text);
  border-color: var(--border3);
}

.btn-danger {
  background: rgba(155,34,38,.15);
  color: var(--danger-light);
  border: 1px solid rgba(155,34,38,.3);
}
.btn-danger:hover { background: rgba(155,34,38,.25); }

.btn-sm { padding: .4rem .85rem; font-size: .75rem; }
.btn-icon { padding: .5rem; border-radius: var(--radius2); }

.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius2);
  font-size: .875rem;
  margin-bottom: 1rem;
  border-left: 3px solid;
  animation: fadeInDown .25s ease;
}
.alert-error {
  background: rgba(155,34,38,.12);
  border-color: var(--danger-light);
  color: var(--danger-light);
}
.alert-success {
  background: rgba(45,106,79,.12);
  border-color: var(--success-light);
  color: var(--success-light);
}
.alert-info {
  background: rgba(184,196,211,.08);
  border-color: var(--a3);
  color: var(--a4);
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-footer {
  margin-top: 2rem;
  text-align: center;
  font-size: .75rem;
  color: var(--muted2);
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}

/* ══════════════════════════════════════════════
   LAYOUT APPLICATION — app.php & admin.php
══════════════════════════════════════════════ */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ══ SIDEBAR ══ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-header {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: .85rem;
}

.sidebar-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-brand {
  flex: 1;
  min-width: 0;
}
.sidebar-brand-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--a5);
  line-height: 1.1;
}
.sidebar-brand-tag {
  font-size: .65rem;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  font-family: var(--font-display);
}

.sidebar-user {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: .75rem;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--a2), var(--a3));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .85rem;
  color: var(--bg);
  flex-shrink: 0;
  letter-spacing: .03em;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: .7rem;
  color: var(--a3);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .15rem .5rem;
  border-radius: 2px;
  font-family: var(--font-display);
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.role-badge.admin {
  background: rgba(237,41,57,.15);
  color: var(--fr-red);
  border: 1px solid rgba(237,41,57,.3);
}
.role-badge.participant {
  background: rgba(184,196,211,.1);
  color: var(--a3);
  border: 1px solid var(--border2);
}
.role-badge.consultant {
  background: rgba(45,106,79,.12);
  color: var(--success-light);
  border: 1px solid rgba(45,106,79,.3);
}

.sidebar-nav {
  flex: 1;
  padding: .75rem 0;
}

.nav-section-label {
  font-family: var(--font-display);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  padding: .75rem 1.25rem .35rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1.25rem;
  color: var(--text2);
  cursor: pointer;
  transition: all .18s;
  position: relative;
  font-size: .875rem;
  font-weight: 400;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.nav-item:hover {
  color: var(--text);
  background: rgba(184,196,211,.05);
}
.nav-item.active {
  color: var(--a4);
  background: rgba(184,196,211,.08);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--a3);
  border-radius: 0 2px 2px 0;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: .7;
}
.nav-item.active .nav-icon,
.nav-item:hover .nav-icon { opacity: 1; }

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

/* ══ MAIN CONTENT ══ */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: 60px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text);
  flex: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.topbar-zone {
  font-family: var(--font-display);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--muted);
  padding: .25rem .6rem;
  border: 1px solid var(--border);
  border-radius: 2px;
}

/* ══ PAGES ══ */
.content {
  padding: 2rem;
  flex: 1;
}

.page { display: none; animation: fadeInPage .3s ease; }
.page.active { display: block; }

@keyframes fadeInPage {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══ SECTION HEADER ══ */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1rem;
}
.section-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  line-height: 1.1;
  color: var(--text);
}
.section-title span {
  display: block;
  font-size: .75rem;
  font-weight: 400;
  letter-spacing: .2em;
  color: var(--a3);
  margin-bottom: .2rem;
}
.section-sub {
  font-size: .875rem;
  color: var(--muted);
  margin-top: .35rem;
  font-weight: 400;
}

/* ══ CARDS ══ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color .2s;
}
.card:hover { border-color: var(--border2); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text);
}

/* ══ DASHBOARD ══ */
.dashboard-welcome {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface2) 100%);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  position: relative;
  overflow: hidden;
}

.dashboard-welcome::before {
  content: '';
  position: absolute;
  right: -40px; top: -40px;
  width: 200px; height: 200px;
  border-radius: 50%;
  border: 1px solid rgba(184,196,211,.08);
  pointer-events: none;
}
.dashboard-welcome::after {
  content: '';
  position: absolute;
  right: -10px; top: -10px;
  width: 140px; height: 140px;
  border-radius: 50%;
  border: 1px solid rgba(184,196,211,.12);
  pointer-events: none;
}

.welcome-text h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.welcome-text p { color: var(--text2); font-size: .875rem; margin-top: .3rem; }

/* Anneau progression */
.progress-ring-wrap {
  position: relative;
  width: 90px;
  height: 90px;
  flex-shrink: 0;
}
.progress-ring-wrap svg { transform: rotate(-90deg); }
.progress-ring-bg { fill: none; stroke: var(--surface3); stroke-width: 6; }
.progress-ring-fill {
  fill: none;
  stroke: var(--a3);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset .8s ease;
}
.progress-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--a4);
  line-height: 1;
}
.progress-ring-text small {
  font-size: .55rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* KPIs */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  transition: border-color .2s, transform .2s;
}
.kpi-card:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
}
.kpi-label {
  font-family: var(--font-display);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--text2);
}
.kpi-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--a4);
  line-height: 1;
}
.kpi-value.small { font-size: 1.4rem; }
.kpi-sub { font-size: .75rem; color: var(--muted); }

/* Grid 2 cols */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

/* ══ MODULES / CONTENTS ══ */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.module-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  cursor: pointer;
  transition: all .22s;
  position: relative;
  overflow: hidden;
}
.module-card:hover:not(.locked) {
  border-color: var(--border3);
  transform: translateY(-2px);
  box-shadow: var(--shadow2);
}
.module-card.completed { border-color: rgba(45,106,79,.35); }
.module-card.in-progress { border-color: var(--border3); }
.module-card.locked { opacity: .45; cursor: not-allowed; }

.module-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .75rem;
}
.module-num {
  font-family: var(--font-display);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .2em;
  color: var(--muted);
  text-transform: uppercase;
}
.module-status-badge {
  padding: .2rem .55rem;
  border-radius: 2px;
  font-family: var(--font-display);
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.badge-completed {
  background: rgba(45,106,79,.15);
  color: var(--success-light);
  border: 1px solid rgba(45,106,79,.3);
}
.badge-active {
  background: rgba(184,196,211,.12);
  color: var(--a3);
  border: 1px solid var(--border2);
}
.badge-locked {
  background: rgba(61,69,88,.3);
  color: var(--muted);
  border: 1px solid var(--border);
}
.badge-tag {
  background: var(--surface2);
  color: var(--text2);
  border: 1px solid var(--border);
}

.module-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .03em;
  margin-bottom: .4rem;
  color: var(--text);
}
.module-desc { font-size: .825rem; color: var(--text2); line-height: 1.6; }
.module-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: .85rem;
  font-size: .75rem;
  color: var(--text2);
}
.module-meta span { display: flex; align-items: center; gap: .3rem; }

/* ══ CHAPITRES ══ */
.chapters-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.chapters-toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  position: sticky;
  top: 80px;
}
.chapters-toc-title {
  font-family: var(--font-display);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: .75rem;
}
.toc-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .6rem;
  border-radius: var(--radius2);
  cursor: pointer;
  transition: all .18s;
  font-size: .825rem;
  color: var(--muted);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.toc-item:hover { color: var(--text); background: rgba(184,196,211,.06); }
.toc-item.active { color: var(--a4); background: rgba(184,196,211,.1); }
.toc-num {
  font-family: var(--font-display);
  font-size: .7rem;
  font-weight: 700;
  color: var(--a3);
  width: 18px;
  flex-shrink: 0;
}

.chapter-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}
.chapter-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--a4);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: .75rem;
}
.chapter-num-badge {
  width: 36px;
  height: 36px;
  border: 2px solid var(--a3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: .9rem;
  font-weight: 700;
  color: var(--a3);
  flex-shrink: 0;
}

/* Contenu chapitre riche */
.chapter-body p { margin-bottom: 1rem; line-height: 1.8; }
.chapter-body strong { color: var(--text); font-weight: 600; }
.chapter-body ul { margin: .75rem 0 1rem 1.5rem; }
.chapter-body li { margin-bottom: .4rem; line-height: 1.7; }
.chapter-body h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text2);
  margin: 1.25rem 0 .5rem;
}
.chapter-body blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--a3);
  background: rgba(184,196,211,.05);
  border-radius: 0 var(--radius2) var(--radius2) 0;
  font-style: italic;
  color: var(--text2);
  font-size: .925rem;
  line-height: 1.8;
}

/* ══ PARCOURS TIMELINE ══ */
.timeline {
  position: relative;
  padding-left: 2rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: .6rem;
  top: .75rem;
  bottom: .75rem;
  width: 2px;
  background: linear-gradient(180deg, var(--a3), transparent);
}

.timeline-item {
  position: relative;
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}
.timeline-dot {
  position: absolute;
  left: -1.45rem;
  top: .85rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid;
  background: var(--bg2);
  transform: translateY(-50%);
}
.timeline-dot.done   { border-color: var(--success-light); background: var(--success-light); }
.timeline-dot.active { border-color: var(--a3); box-shadow: 0 0 10px rgba(184,196,211,.4); }
.timeline-dot.pending{ border-color: var(--muted2); }

.timeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.timeline-card.done   { border-color: rgba(45,106,79,.25); }
.timeline-card.active { border-color: var(--border2); }
.timeline-title {
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .04em;
  margin-bottom: .25rem;
}
.timeline-meta { font-size: .8rem; color: var(--text2); }

/* ══ NOTES ══ */
.notes-editor {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.notes-textarea {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius2);
  color: var(--text);
  padding: .75rem 1rem;
  font-size: .9rem;
  line-height: 1.65;
  resize: vertical;
  min-height: 100px;
  outline: none;
  transition: border-color .2s;
  font-family: var(--font-sans);
}
.notes-textarea:focus { border-color: var(--a3); }
.notes-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: .75rem;
}

.note-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: .75rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  transition: border-color .2s;
}
.note-item:hover { border-color: var(--border2); }
.note-date {
  font-family: var(--font-display);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--a3);
  white-space: nowrap;
  padding-top: .1rem;
  min-width: 90px;
}
.note-text { flex: 1; font-size: .875rem; line-height: 1.65; color: var(--text); }
.note-delete {
  background: none;
  border: none;
  color: var(--muted2);
  cursor: pointer;
  padding: .2rem;
  transition: color .2s;
  flex-shrink: 0;
}
.note-delete:hover { color: var(--danger-light); }

/* ══ ADMIN TABLE ══ */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
thead {
  background: var(--surface2);
  border-bottom: 1px solid var(--border2);
}
th {
  padding: .85rem 1rem;
  text-align: left;
  font-family: var(--font-display);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text2);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
th:hover { color: var(--text2); }
td {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(184,196,211,.025); }

.td-name { display: flex; align-items: center; gap: .65rem; }

/* Status dot */
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.active { background: var(--success-light); box-shadow: 0 0 6px var(--success-light); }
.status-dot.inactive { background: var(--muted2); }

/* ══ MODAL ══ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn .2s;
}
.modal-overlay.hidden { display: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp .25s ease;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: .25rem;
  transition: color .2s;
}
.modal-close:hover { color: var(--text); }

.modal-footer {
  display: flex;
  gap: .75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

/* ══ SEARCH ══ */
.search-bar {
  position: relative;
  margin-bottom: 1.25rem;
}
.search-input {
  width: 100%;
  padding: .65rem 1rem .65rem 2.5rem;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius2);
  color: var(--text);
  font-size: .875rem;
  outline: none;
  transition: border-color .2s;
}
.search-input:focus { border-color: var(--a3); }
.search-input::placeholder { color: var(--muted2); }
.search-icon {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  width: 16px;
  height: 16px;
}

/* ══ PROGRESS BAR ══ */
.progress-bar {
  height: 4px;
  background: var(--surface3);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--a2), var(--a3));
  border-radius: 2px;
  transition: width .6s ease;
}

/* ══ SPINNER ══ */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid var(--border2);
  border-top-color: var(--a3);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  padding: 3rem;
  color: var(--muted);
  font-size: .875rem;
}

/* ══ TOAST NOTIFICATIONS ══ */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.toast {
  padding: .75rem 1.25rem;
  border-radius: var(--radius2);
  font-size: .875rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  animation: slideInRight .25s ease;
  max-width: 320px;
  box-shadow: var(--shadow);
  border-left: 3px solid;
}
.toast-success {
  background: var(--surface2);
  border-color: var(--success-light);
  color: var(--success-light);
}
.toast-error {
  background: var(--surface2);
  border-color: var(--danger-light);
  color: var(--danger-light);
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ══ EMPTY STATES ══ */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--muted);
}
.empty-state-icon { font-size: 2.5rem; margin-bottom: 1rem; opacity: .4; }
.empty-state h3 {
  font-family: var(--font-display);
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text2);
  margin-bottom: .35rem;
}
.empty-state p { font-size: .825rem; }

/* ══ SELECT / CHECKBOX ══ */
.form-select {
  width: 100%;
  padding: .75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius2);
  color: var(--text);
  font-size: .925rem;
  outline: none;
  transition: border-color .2s;
  appearance: none;
  cursor: pointer;
}
.form-select:focus { border-color: var(--a3); }
.form-select option { background: var(--surface2); }

/* ══ ADMIN SPECIFIC ══ */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}

/* ══ RESPONSIVE ══ */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2   { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .login-layout { grid-template-columns: 1fr; }
  .login-left   { display: none; }

  :root { --sidebar-w: 0px; }
  .sidebar {
    transform: translateX(-250px);
    transition: transform .3s;
    width: 250px;
  }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }

  .chapters-layout { grid-template-columns: 1fr; }
  .chapters-toc    { position: static; }
}

@media (max-width: 600px) {
  .kpi-grid            { grid-template-columns: 1fr 1fr; }
  .module-grid         { grid-template-columns: 1fr; }
  .content             { padding: 1.25rem; }
  .dashboard-welcome   { flex-direction: column; text-align: center; }
}

/* ══ Anciens fixes mobile 768px supprimés
   Remplacés par la refonte mobile OSCAR 2026 en fin de fichier ══ */

@media (max-width: 480px) {
  .kpi-grid  { grid-template-columns: 1fr; }
  .kpi-value { font-size: 1.6rem; }

  .btn { font-size: .75rem; padding: .6rem 1rem; }
  .btn-sm { font-size: .65rem; padding: .35rem .6rem; }

  .hero-logo    { width: 80px; height: 80px; }
}

/* ════════════════════════════════════════════════
   ══  REFONTE MOBILE OSCAR 2026                ══
   ════════════════════════════════════════════════ */

/* ─── BOUTON MENU BURGER ─── */
.menu-toggle-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  margin-right: .25rem;
  padding: .5rem;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: 8px;
  cursor: pointer;
  transition: background .2s, border-color .2s;
  flex-shrink: 0;
}
.menu-toggle-btn:hover,
.menu-toggle-btn:focus-visible {
  background: rgba(184,196,211,.08);
  border-color: var(--text2, #b8c4d3);
  outline: none;
}
.menu-toggle-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}

/* ─── BACKDROP SIDEBAR ─── */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6,9,16,.65);
  backdrop-filter: blur(3px);
  z-index: 195;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.sidebar-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

/* ─── BODY LOCK QUAND SIDEBAR/MODAL OUVERT ─── */
body.no-scroll {
  overflow: hidden;
  touch-action: none;
}

/* ════════════════════════════════════════════════
   ══  TABLET ET MOBILE  (≤ 900px)              ══
   ════════════════════════════════════════════════ */
@media (max-width: 900px) {

  /* Bouton burger visible */
  .menu-toggle-btn { display: flex !important; }

  /* Sidebar : drawer plein hauteur, z-index élevé */
  .sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px !important;
    max-width: 85vw;
    height: 100vh;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.32,.72,0,1);
    box-shadow: none;
    overflow-y: auto;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 12px 0 40px rgba(0,0,0,.55);
  }

  /* Items de nav : zones tactiles plus grandes */
  .sidebar .nav-item {
    min-height: 48px;
    padding: .85rem 1rem;
    font-size: .95rem;
  }

  /* Main : prend toute la largeur */
  .main { margin-left: 0 !important; width: 100% !important; }

  /* Topbar : compact mais lisible */
  .topbar {
    padding: 0 .85rem !important;
    gap: .5rem;
    min-height: 56px;
  }
  .topbar-title {
    font-size: 1rem !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
  }
  .topbar-actions {
    gap: .4rem;
    flex-shrink: 0;
  }
  .topbar-actions .role-badge,
  .topbar-actions .topbar-zone { display: none; }
  .topbar-actions .pseudo-label { display: none; }

  /* Contenu : padding mobile */
  .content { padding: 1rem .85rem 4rem !important; }

  /* Grilles : 1 colonne par défaut, 2 pour KPI */
  .kpi-grid    { grid-template-columns: repeat(2, 1fr) !important; gap: .65rem; }
  .grid-2,
  .grid-3,
  .module-grid,
  .chapters-layout,
  .admin-stats-grid { grid-template-columns: 1fr !important; }
  .chapters-toc { position: static; margin-bottom: 1rem; }

  /* Headers de section : empilés */
  .section-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: .85rem;
  }
  .section-title {
    font-size: 1.25rem !important;
    word-break: break-word;
  }
  .section-sub { font-size: .85rem; }
  .section-header .btn { width: 100%; justify-content: center; }

  /* Dashboard welcome */
  .dashboard-welcome {
    flex-direction: column !important;
    text-align: center;
    padding: 1.25rem !important;
    gap: 1rem;
  }
}

/* ════════════════════════════════════════════════
   ══  MOBILE STRICT  (≤ 600px)                 ══
   ════════════════════════════════════════════════ */
@media (max-width: 600px) {

  /* ─── INPUTS : 16px obligatoire (anti zoom iOS) ─── */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="search"],
  input[type="tel"],
  input[type="url"],
  input[type="date"],
  textarea,
  select,
  .form-input,
  .search-input {
    font-size: 16px !important;
    min-height: 44px;
  }
  textarea, .notes-textarea { min-height: 96px; }

  /* ─── BOUTONS : zones tactiles 44px min ─── */
  .btn,
  .nav-item,
  button.modal-close,
  .icon-btn {
    min-height: 44px;
  }
  .btn-sm { min-height: 36px; }

  /* ─── KPI 1 colonne sur très petit écran ─── */
  .kpi-grid { grid-template-columns: 1fr 1fr !important; }
  .kpi-value { font-size: 1.45rem; }
  .kpi-label { font-size: .65rem; }

  /* ─── TABLEAUX SCROLLABLES HORIZONTALEMENT ─── */
  .table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    position: relative;
    /* indicateur de scroll : dégradé droit */
    background-image:
      linear-gradient(to right, var(--surface), var(--surface)),
      linear-gradient(to right, var(--surface), var(--surface)),
      linear-gradient(to right, rgba(0,0,0,.2), rgba(0,0,0,0)),
      linear-gradient(to left,  rgba(0,0,0,.2), rgba(0,0,0,0));
    background-position: left center, right center, left center, right center;
    background-repeat: no-repeat;
    background-color: var(--surface);
    background-size: 20px 100%, 20px 100%, 12px 100%, 12px 100%;
    background-attachment: local, local, scroll, scroll;
  }
  .table-wrap table {
    min-width: 560px;
    font-size: .82rem;
  }
  .table-wrap th,
  .table-wrap td {
    padding: .65rem .55rem;
    white-space: nowrap;
  }
  /* Première colonne sticky pour repère */
  .table-wrap th:first-child,
  .table-wrap td:first-child {
    position: sticky;
    left: 0;
    background: var(--surface);
    z-index: 2;
    box-shadow: 4px 0 8px rgba(0,0,0,.15);
  }

  /* ─── MODALES → BOTTOM SHEETS ─── */
  .modal-overlay {
    padding: 0 !important;
    align-items: flex-end !important;
    animation: fadeIn .25s;
  }
  .modal {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92vh !important;
    border-radius: 18px 18px 0 0 !important;
    padding: 1rem 1.1rem 1.5rem !important;
    margin: 0;
    animation: slideUpSheet .3s cubic-bezier(.32,.72,0,1);
    overflow-y: auto;
    overscroll-behavior: contain;
    /* Padding sécurisé pour la zone tactile bas (iOS) */
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px)) !important;
    position: relative;
  }
  /* Poignée de drag visuelle en haut du sheet */
  .modal::before {
    content: "";
    display: block;
    width: 42px;
    height: 4px;
    background: var(--border2);
    border-radius: 2px;
    margin: 0 auto .85rem;
    opacity: .6;
  }
  .modal-header {
    margin-bottom: 1rem !important;
    padding-right: .25rem;
    position: sticky;
    top: 0;
    background: var(--surface2);
    z-index: 3;
    padding-top: .25rem;
    padding-bottom: .65rem;
    border-bottom: 1px solid var(--border);
  }
  .modal-title { font-size: 1rem !important; }
  .modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--surface);
    font-size: 1.3rem;
  }
  .modal-footer {
    flex-direction: column-reverse !important;
    gap: .55rem !important;
    position: sticky;
    bottom: 0;
    background: var(--surface2);
    padding-top: .85rem !important;
    margin-top: 1rem !important;
    z-index: 3;
  }
  .modal-footer .btn { width: 100%; justify-content: center; }

  @keyframes slideUpSheet {
    from { opacity: 0; transform: translateY(100%); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* ─── FORMULAIRES : espacement plus aéré ─── */
  .form-group { margin-bottom: 1rem; }
  .form-label {
    font-size: .78rem;
    margin-bottom: .35rem;
  }

  /* ─── ALERTES / MESSAGES ─── */
  .alert {
    font-size: .85rem;
    padding: .75rem .85rem;
    line-height: 1.45;
  }

  /* ─── SEARCH BAR ─── */
  .search-bar { margin-bottom: 1rem; }
  .search-input { padding-left: 2.5rem; }

  /* ─── BADGES / CHIPS ne tronquent plus ─── */
  .role-badge,
  .status-badge { white-space: nowrap; }

  /* ─── Empêche scroll horizontal global ─── */
  html, body {
    overflow-x: hidden;
    max-width: 100%;
  }
}

/* ─── CANDIDATURES : layout responsive ─── */
.cand-card .cand-info {
  word-break: break-word;
  overflow-wrap: anywhere;
}
.cand-card .cand-info > div[style*="white-space"] {
  /* Le bloc motivations : autorise le retour à la ligne et le débordement vertical */
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
/* Sur écrans ≤ 768px, les actions passent en ligne pleine largeur sous l'info */
@media (max-width: 768px) {
  .cand-card .cand-actions {
    flex-direction: row !important;
    flex-wrap: wrap;
    width: 100%;
    flex-basis: 100% !important;
  }
  .cand-card .cand-actions .btn {
    flex: 1 1 auto;
    min-width: 120px;
    justify-content: center;
  }
  .cand-card .cand-actions .btn-icon {
    flex: 0 0 auto;
    min-width: 44px;
  }
  .cand-card .cand-row {
    gap: .65rem;
  }
}

/* ════════════════════════════════════════════════
   ══  PETIT MOBILE  (≤ 380px)                  ══
   ════════════════════════════════════════════════ */
@media (max-width: 380px) {
  .topbar-title { font-size: .9rem !important; }
  .kpi-grid { grid-template-columns: 1fr !important; }
  .section-title { font-size: 1.1rem !important; }
  .modal { padding: .85rem .9rem 1.25rem !important; }
}

/* ════════════════════════════════════════════════
   ══  ACCESSIBILITÉ : préférence reduced motion ══
   ════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .sidebar-backdrop,
  .modal,
  .modal-overlay {
    transition: none !important;
    animation: none !important;
  }
}

/* ══════════════════════════════════════════════
   SONDAGES — Administration (constructeur + stats)
   Préfixe .sondadm- pour isolation (style partagé)
══════════════════════════════════════════════ */
.sondadm-table{display:flex;flex-direction:column;gap:.6rem}
.sondadm-row{display:flex;align-items:center;gap:1rem;background:var(--surface);border:1px solid var(--border2);border-radius:var(--radius2);padding:.9rem 1.1rem;transition:.15s}
.sondadm-row:hover{border-color:var(--border3)}
.sondadm-row-main{flex:1;min-width:0}
.sondadm-row-title{font-weight:600;font-size:.95rem;color:var(--text);font-family:var(--font-display);letter-spacing:.01em}
.sondadm-row-sub{font-size:.74rem;color:var(--muted);margin-top:.2rem;display:flex;flex-wrap:wrap;gap:.6rem;align-items:center}
.sondadm-st{font-size:.66rem;font-weight:700;text-transform:uppercase;letter-spacing:.06em;padding:.18rem .5rem;border-radius:4px;font-family:var(--font-display)}
.sondadm-st.draft{background:rgba(138,144,159,.18);color:var(--muted)}
.sondadm-st.open{background:rgba(82,183,136,.16);color:var(--success-light)}
.sondadm-st.closed{background:rgba(155,34,38,.18);color:var(--danger-light)}
.sondadm-pill{font-size:.66rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;padding:.16rem .45rem;border-radius:4px;background:var(--surface2);border:1px solid var(--border2);color:var(--a3)}
.sondadm-row-act{display:flex;gap:.35rem;flex-shrink:0;flex-wrap:wrap;justify-content:flex-end;max-width:340px}
.sondadm-iconbtn{background:var(--surface2);border:1px solid var(--border2);color:var(--a3);border-radius:5px;padding:.4rem .6rem;font-size:.74rem;cursor:pointer;display:inline-flex;align-items:center;gap:.3rem;transition:.12s;font-family:var(--font-sans);white-space:nowrap}
.sondadm-iconbtn:hover{border-color:var(--a3);color:var(--a4)}
.sondadm-iconbtn.danger:hover{border-color:var(--danger-light);color:var(--danger-light)}
.sondadm-iconbtn.go:hover{border-color:var(--success-light);color:var(--success-light)}

/* Constructeur */
.sondadm-panel{background:var(--surface);border:1px solid var(--border2);border-radius:var(--radius);padding:1.4rem 1.5rem;max-width:880px}
.sondadm-panel-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:1.2rem;padding-bottom:1rem;border-bottom:1px solid var(--border2)}
.sondadm-panel-title{font-family:var(--font-display);font-weight:700;font-size:1.2rem;color:var(--text);letter-spacing:.02em}
.sondadm-field{margin-bottom:1rem}
.sondadm-label{display:block;font-size:.74rem;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);font-weight:700;font-family:var(--font-display);margin-bottom:.4rem}
.sondadm-input,.sondadm-textarea{width:100%;background:var(--bg2);border:1px solid var(--border2);border-radius:var(--radius2);padding:.65rem .8rem;color:var(--text);font-family:var(--font-sans);font-size:.9rem;box-sizing:border-box}
.sondadm-input:focus,.sondadm-textarea:focus{outline:none;border-color:var(--a3)}
.sondadm-textarea{resize:vertical;min-height:70px}
.sondadm-toggle{display:flex;align-items:center;gap:.6rem;cursor:pointer;font-size:.86rem;color:var(--text2);padding:.6rem .8rem;background:var(--bg2);border:1px solid var(--border2);border-radius:var(--radius2)}
.sondadm-toggle input{width:18px;height:18px;accent-color:var(--a4);cursor:pointer}
.sondadm-q{background:var(--bg2);border:1px solid var(--border2);border-radius:var(--radius2);padding:1rem 1.1rem;margin-bottom:.9rem}
.sondadm-q-head{display:flex;align-items:center;gap:.6rem;margin-bottom:.7rem}
.sondadm-q-num{font-family:var(--font-display);font-weight:700;color:var(--a3);font-size:.9rem;flex-shrink:0}
.sondadm-select{background:var(--surface2);border:1px solid var(--border2);border-radius:5px;color:var(--text);padding:.45rem .6rem;font-size:.82rem;font-family:var(--font-sans);cursor:pointer}
.sondadm-q-opts{display:flex;flex-direction:column;gap:.4rem;margin-top:.5rem}
.sondadm-optline{display:flex;gap:.4rem;align-items:center}
.sondadm-optline input{flex:1}
.sondadm-grp{border:1px dashed var(--border2);border-radius:5px;padding:.7rem;margin-bottom:.6rem}
.sondadm-grp-head{display:flex;gap:.4rem;align-items:center;margin-bottom:.5rem}
.sondadm-mini{background:transparent;border:1px solid var(--border2);color:var(--a3);border-radius:4px;padding:.3rem .55rem;font-size:.74rem;cursor:pointer;display:inline-flex;align-items:center;gap:.3rem}
.sondadm-mini:hover{border-color:var(--a3);color:var(--a4)}
.sondadm-mini.danger{color:var(--danger-light);border-color:transparent}
.sondadm-mini.danger:hover{border-color:var(--danger-light)}
.sondadm-hint{font-size:.74rem;color:var(--muted2);margin-top:.3rem}

/* Résultats / stats */
.sondadm-res-head{display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;margin-bottom:1.3rem;flex-wrap:wrap}
.sondadm-kpis{display:flex;gap:.8rem;flex-wrap:wrap;margin-bottom:1.6rem}
.sondadm-kpi{background:var(--surface);border:1px solid var(--border2);border-radius:var(--radius2);padding:.9rem 1.2rem;min-width:130px}
.sondadm-kpi-val{font-family:var(--font-display);font-weight:700;font-size:1.7rem;color:var(--a4);line-height:1}
.sondadm-kpi-lbl{font-size:.72rem;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);margin-top:.3rem}
.sondadm-statq{background:var(--surface);border:1px solid var(--border2);border-radius:var(--radius);padding:1.2rem 1.3rem;margin-bottom:1.1rem}
.sondadm-statq-lbl{font-family:var(--font-display);font-weight:700;font-size:1rem;color:var(--text);margin-bottom:1rem;letter-spacing:.01em}
.sondadm-statgrp{font-size:.72rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--a3);margin:1rem 0 .6rem}
.sondadm-bar-row{display:flex;align-items:center;gap:.8rem;margin-bottom:.5rem}
.sondadm-bar-lbl{flex:0 0 200px;font-size:.83rem;color:var(--text2);text-align:right;line-height:1.2}
.sondadm-bar-track{flex:1;background:var(--bg2);border-radius:5px;height:24px;position:relative;overflow:hidden;border:1px solid var(--border)}
.sondadm-bar-fill{height:100%;background:linear-gradient(90deg,var(--a2),var(--a3));border-radius:5px 0 0 5px;transition:width .5s ease;min-width:2px}
.sondadm-bar-val{flex:0 0 auto;font-size:.8rem;color:var(--a4);font-family:var(--font-display);font-weight:700;min-width:64px}
.sondadm-voters{font-size:.76rem;color:var(--muted);margin:.1rem 0 .7rem 210px;line-height:1.4}
.sondadm-voters b{color:var(--text2);font-weight:600}
.sondadm-textans{background:var(--bg2);border:1px solid var(--border2);border-radius:5px;padding:.6rem .8rem;margin-bottom:.5rem;font-size:.85rem;color:var(--text2);line-height:1.45}
.sondadm-textans .who{font-size:.72rem;color:var(--a3);font-weight:600;margin-top:.3rem}
@media(max-width:680px){.sondadm-bar-lbl{flex-basis:110px}.sondadm-voters{margin-left:0}.sondadm-row{flex-wrap:wrap}}

/* ══════════════════════════════════════════════
   SONDAGES — Constructeur v2 (design affiné)
   Surcharge les règles .sondadm-* précédentes
══════════════════════════════════════════════ */
.sondadm-panel{max-width:920px;padding:1.6rem 1.7rem;background:linear-gradient(180deg,var(--surface) 0%,var(--bg2) 100%)}
.sondadm-panel-title{font-size:1.3rem}
.sondadm-toolbar{display:flex;gap:.5rem;flex-wrap:wrap;margin-bottom:1.1rem}

/* Champs principaux : plus aérés, focus net */
.sondadm-input,.sondadm-textarea,.sondadm-select{background:var(--bg2);border:1px solid var(--border2);border-radius:8px;color:var(--text);transition:border-color .15s,box-shadow .15s}
.sondadm-input{padding:.7rem .85rem;font-size:.92rem}
.sondadm-input:focus,.sondadm-textarea:focus,.sondadm-select:focus{outline:none;border-color:#c9a227;box-shadow:0 0 0 3px rgba(201,162,39,.15)}
.sondadm-label{color:var(--a4);font-size:.72rem;margin-bottom:.45rem}
.sondadm-title-input{font-size:1.05rem !important;font-weight:600;font-family:var(--font-display)}

/* Toggle anonymat = vrai interrupteur */
.sondadm-toggle{background:var(--bg2);border-radius:10px;padding:.8rem 1rem;border:1px solid var(--border2);align-items:flex-start}
.sondadm-switch{position:relative;flex:0 0 auto;width:42px;height:24px;display:inline-block}
.sondadm-switch input{opacity:0;width:0;height:0;position:absolute}
.sondadm-switch .sl{position:absolute;inset:0;background:var(--surface3);border-radius:24px;transition:.2s;border:1px solid var(--border2)}
.sondadm-switch .sl::before{content:'';position:absolute;height:16px;width:16px;left:4px;top:3px;background:#fff;border-radius:50%;transition:.2s}
.sondadm-switch input:checked + .sl{background:#c9a227;border-color:#c9a227}
.sondadm-switch input:checked + .sl::before{transform:translateX(18px)}

/* Carte question : barre d'accent + numéro en pastille */
.sondadm-q{position:relative;background:var(--surface);border:1px solid var(--border2);border-radius:12px;padding:1.1rem 1.2rem 1.2rem 1.4rem;margin-bottom:1rem;overflow:hidden}
.sondadm-q::before{content:'';position:absolute;left:0;top:0;bottom:0;width:4px;background:linear-gradient(180deg,#c9a227,#8a6d18)}
.sondadm-q-head{gap:.7rem;margin-bottom:.9rem;flex-wrap:wrap}
.sondadm-q-num{display:flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:50%;background:rgba(201,162,39,.15);color:#c9a227;font-size:.82rem;font-weight:800;flex:0 0 auto}
.sondadm-typesel{flex:1;min-width:170px;max-width:260px;padding:.5rem .7rem;font-size:.85rem;cursor:pointer}
.sondadm-reqpill{display:inline-flex;align-items:center;gap:.4rem;font-size:.74rem;color:var(--muted);cursor:pointer;user-select:none;background:var(--bg2);border:1px solid var(--border2);border-radius:20px;padding:.35rem .7rem}
.sondadm-reqpill input{margin:0;accent-color:#c9a227}
.sondadm-qlabel-input{font-size:1rem !important;font-weight:600;border-color:var(--border3) !important;margin-bottom:1rem}

/* Options : pastille + champ + suppression discrète */
.sondadm-q-opts{display:flex;flex-direction:column;gap:.45rem;margin-top:.3rem}
.sondadm-optline{display:flex;gap:.55rem;align-items:center}
.sondadm-optline::before{content:'';flex:0 0 auto;width:8px;height:8px;border-radius:50%;border:2px solid var(--border3)}
.sondadm-optline.radio::before{border-radius:50%}
.sondadm-optline input[data-opt],.sondadm-optline input[data-gopt]{flex:1;padding:.55rem .75rem;font-size:.88rem}
.sondadm-optdel{flex:0 0 auto;background:transparent;border:none;color:var(--muted2);cursor:pointer;font-size:1rem;line-height:1;padding:.3rem .45rem;border-radius:6px;transition:.12s}
.sondadm-optdel:hover{color:var(--danger-light);background:rgba(155,34,38,.12)}

/* Boutons d'ajout pleine largeur, en pointillés */
.sondadm-addbtn{width:100%;background:transparent;border:1px dashed var(--border3);color:var(--a3);border-radius:8px;padding:.6rem;font-size:.84rem;cursor:pointer;transition:.14s;margin-top:.6rem;font-family:var(--font-sans)}
.sondadm-addbtn:hover{border-color:#c9a227;color:#c9a227;background:rgba(201,162,39,.05)}
.sondadm-addbtn.sm{width:auto;padding:.45rem .8rem;margin-top:.5rem}

/* Carte catégorie (multi_grouped) */
.sondadm-grp{background:var(--bg2);border:1px solid var(--border2);border-left:3px solid rgba(201,162,39,.5);border-radius:8px;padding:.85rem .95rem;margin-bottom:.7rem}
.sondadm-grp-head{margin-bottom:.6rem;gap:.5rem}
.sondadm-grp-head input{font-weight:700;font-size:.92rem;flex:1}

/* Bandeau type courant (aide contextuelle) */
.sondadm-typehint{font-size:.76rem;color:var(--muted);background:var(--bg2);border-radius:6px;padding:.5rem .7rem;margin-bottom:.9rem;border-left:2px solid #c9a227}

/* Zone import JSON */
.sondadm-json-ta{width:100%;box-sizing:border-box;min-height:240px;background:#0a0e16;border:1px solid var(--border2);border-radius:8px;color:#cfe3c0;font-family:var(--font-mono);font-size:.8rem;padding:.9rem;line-height:1.5;resize:vertical}
.sondadm-json-ta:focus{outline:none;border-color:#c9a227}
.sondadm-drop{border:1px dashed var(--border3);border-radius:8px;padding:1rem;text-align:center;color:var(--muted);font-size:.84rem;cursor:pointer;transition:.14s;margin-bottom:.8rem}
.sondadm-drop:hover{border-color:#c9a227;color:#c9a227}
