/* =========================================================
   Convoclasse — feuille de style
   Esthétique éditoriale administrative
   ========================================================= */

:root {
  /* Palette */
  --ink:        #1a1f2e;      /* texte principal, encre */
  --ink-soft:   #4a5268;
  --ink-muted:  #7a8296;
  --ink-faint:  #a8b0c2;

  --paper:      #faf7f2;      /* fond chaleureux */
  --paper-deep: #f3efe6;
  --surface:    #ffffff;
  --surface-2:  #fbfaf6;

  --line:       #e8e3d7;
  --line-soft:  #efebe0;
  --line-deep:  #d6d0c0;

  --accent:     #1e4d6b;      /* bleu encre */
  --accent-soft:#e6edf2;
  --accent-deep:#153b54;

  --warm:       #b8602c;      /* ambre pour tiers-temps */
  --warm-soft:  #fbeee3;
  --warm-deep:  #8a4820;

  --success:    #4a7c4f;
  --success-soft:#e6f0e7;

  --danger:     #b5453d;
  --danger-soft:#fbe9e7;

  /* Typo */
  --font-display: "Fraunces", Georgia, serif;
  --font-body:    "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    "IBM Plex Mono", "SF Mono", Consolas, monospace;

  /* Rayons */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 10px;

  /* Ombres */
  --sh-sm: 0 1px 2px rgba(26,31,46,0.04);
  --sh-md: 0 2px 8px rgba(26,31,46,0.06);

  /* Layout */
  --max-w: 1320px;
  --sidebar-w: 260px;
  --gutter: 32px;
}

/* ---------------- Reset minimal ---------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Arrière-plan texturé — quadrillage discret façon papier millimétré */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(26,31,46,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26,31,46,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  z-index: 0;
}

/* ---------------- Topbar ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, rgba(250,247,242,0.96) 0%, rgba(250,247,242,0.88) 100%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 1px 6px rgba(26,31,46,0.03);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
}
/* Liseré accentué en haut du topbar */
.topbar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-deep) 50%, var(--warm) 100%);
}
.topbar-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 14px var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: var(--paper);
  border-radius: 10px;
  flex: 0 0 auto;
  box-shadow: 0 2px 6px rgba(30,77,107,0.25), 0 0 0 1px rgba(30,77,107,0.1);
  transition: transform .25s ease;
}
.brand:hover .brand-mark { transform: rotate(-2deg) scale(1.04); }
.brand-text { display: flex; flex-direction: column; gap: 1px; }
.brand-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.015em;
  color: var(--ink);
  line-height: 1.1;
  font-variation-settings: "opsz" 48;
}
.brand-dot {
  color: var(--warm);
  font-weight: 600;
  margin-left: 1px;
}
.brand-sub {
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}
.top-actions { display: flex; gap: 8px; }

/* Stepper */
.stepper {
  border-top: 1px solid var(--line-soft);
  background: linear-gradient(180deg, var(--surface-2) 0%, rgba(251,250,246,0.6) 100%);
}
.stepper-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 10px var(--gutter);
  display: flex;
  align-items: center;
  gap: 6px;
}
.step {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all .18s ease;
  position: relative;
}
.step:hover {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line-soft);
}
.step.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(30,77,107,0.12);
}
.step-num {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--paper-deep);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  transition: all .18s ease;
}
.step:hover .step-num { background: var(--accent-soft); color: var(--accent); }
.step.active .step-num {
  background: var(--accent);
  color: var(--paper);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.step-label { font-size: 13px; font-weight: 500; }
.step-sep {
  flex: 0 0 28px;
  height: 1px;
  background: linear-gradient(90deg, var(--line) 0%, var(--line-deep) 50%, var(--line) 100%);
}

/* ---------------- Layout ---------------- */
.layout {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--gutter);
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: var(--gutter);
  position: relative;
  z-index: 1;
}
.sidebar {
  position: sticky;
  top: 120px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}
.content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

/* ---------------- Sidebar ---------------- */
.side-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
}
.side-card-accent {
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--surface) 100%);
  border-color: var(--line-deep);
}
.side-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-variation-settings: "opsz" 14;
}
.side-stats { margin: 0; padding: 0; }
.side-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}
.side-row:last-child { border-bottom: none; }
.side-row dt {
  font-size: 12px;
  color: var(--ink-muted);
  margin: 0;
}
.side-row dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
.side-feasibility {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--paper-deep);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-soft);
}
.feas-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink-faint);
  flex: 0 0 auto;
}
.side-feasibility.ok { background: var(--success-soft); color: var(--success); }
.side-feasibility.ok .feas-dot { background: var(--success); }
.side-feasibility.warn { background: var(--warm-soft); color: var(--warm-deep); }
.side-feasibility.warn .feas-dot { background: var(--warm); }
.side-feasibility.err { background: var(--danger-soft); color: var(--danger); }
.side-feasibility.err .feas-dot { background: var(--danger); }

.side-export { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

/* ---------------- Cards ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-sm);
  transition: box-shadow .25s ease, transform .25s ease;
  position: relative;
}
.card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-deep) 100%);
  opacity: 0;
  transition: opacity .25s ease;
}
.card:focus-within {
  box-shadow: var(--sh-md);
}
.card:focus-within::before { opacity: 1; }

.card-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
}
.card-index {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--accent);
  border: 1px solid var(--accent-soft);
  padding: 5px 10px;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  min-width: 36px;
  text-align: center;
}
.card-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 20px;
  margin: 0 0 2px;
  letter-spacing: -0.012em;
  color: var(--ink);
  font-variation-settings: "opsz" 36;
}
.card-sub {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-muted);
}
.card-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.card-body { padding: 22px; }

/* ---------------- Groupes de champs ---------------- */
.group + .group {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px dashed var(--line);
}
.group-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 14px;
  font-variation-settings: "opsz" 14;
}
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

/* ---------------- Champs ---------------- */
.field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}
.field-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--line);
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 600;
  cursor: help;
  text-transform: none;
}
.field-unit {
  position: absolute;
  right: 10px;
  bottom: 9px;
  font-size: 11px;
  color: var(--ink-faint);
  pointer-events: none;
  font-family: var(--font-mono);
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="file"],
select,
textarea {
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 9px 12px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
  width: 100%;
}
input:hover:not(:focus) { border-color: var(--line-deep); }
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--surface);
}
input[type="number"] { font-family: var(--font-mono); padding-right: 48px; }
input[type="date"], input[type="time"] { font-family: var(--font-mono); font-size: 13px; }

/* ---------------- Boutons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: all .15s;
  user-select: none;
  white-space: nowrap;
}
.btn svg { flex: 0 0 auto; }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-block { width: 100%; }

.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn-primary:active { transform: translateY(1px); }

.btn-outline {
  background: var(--surface);
  border-color: var(--line-deep);
  color: var(--ink);
}
.btn-outline:hover { background: var(--paper-deep); border-color: var(--ink-muted); }

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
}
.btn-ghost:hover { background: var(--paper-deep); color: var(--ink); }

.btn-danger-ghost { color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); }

.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .15s;
}
.btn-icon:hover { background: var(--paper-deep); color: var(--ink); }

/* ---------------- Tables (créneaux / élèves) ---------------- */
.table-head {
  display: grid;
  gap: 10px;
  padding: 0 10px 8px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 8px;
}
.table-head-eleves { grid-template-columns: 1.5fr 1.5fr 1.2fr 0.9fr 34px 40px; }

.rows { display: flex; flex-direction: column; gap: 6px; }

.row {
  display: grid;
  gap: 10px;
  padding: 6px 10px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  transition: background .15s, border-color .15s;
}
.row:hover { background: var(--surface-2); border-color: var(--line); }
.row.invalid { border-color: var(--danger); background: var(--danger-soft); }

.row-eleve { grid-template-columns: 1.5fr 1.5fr 1.2fr 0.9fr 34px 40px; }

.row input[type="text"],
.row input[type="number"],
.row input[type="date"],
.row input[type="time"] {
  border-color: transparent;
  background: transparent;
  padding: 6px 8px;
}
.row input:hover { border-color: var(--line); background: var(--surface); }
.row input:focus { border-color: var(--accent); background: var(--surface); }

.row-duration {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
  text-align: center;
}

/* Case à cocher tiers-temps stylée */
.tt-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  font-size: 12px;
  color: var(--ink-muted);
  transition: all .15s;
}
.tt-toggle:hover { background: var(--surface-2); }
.tt-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.tt-box {
  width: 16px; height: 16px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--line-deep);
  background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s;
  flex: 0 0 auto;
}
.tt-toggle input:checked + .tt-box {
  background: var(--warm);
  border-color: var(--warm);
}
.tt-toggle input:checked + .tt-box::after {
  content: "";
  width: 8px; height: 4px;
  border-left: 1.5px solid white;
  border-bottom: 1.5px solid white;
  transform: translateY(-1px) rotate(-45deg);
}
.tt-toggle input:checked ~ .tt-label { color: var(--warm-deep); font-weight: 500; }

.row-del {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--ink-faint);
  cursor: pointer;
  transition: all .15s;
  justify-self: center;
}
.row-del:hover { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }

/* ---------------- Empty states ---------------- */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-muted);
}
.empty-state svg { color: var(--ink-faint); margin-bottom: 12px; }
.empty-state p { margin: 0 0 4px; font-weight: 500; color: var(--ink-soft); }
.empty-state span { font-size: 12px; color: var(--ink-muted); }

/* ---------------- Toolbar candidats ---------------- */
.candidates-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--line);
}
.search-wrap {
  position: relative;
  flex: 1;
  max-width: 320px;
}
.search-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-faint);
}
.search-wrap input { padding-left: 32px; }
.toolbar-right { display: flex; align-items: center; gap: 10px; }
.count-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--paper-deep);
  color: var(--ink-soft);
  padding: 3px 10px;
  border-radius: 999px;
}

/* ---------------- Résultat / planning ---------------- */
.card-result { border-color: var(--line-deep); }
.warning-box {
  background: var(--warm-soft);
  border: 1px solid var(--warm);
  color: var(--warm-deep);
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  margin-bottom: 16px;
}
.warning-box strong { color: var(--warm-deep); }

.day-block {
  margin-bottom: 28px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.day-header {
  padding: 14px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.day-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 17px;
  color: var(--ink);
  text-transform: capitalize;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 24;
}
.day-meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-muted);
}
.day-table {
  width: 100%;
  border-collapse: collapse;
}
.day-table th {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
}
.day-table td {
  padding: 11px 16px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--line-soft);
}
.day-table tr:last-child td { border-bottom: none; }
.day-table tr.slot-eleve:hover { background: var(--surface-2); }
.day-table tr.slot-pause td {
  background: var(--paper-deep);
  color: var(--ink-muted);
  font-style: italic;
}
.day-table tr.slot-pause--reduite td {
  background: #fef3e2;
  color: #b8602c;
}
.slot-ordre {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
  width: 40px;
}
.slot-horaire {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink);
  white-space: nowrap;
  width: 140px;
}
.slot-name { font-weight: 500; }
.slot-name .surname { text-transform: uppercase; letter-spacing: 0.02em; }
.slot-classe {
  font-size: 12px;
  color: var(--ink-muted);
}
.tt-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--warm-soft);
  color: var(--warm-deep);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------------- Sélecteur d'ordre ---------------- */
.order-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.order-option {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  cursor: pointer;
  transition: all .15s;
  align-items: flex-start;
}
.order-option:hover {
  border-color: var(--line-deep);
  background: var(--surface-2);
}
.order-option input {
  margin: 2px 0 0;
  accent-color: var(--accent);
  flex: 0 0 auto;
  cursor: pointer;
}
.order-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.order-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 2px;
}
.order-sub {
  font-size: 11.5px;
  color: var(--ink-muted);
  line-height: 1.4;
}
.group-note {
  font-size: 11.5px;
  color: var(--ink-muted);
  margin: 10px 0 0;
  font-style: italic;
}

/* ---------------- Mode réorganisation ---------------- */
.card-result.reordering {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.reorder-banner {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent-deep);
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 12.5px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.reorder-banner svg { flex: 0 0 auto; }

.reordering .day-table tr.slot-eleve {
  cursor: grab;
  user-select: none;
}
.reordering .day-table tr.slot-eleve:active { cursor: grabbing; }
.reordering .day-table tr.slot-eleve.dragging {
  opacity: 0.4;
  background: var(--accent-soft);
}
.reordering .day-table tr.drop-before td {
  box-shadow: inset 0 2px 0 var(--accent);
}
.reordering .day-table tr.drop-after td {
  box-shadow: inset 0 -2px 0 var(--accent);
}
.drag-handle {
  display: none;
  width: 16px;
  color: var(--ink-faint);
  cursor: grab;
}
.reordering .drag-handle {
  display: inline-flex;
  align-items: center;
}
.reordering .slot-eleve:hover .drag-handle { color: var(--accent); }
.reordering .slot-pause[draggable="true"] { cursor: grab; }
.reordering .slot-pause[draggable="true"]:hover .drag-handle { color: var(--accent); }

.btn-sm.btn-active {
  background: var(--accent);
  color: var(--paper);
  border-color: var(--accent);
}

/* ---------------- Toasts ---------------- */
.toasts {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
  max-width: 360px;
}
.toast {
  background: var(--ink);
  color: var(--paper);
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  box-shadow: var(--sh-md);
  animation: toastIn .25s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warn { background: var(--warm); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.toast.out { animation: toastOut .2s ease forwards; }
@keyframes toastOut {
  to { opacity: 0; transform: translateY(8px); }
}

/* ---------------- Modal ---------------- */
.modal {
  position: fixed; inset: 0;
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
/* L'attribut HTML `hidden` doit l'emporter sur display: flex */
.modal[hidden] { display: none; }
[hidden] { display: none !important; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(26,31,46,0.4);
  backdrop-filter: blur(2px);
}
.modal-panel {
  position: relative;
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  max-width: 640px;
  width: 100%;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(26,31,46,0.25);
  animation: modalIn .2s ease;
}
.modal-panel-sm { max-width: 420px; }
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.modal-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 17px;
  font-variation-settings: "opsz" 24;
}
.modal-body {
  padding: 20px;
  overflow-y: auto;
  font-size: 13.5px;
  line-height: 1.6;
}
.modal-body h4 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14px;
  color: var(--ink);
  margin: 18px 0 6px;
  font-variation-settings: "opsz" 18;
}
.modal-body h4:first-child { margin-top: 0; }
.modal-body p { margin: 0 0 10px; color: var(--ink-soft); }
.modal-body code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--paper-deep);
  padding: 1px 5px;
  border-radius: 3px;
}
.modal-body pre {
  background: var(--paper-deep);
  padding: 12px 14px;
  border-radius: var(--r-md);
  overflow-x: auto;
  margin: 8px 0;
  border: 1px solid var(--line);
}
.modal-body pre code {
  background: transparent;
  padding: 0;
  font-size: 12px;
  line-height: 1.5;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--line-soft);
  background: var(--surface-2);
}

/* ---------------- Responsive ---------------- */
@media (max-width: 960px) {
  :root { --gutter: 20px; }
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    max-height: none;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .side-card { flex: 1 1 280px; }
  .stepper-inner { overflow-x: auto; }
  .step-label { display: none; }
  .step { padding: 6px; }
  .step-sep { flex: 0 0 16px; }
  .card-header { grid-template-columns: auto 1fr; }
  .card-header-actions { grid-column: 1 / -1; margin-top: 8px; flex-wrap: wrap; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .table-head { display: none; }
  .row-creneau, .row-eleve {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px;
  }
  .row-creneau > :nth-child(1) { grid-column: 1 / -1; }
  .row-eleve > :nth-child(1), .row-eleve > :nth-child(2) { grid-column: span 1; }
  .row-eleve > :nth-child(3) { grid-column: 1 / -1; }
  .row-del { justify-self: end; }
}

@media (max-width: 520px) {
  .brand-sub { display: none; }
  .brand-title { font-size: 16px; }
  .top-actions .btn span { display: none; }
  .card-body { padding: 16px; }
  .card-header { padding: 14px 16px; }
  .row-creneau, .row-eleve { grid-template-columns: 1fr; }
  .day-table th:nth-child(1), .day-table td:nth-child(1) { display: none; }
}

/* ---------------- Scrollbars subtiles ---------------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-deep);
  border-radius: 10px;
  border: 2px solid var(--paper);
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }

/* ---------------- Accessibilité ---------------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn:focus-visible { outline-offset: 3px; }

/* Masque focus souris seulement */
:focus:not(:focus-visible) { outline: none; }

/* Print */
@media print {
  .topbar, .sidebar, .card-header-actions, body::before { display: none !important; }
  body { background: white; }
  .layout { display: block; padding: 0; }
  .card { border: none; box-shadow: none; }
}

/* ---------------- Sidebar session row ---------------- */
.side-session-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 8px;
}
.side-session-row .btn {
  font-size: 12px;
  padding: 6px 8px;
  justify-content: center;
  gap: 5px;
}

/* ---------------- Dropdown menu ---------------- */
.dropdown { position: relative; }

.drop-caret {
  flex-shrink: 0;
  transition: transform 0.15s ease;
  margin-left: 1px;
}
.dropdown.open .drop-caret { transform: rotate(180deg); }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 4px 16px rgba(26,31,46,0.12), 0 1px 4px rgba(26,31,46,0.06);
  min-width: 220px;
  padding: 5px 0;
  animation: dropIn 0.12s ease;
}

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

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 14px;
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  text-align: left;
  transition: background 0.1s, color 0.1s;
  border-radius: 0;
}
.dropdown-item:hover { background: var(--paper-deep); color: var(--ink); }
.dropdown-item svg { flex-shrink: 0; opacity: 0.7; }

.dropdown-sep {
  height: 1px;
  background: var(--line-soft);
  margin: 4px 10px;
}

/* ---------------- Param checkbox (présence collective) ---------------- */
.param-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  cursor: pointer;
  margin: 14px 0 6px;
  user-select: none;
}
.param-check input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
  pointer-events: none;
}
.param-check-box {
  flex-shrink: 0;
  width: 16px; height: 16px;
  border: 1.5px solid var(--ink-faint);
  border-radius: 3px;
  background: var(--surface);
  margin-top: 2px;
  transition: background .15s, border-color .15s;
  display: flex; align-items: center; justify-content: center;
}
.param-check input:checked ~ .param-check-box,
.param-check input:checked + .param-check-box {
  background: var(--accent);
  border-color: var(--accent);
}
.param-check input:checked + .param-check-box::after {
  content: "";
  width: 8px; height: 4.5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
  display: block;
}
.param-check-label {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.45;
}
.param-check-sub {
  font-size: 11.5px;
  color: var(--ink-muted);
  display: block;
  margin-top: 1px;
}
.premier-delay-wrap {
  margin: 8px 0 4px 25px;
  padding: 10px 14px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}

/* ---------------- Logo établissement ---------------- */
.logo-zone {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.logo-preview-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 14px;
  background: var(--surface);
  box-shadow: var(--sh-sm);
  flex-shrink: 0;
}

.logo-preview-wrap img {
  max-height: 72px;
  max-width: 180px;
  object-fit: contain;
  display: block;
}

.logo-remove-btn {
  position: absolute;
  top: -9px;
  right: -9px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  border: 2px solid var(--paper);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s;
}
.logo-remove-btn:hover { background: #8f2a24; }

.logo-source {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  flex: 1;
}

.logo-or {
  font-size: 12px;
  color: var(--ink-muted);
  font-style: italic;
  padding-bottom: 10px;
  white-space: nowrap;
}

/* ---------------- Sidebar — séparateur documents ---------------- */
.side-divider {
  height: 1px;
  background: var(--line);
  margin: 10px 0 8px;
}

.side-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

/* ---------------- Paste hint bar ---------------- */
.paste-hint-bar {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--accent-soft);
  border: 1px solid #c5d6e4;
  border-radius: var(--r-md);
  padding: 7px 10px;
  font-size: 11.5px;
  color: var(--ink-soft);
  line-height: 1.45;
  margin-bottom: 10px;
}
.paste-hint-bar svg {
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 1px;
}
.paste-hint-bar code {
  background: rgba(30, 77, 107, 0.10);
  border: 1px solid rgba(30, 77, 107, 0.18);
  border-radius: 3px;
  padding: 0px 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--accent-deep);
}

/* ---------------- Journée type — popover de choix de date ---------------- */
.jt-popover {
  position: absolute;
  z-index: 300;
  background: var(--surface);
  border: 1px solid var(--line-deep);
  border-radius: var(--r-lg);
  box-shadow: 0 4px 20px rgba(26,31,46,0.14), 0 1px 3px rgba(26,31,46,0.06);
  padding: 14px 14px 12px;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.jt-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
  padding-right: 22px;
}

.jt-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin-bottom: 2px;
}
.jt-mt { margin-top: 10px; }

/* Radio options */
.jt-radio-opt {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 7px 9px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
}
.jt-radio-opt:hover { background: var(--accent-soft); border-color: #c0d4e4; }
.jt-radio-opt input[type="radio"] { margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; }
.jt-radio-opt:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }

.jt-radio-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.jt-radio-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}
.jt-radio-date {
  font-size: 10.5px;
  color: var(--ink-muted);
  line-height: 1.3;
}

/* Stepper créneaux */
.jt-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0 2px;
}
.jt-step-btn {
  width: 26px;
  height: 26px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-deep);
  background: var(--surface-2);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  transition: background 0.1s;
  flex-shrink: 0;
}
.jt-step-btn:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.jt-step-btn:disabled { opacity: 0.35; cursor: default; }
.jt-step-val {
  font-size: 14px;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
  color: var(--ink);
}
.jt-step-preview {
  font-size: 10px;
  color: var(--ink-muted);
  font-style: italic;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Bouton confirmer */
.jt-confirm {
  margin-top: 10px;
  width: 100%;
  justify-content: center;
  gap: 6px;
}

.jt-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  padding: 3px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
}
.jt-close:hover { background: var(--paper-deep); color: var(--ink); }

/* ---- Jury / Examinateurs ---- */
.jury-list { display: flex; flex-direction: column; gap: 6px; }
.jury-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.jury-num {
  flex: 0 0 22px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  text-align: right;
}
.jury-row input {
  flex: 1;
  height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 13px;
  color: var(--ink);
  transition: border-color .15s;
}
.jury-row input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px var(--accent-soft); }

/* ---- Créneau : grille élargie + toggle options ---- */
.table-head-creneaux { grid-template-columns: 1.4fr 0.9fr 0.9fr 0.6fr 34px 40px; }
.row-creneau         { grid-template-columns: 1.4fr 0.9fr 0.9fr 0.6fr 34px 40px; }

.creneau-item { display: flex; flex-direction: column; }

.creneau-opts-toggle {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
}
.creneau-opts-toggle:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.creneau-opts-toggle.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.creneau-opts-toggle.open { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Panneau d'options par créneau */
.creneau-opts-panel {
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-top: none;
  border-radius: 0 0 var(--r-md) var(--r-md);
  padding: 12px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  align-items: flex-start;
}
.creneau-opts-panel[hidden] { display: none; }

.cop-field { display: flex; flex-direction: column; gap: 5px; min-width: 200px; flex: 1; }
.cop-label { font-size: 11px; font-weight: 600; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.cop-hint  { font-size: 10px; font-weight: 400; color: var(--ink-faint); text-transform: none; letter-spacing: 0; margin-left: 4px; }
.cop-field input[type="text"] {
  height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 12px;
  color: var(--ink);
  max-width: 320px;
  transition: border-color .15s;
}
.cop-field input[type="text"]:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px var(--accent-soft); }

.creneau-exam-list { display: flex; flex-wrap: wrap; gap: 6px; }
.creneau-exam-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--ink-soft);
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 3px 9px;
  transition: all .15s;
}
.creneau-exam-check:hover { border-color: var(--accent); color: var(--accent); }
.creneau-exam-check input { display: none; }
.creneau-exam-check:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 500; }

/* Responsive : réduire colonnes créneau sur mobile */
@media (max-width: 640px) {
  .table-head-creneaux { grid-template-columns: 1fr; }
  .row-creneau { grid-template-columns: 1fr; }
}

/* ==========================================================
   Assistant conversationnel (chatbot pas à pas)
   ========================================================== */

.btn-wizard {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff;
  border: none;
  box-shadow: 0 2px 6px rgba(30, 77, 107, .25);
}
.btn-wizard:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* Effet surlignage champ en cours de remplissage */
@keyframes wizardPulse {
  0%   { box-shadow: 0 0 0 0 rgba(30,77,107,.35), 0 0 0 0 rgba(30,77,107,.18); }
  70%  { box-shadow: 0 0 0 4px rgba(30,77,107,0), 0 0 0 8px rgba(30,77,107,0); }
  100% { box-shadow: 0 0 0 0 rgba(30,77,107,0), 0 0 0 0 rgba(30,77,107,0); }
}
.wizard-focus {
  position: relative;
  animation: wizardPulse 1.6s ease-out 2;
  border-radius: var(--r-md);
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  scroll-margin-top: 140px;
  transition: outline-color .3s;
}
.wizard-fill-flash {
  animation: wizardFill .7s ease-out;
}
@keyframes wizardFill {
  0%   { background: rgba(74, 124, 79, .18); }
  100% { background: transparent; }
}

/* Panneau du chatbot — ancré à droite */
.wizard {
  position: fixed;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: 400px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 16px 48px rgba(26,31,46,0.18), 0 4px 12px rgba(26,31,46,0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
  animation: wizardSlideIn .25s ease-out;
}
@keyframes wizardSlideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.wizard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff;
  gap: 10px;
}
.wizard-head-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wizard-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.wizard-head-title { min-width: 0; }
.wizard-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wizard-sub {
  font-size: 11px;
  opacity: .8;
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wizard-head-actions { display: flex; gap: 4px; }
.wizard-head-actions .btn-icon {
  background: rgba(255,255,255,.08);
  color: #fff;
  border: none;
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .15s;
}
.wizard-head-actions .btn-icon:hover { background: rgba(255,255,255,.22); }
.wizard-head-actions .btn-icon:disabled { opacity: .4; cursor: not-allowed; }

.wizard-progress {
  height: 3px;
  background: var(--line-soft);
  overflow: hidden;
  flex-shrink: 0;
}
.wizard-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--warm));
  transition: width .3s ease;
}

.wizard-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wiz-msg { display: flex; gap: 8px; max-width: 92%; animation: wizMsgIn .2s ease-out; }
@keyframes wizMsgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.wiz-msg-bot { align-self: flex-start; }
.wiz-msg-user { align-self: flex-end; flex-direction: row-reverse; }

.wiz-bubble {
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
  word-wrap: break-word;
  max-width: 100%;
}
.wiz-msg-bot .wiz-bubble {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}
.wiz-msg-user .wiz-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.wiz-bubble code {
  background: rgba(0,0,0,.06);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 11.5px;
  font-family: var(--font-mono);
}
.wiz-msg-user .wiz-bubble code { background: rgba(255,255,255,.15); }
.wiz-bubble strong { font-weight: 600; }
.wiz-bubble-hint { font-size: 11.5px; color: var(--ink-muted); margin-top: 4px; }

.wiz-typing .wiz-bubble { display: flex; gap: 3px; padding: 10px 14px; }
.wiz-typing .wiz-bubble span {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--ink-muted);
  animation: wizTyping 1.2s infinite;
}
.wiz-typing .wiz-bubble span:nth-child(2) { animation-delay: .15s; }
.wiz-typing .wiz-bubble span:nth-child(3) { animation-delay: .3s; }
@keyframes wizTyping {
  0%, 60%, 100% { opacity: .3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}

.wiz-summary {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--r-md);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--ink);
  align-self: stretch;
  max-width: 100%;
}
.wiz-summary-title {
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--accent-deep);
  display: flex; align-items: center; gap: 6px;
}
.wiz-summary dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; }
.wiz-summary dt { color: var(--ink-muted); font-size: 11.5px; }
.wiz-summary dd { margin: 0; font-weight: 500; }

.wizard-foot {
  border-top: 1px solid var(--line);
  padding: 10px 12px;
  background: var(--surface);
  flex-shrink: 0;
}
.wizard-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  max-height: 150px;
  overflow-y: auto;
}
.wizard-quick:empty { display: none; }
.wiz-chip {
  background: var(--surface);
  border: 1px solid var(--line-deep);
  color: var(--ink);
  padding: 5px 11px;
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
  white-space: nowrap;
}
.wiz-chip:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-deep);
}
.wiz-chip-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.wiz-chip-primary:hover { background: var(--accent-deep); color: #fff; }
.wiz-chip-warm {
  background: var(--warm-soft);
  border-color: var(--warm);
  color: var(--warm-deep);
}

.wizard-input-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.wizard-input-row input[type="text"] {
  flex: 1;
  padding: 8px 11px;
  border: 1px solid var(--line-deep);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  background: var(--surface);
  transition: all .15s;
}
.wizard-input-row input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.wizard-input-row input[type="text"]:disabled {
  background: var(--surface-2);
  color: var(--ink-muted);
  cursor: not-allowed;
}
.wizard-input-row button { padding: 8px 10px; flex-shrink: 0; }
.wizard-input-row button:disabled { opacity: .4; cursor: not-allowed; }

.wizard-foot-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}
.wizard-link {
  background: none;
  border: none;
  color: var(--ink-muted);
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  padding: 2px 4px;
  transition: color .15s;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.wizard-link:hover { color: var(--accent); }

/* Mobile : plein écran */
@media (max-width: 520px) {
  .wizard {
    top: 0; right: 0; bottom: 0; left: 0;
    width: 100%;
    max-width: none;
    border-radius: 0;
  }
}

/* ==========================================================
   Panneau "professeurs" du candidat
   ========================================================== */

.eleve-item { display: flex; flex-direction: column; }

.eleve-opts-toggle {
  position: relative;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
}
.eleve-opts-toggle:hover  { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.eleve-opts-toggle.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.eleve-opts-toggle.open   { background: var(--accent); color: #fff; border-color: var(--accent); }

.eleve-opts-badge {
  position: absolute;
  top: -5px; right: -5px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--warm);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
  font-family: var(--font-body);
}

.eleve-opts-panel {
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-top: none;
  border-radius: 0 0 var(--r-md) var(--r-md);
  padding: 12px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  align-items: flex-start;
}
.eleve-opts-panel[hidden] { display: none; }

.eleve-prof-list { display: flex; flex-wrap: wrap; gap: 6px; }
.eleve-prof-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--ink-soft);
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 3px 9px;
  transition: all .15s;
}
.eleve-prof-check:hover { border-color: var(--accent); color: var(--accent); }
.eleve-prof-check input { display: none; }
.eleve-prof-check:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 500;
}

/* Mise en évidence discrète des lignes avec profs déclarés */
.row-eleve.has-opts { background: linear-gradient(90deg, transparent 0%, rgba(30,77,107,0.02) 100%); }

/* ---------------- Sélecteur de vue planning (par date / par jury) ---------------- */
.planning-view-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 8px 10px;
  background: var(--bg-soft, #f7f8fa);
  border: 1px solid var(--border, #e4e6eb);
  border-radius: 8px;
  font-size: 13px;
}
.planning-view-switch-label { color: var(--text-muted, #6b7280); font-weight: 500; }
.seg-control {
  display: inline-flex;
  background: #fff;
  border: 1px solid var(--border, #e4e6eb);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}
.seg-btn {
  background: transparent;
  border: 0;
  padding: 4px 12px;
  font-size: 13px;
  color: var(--text-muted, #6b7280);
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: all .12s;
}
.seg-btn:hover { color: var(--text, #222); }
.seg-btn.is-active {
  background: var(--accent, #1e4d6b);
  color: #fff;
}

/* Groupe par jury */
.jury-block {
  margin-bottom: 22px;
  border: 1px solid var(--border, #e4e6eb);
  border-radius: 10px;
  overflow: hidden;
}
.jury-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(90deg, rgba(30,77,107,0.08), rgba(30,77,107,0.02));
  border-bottom: 1px solid var(--border, #e4e6eb);
}
.jury-block-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--accent, #1e4d6b);
}
.jury-block-title svg { opacity: .8; }
.jury-block-meta { font-size: 12px; color: var(--text-muted, #6b7280); }
.jury-block-body { padding: 10px 12px 12px; }
.jury-block-body .day-block:last-child { margin-bottom: 0; }
.jury-block-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}
.jury-dropdown { position: relative; }
.jury-dropdown .dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 220px;
  z-index: 20;
}
.jury-docs-btn .drop-caret { transition: transform .15s; }
.jury-docs-btn[aria-expanded="true"] .drop-caret { transform: rotate(180deg); }
