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

:root {
  /* ── PRIMARY — Violet lumineux ──────────────────────────── */
  --primary:        #a78bfa;   /* violet-400 — lumineux, moins sombre */
  --primary-dark:   #8b5cf6;   /* violet-500 */
  --primary-darker: #7c3aed;   /* violet-600 */
  --primary-light:  #f5f3ff;   /* violet-50 */
  --primary-mid:    #ddd6fe;   /* violet-200 */

  /* ── BLUE (accent secondaire) ───────────────────────────── */
  --blue:       #3b82f6;
  --blue-dark:  #2563eb;
  --blue-light: #eff6ff;

  /* ── COULEURS SÉMANTIQUES ───────────────────────────────── */
  --green:         #10b981;
  --green-dark:    #059669;
  --green-light:   #ecfdf5;
  --amber:         #f59e0b;
  --amber-light:   #fffbeb;
  --red:           #ef4444;
  --red-light:     #fef2f2;
  --purple:        #a855f7;    /* violet plus saturé */
  --purple-light:  #faf5ff;

  /* ── ACCENTS SUPPLÉMENTAIRES ────────────────────────────── */
  --rose:          #f43f5e;
  --rose-light:    #fff1f2;
  --orange:        #f97316;
  --orange-light:  #fff7ed;
  --cyan:          #06b6d4;
  --cyan-light:    #ecfeff;
  --teal:          #14b8a6;
  --teal-light:    #f0fdfa;
  --pink:          #ec4899;
  --pink-light:    #fdf2f8;

  /* ── GRAYS ──────────────────────────────────────────────── */
  --gray-50:  #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* ── LAYOUT ─────────────────────────────────────────────── */
  --radius:    14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* ── OMBRES — teintées violet ────────────────────────────── */
  --shadow:    0 1px 4px rgba(167,139,250,.10), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 14px rgba(167,139,250,.15), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 12px 28px rgba(167,139,250,.20), 0 4px 8px rgba(0,0,0,.05);
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(160deg, #faf8ff 0%, #f3f0ff 100%);
  background-attachment: fixed;
  color: var(--gray-800);
  min-height: 100vh;
  line-height: 1.5;
}

/* ===== LOADING ===== */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 24px;
  background: linear-gradient(135deg, #e9d5ff 0%, #c4b5fd 30%, #a78bfa 60%, #818cf8 100%);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}
.loading-logo { text-align: center; }
.loading-logo .logo-icon { font-size: 56px; display: block; margin-bottom: 10px; filter: drop-shadow(0 4px 12px rgba(0,0,0,.2)); }
.loading-logo h1 { font-size: 32px; font-weight: 900; color: #fff; letter-spacing: -1px; }
.spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(255,255,255,.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== LAYOUT ===== */
.page { min-height: 100vh; }

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: linear-gradient(135deg, #fce7f3 0%, #e9d5ff 30%, #c4b5fd 60%, #818cf8 100%);
  position: relative;
  overflow: hidden;
}
.auth-page::before {
  content: '';
  position: absolute;
  width: 520px; height: 520px;
  top: -180px; right: -120px;
  background: radial-gradient(circle, rgba(167,139,250,.40) 0%, transparent 70%);
  pointer-events: none;
  animation: blob-drift 8s ease-in-out infinite alternate;
}
.auth-page::after {
  content: '';
  position: absolute;
  width: 420px; height: 420px;
  bottom: -120px; left: -80px;
  background: radial-gradient(circle, rgba(232,121,249,.30) 0%, transparent 70%);
  pointer-events: none;
  animation: blob-drift 10s ease-in-out infinite alternate-reverse;
}
@keyframes blob-drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(20px, -20px) scale(1.05); }
}

.auth-card {
  background: white;
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}
.auth-logo .logo-icon { font-size: 40px; display: block; margin-bottom: 8px; }
.auth-logo h1 { font-size: 24px; font-weight: 800; color: var(--primary); }
.auth-logo p { color: var(--gray-500); font-size: 14px; margin-top: 4px; }

/* ===== NAVBAR ===== */
.navbar {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  color: var(--blue);
  text-decoration: none;
}
.navbar-brand span { font-size: 24px; }
.navbar-actions { display: flex; align-items: center; gap: 12px; }
.navbar-user { font-size: 14px; color: var(--gray-600); }

/* ===== MAIN CONTENT ===== */
.main-content { padding: 32px 24px; max-width: 1100px; margin: 0 auto; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--gray-800);
  transition: border-color .15s, box-shadow .15s;
  background: white;
}
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(167,139,250,.22);
}
.form-input::placeholder { color: var(--gray-400); }

.form-error {
  font-size: 13px;
  color: var(--red);
  margin-top: 4px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .15s;
  text-decoration: none;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}
.btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, var(--primary-dark), var(--primary-darker)); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(167,139,250,.50); }

.btn-success {
  background: var(--green);
  color: white;
}
.btn-success:hover:not(:disabled) { background: var(--green-dark); transform: translateY(-1px); }

.btn-danger {
  background: var(--red);
  color: white;
}
.btn-danger:hover:not(:disabled) { filter: brightness(.9); }

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  border: 1.5px solid var(--gray-300);
}
.btn-ghost:hover:not(:disabled) { background: var(--gray-100); }

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 17px; width: 100%; }

.btn-link {
  background: none;
  border: none;
  color: var(--blue);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  padding: 0;
  text-decoration: underline;
}

/* ===== CARDS ===== */
.card {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-100);
}
.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 16px;
}

/* ===== STAT CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  padding-top: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-100);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.stat-blue::before   { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.stat-green::before  { background: linear-gradient(90deg, #10b981, #34d399); }
.stat-amber::before  { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-purple::before { background: linear-gradient(90deg, #a78bfa, #c4b5fd); }
.stat-value {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 6px;
}
.stat-label { font-size: 13px; color: var(--gray-500); font-weight: 500; }
.stat-blue .stat-value   { color: var(--blue); }
.stat-green .stat-value  { color: var(--green); }
.stat-amber .stat-value  { color: var(--amber); }
.stat-purple .stat-value { color: var(--purple); }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-500);
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 14px;
  color: var(--gray-700);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }

/* ===== BADGE ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
}
.badge-green { background: var(--green-light); color: var(--green-dark); }
.badge-amber { background: var(--amber-light); color: #92400e; }
.badge-blue { background: var(--blue-light); color: var(--blue-dark); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }
.badge-red  { background: #fef2f2; color: #dc2626; }

/* ===== TABLE MASTERY GRID ===== */
.mastery-grid {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 6px;
  margin-top: 8px;
}
.mastery-cell {
  aspect-ratio: 1;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  cursor: default;
  transition: transform .1s;
}
.mastery-cell:hover { transform: scale(1.1); }
.mastery-cell .table-num { font-size: 14px; font-weight: 800; }
.mastery-cell .pct { font-size: 10px; }
.mastery-none { background: var(--gray-100); color: var(--gray-400); }
.mastery-low { background: #fde8e8; color: #c53030; }
.mastery-mid { background: #fef3c7; color: #92400e; }
.mastery-good { background: #d1fae5; color: #065f46; }
.mastery-perfect { background: var(--green); color: white; }

/* ===== EXERCISE SCREEN ===== */
.exercise-page {
  min-height: 100vh;
  background: linear-height 135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%;
  background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: white;
}

.exercise-header {
  text-align: center;
  margin-bottom: 32px;
}
.exercise-header h2 { font-size: 20px; font-weight: 700; opacity: .8; }
.exercise-progress {
  font-size: 14px;
  opacity: .6;
  margin-top: 4px;
}

.timer-ring {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 32px;
}
.timer-ring svg { transform: rotate(-90deg); }
.timer-ring-bg { fill: none; stroke: rgba(255,255,255,.15); stroke-width: 8; }
.timer-ring-bar {
  fill: none;
  stroke: var(--green);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset .1s linear, stroke .5s;
}
.timer-ring-bar.warning { stroke: var(--amber); }
.timer-ring-bar.danger { stroke: var(--red); }
.timer-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 800;
}

.question-card {
  background: rgba(255,255,255,.1);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  max-width: 400px;
  width: 100%;
  border: 1px solid rgba(255,255,255,.15);
}
.question-text {
  font-size: 56px;
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 32px;
  line-height: 1;
}
.answer-input {
  width: 140px;
  padding: 16px;
  font-size: 36px;
  font-weight: 800;
  text-align: center;
  border: 3px solid rgba(255,255,255,.3);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.1);
  color: white;
  outline: none;
  transition: border-color .15s;
}
.answer-input:focus { border-color: white; }
.answer-input::placeholder { color: rgba(255,255,255,.3); }
.answer-input::-webkit-outer-spin-button,
.answer-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.answer-input[type=number] { -moz-appearance: textfield; }
.answer-input.correct { border-color: var(--green); background: rgba(16,185,129,.2); }
.answer-input.wrong { border-color: var(--red); background: rgba(239,68,68,.2); animation: shake .3s; }

@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.feedback-text {
  font-size: 16px;
  font-weight: 700;
  margin-top: 16px;
  height: 24px;
  transition: opacity .2s;
}
.feedback-text.correct { color: #6ee7b7; }
.feedback-text.wrong { color: #fca5a5; }

.submit-btn-exercise {
  margin-top: 24px;
  padding: 14px 40px;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  width: 100%;
}
.submit-btn-exercise:hover { background: var(--blue-dark); transform: translateY(-1px); }

/* ===== POINTS FLASH ===== */
.points-flash {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: 48px;
  font-weight: 900;
  color: #fbbf24;
  text-shadow: 0 2px 8px rgba(0,0,0,.4);
  pointer-events: none;
  z-index: 200;
  transition: transform .1s, opacity .3s;
}
.points-flash.show {
  transform: translate(-50%, -50%) scale(1);
  animation: pointsFly .8s ease-out forwards;
}
@keyframes pointsFly {
  0% { transform: translate(-50%,-50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%,-120%) scale(1.3); opacity: 0; }
}

/* ===== RESULTS SCREEN ===== */
.results-card {
  background: white;
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}
.results-score {
  font-size: 72px;
  font-weight: 900;
  color: var(--blue);
  line-height: 1;
}
.results-label { font-size: 16px; color: var(--gray-500); margin-bottom: 24px; }
.results-details {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 32px;
}
.results-detail { text-align: center; }
.results-detail .val { font-size: 28px; font-weight: 800; color: var(--gray-800); }
.results-detail .lbl { font-size: 12px; color: var(--gray-400); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }

.new-medals { margin: 20px 0; }
.new-medals h3 { font-size: 15px; color: var(--gray-600); margin-bottom: 12px; }
.medal-list { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.medal-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--gray-600);
}
.medal-icon { font-size: 36px; }

/* ===== STUDENT HOME ===== */
.student-hero {
  background: linear-gradient(135deg, var(--blue) 0%, var(--purple) 100%);
  border-radius: var(--radius);
  padding: 32px;
  color: white;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.student-avatar {
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  flex-shrink: 0;
}
.student-hero h2 { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.student-hero .points { font-size: 36px; font-weight: 900; line-height: 1; }
.student-hero .points-label { font-size: 13px; opacity: .8; }

.table-selector {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.table-btn {
  padding: 16px 8px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--gray-200);
  background: white;
  cursor: pointer;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  color: var(--gray-700);
  transition: all .15s;
  position: relative;
}
.table-btn:hover { border-color: var(--blue); color: var(--blue); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.table-btn.mastered { border-color: var(--green); background: var(--green-light); color: var(--green-dark); }
.table-btn .table-pct { font-size: 11px; font-weight: 600; display: block; }

.medals-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
}
.medal-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px;
  background: white;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  min-width: 100px;
  text-align: center;
}
.medal-card .icon { font-size: 36px; }
.medal-card .name { font-size: 12px; font-weight: 700; color: var(--gray-700); }
.medal-card .date { font-size: 11px; color: var(--gray-400); }

/* ===== TEACHER DASHBOARD ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.3px;
  background: linear-gradient(135deg, var(--gray-800) 0%, var(--primary-darker) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.students-list { display: flex; flex-direction: column; gap: 12px; }
.student-row {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all .15s;
}
.student-row:hover { border-color: var(--blue); box-shadow: var(--shadow-md); }
.student-row-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--blue-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.student-row-info { flex: 1; min-width: 0; }
.student-row-name { font-weight: 700; color: var(--gray-800); }
.student-row-meta { font-size: 13px; color: var(--gray-500); margin-top: 2px; }
.student-row-code {
  font-family: monospace;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--blue);
  background: var(--blue-light);
  padding: 6px 12px;
  border-radius: 6px;
}
.student-row-points { text-align: right; }
.student-row-points .pts { font-size: 22px; font-weight: 800; color: var(--amber); }
.student-row-points .pts-label { font-size: 12px; color: var(--gray-400); }

/* ===== MODAL ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 24px;
  animation: fadeIn .15s;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  background: white;
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp .2s;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } }
.modal-title { font-size: 20px; font-weight: 700; margin-bottom: 20px; }
.modal-footer { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }

/* ===== PROGRESS BAR ===== */
.progress-bar {
  height: 8px;
  background: var(--gray-200);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--green);
  transition: width .4s ease;
}

/* ===== ALERT ===== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
  font-weight: 500;
}
.alert-error { background: var(--red-light); color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: var(--green-light); color: var(--green-dark); border: 1px solid #a7f3d0; }
.alert-info { background: var(--blue-light); color: var(--blue-dark); border: 1px solid #bfdbfe; }

/* ===== TABS ===== */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--gray-200); margin-bottom: 24px; }
.tab-btn {
  padding: 10px 20px;
  background: none;
  border: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .15s;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--gray-400);
}
.empty-state-icon { font-size: 56px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--gray-600); margin-bottom: 8px; }
.empty-state p { font-size: 14px; margin-bottom: 24px; }

/* ===== STUDENT DETAIL (teacher view) ===== */
.student-detail-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
}
.back-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--gray-500);
  padding: 4px;
  line-height: 1;
}
.back-btn:hover { color: var(--gray-800); }

/* ===== LANDING PAGE ===== */
.landing-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #2e1065 0%, #6d28d9 40%, #7c3aed 70%, #6366f1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.landing-inner {
  width: 100%;
  max-width: 780px;
}
.landing-logo {
  text-align: center;
  color: white;
  margin-bottom: 48px;
}
.landing-logo .logo-icon { font-size: 56px; display: block; margin-bottom: 12px; }
.landing-logo h1 { font-size: 36px; font-weight: 900; margin-bottom: 8px; }
.landing-logo p { font-size: 16px; opacity: .8; }

.landing-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.landing-card {
  background: white;
  border: none;
  border-radius: var(--radius);
  padding: 28px 32px;
  display: flex;
  align-items: center;
  gap: 20px;
  cursor: pointer;
  text-align: left;
  transition: transform .15s, box-shadow .15s;
  box-shadow: var(--shadow-lg);
  width: 100%;
  position: relative;
}
.landing-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 25px rgba(0,0,0,.15);
}
.landing-card-icon { font-size: 44px; flex-shrink: 0; }
.landing-card h2 { font-size: 20px; font-weight: 800; color: var(--gray-800); margin-bottom: 4px; }
.landing-card p { font-size: 14px; color: var(--gray-500); line-height: 1.4; }
.landing-arrow {
  position: absolute;
  right: 24px;
  font-size: 22px;
  color: var(--gray-300);
  transition: transform .15s, color .15s;
}
.landing-card:hover .landing-arrow { transform: translateX(4px); color: var(--primary); }
.landing-teacher:hover { border-left: 4px solid var(--primary); }
.landing-student:hover { border-left: 4px solid var(--green); }
.landing-parent:hover { border-left: 4px solid var(--teal); }

@media (max-width: 640px) {
  .landing-logo h1 { font-size: 28px; }
  .landing-card { padding: 20px; }
  .landing-card-icon { font-size: 36px; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .auth-card { padding: 28px 20px; }
  .main-content { padding: 20px 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .student-row { flex-wrap: wrap; }
  .student-hero { flex-direction: column; text-align: center; }
  .mastery-grid { grid-template-columns: repeat(6, 1fr); }
  .question-text { font-size: 40px; }
}

/* ===== UTILITIES ===== */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-sm { font-size: 13px; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.text-gray { color: var(--gray-500); }
.text-blue { color: var(--blue); }
.text-green { color: var(--green); }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ===== CONFETTI ===== */
.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -10px;
  animation: confettiFall linear forwards;
  border-radius: 2px;
}
@keyframes confettiFall {
  to { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* ===== TEACHER APP LAYOUT (sidebar) ===== */
.teacher-app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: linear-gradient(180deg, #180b33 0%, #27116b 35%, #1f1065 65%, #160b50 100%);
  color: white;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo span { font-size: 22px; }
.sidebar-logo strong { font-size: 16px; font-weight: 800; color: white; }
.sidebar-logo small { font-size: 11px; color: rgba(255,255,255,.45); display: block; }

.sidebar-body { flex: 1; padding: 12px 8px; overflow-y: auto; }
.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .10em;
  color: rgba(255,255,255,.55);
  padding: 14px 12px 5px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.sidebar-section-label::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary-mid), transparent);
  flex-shrink: 0;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,.65);
  transition: all .15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  position: relative;
}
.sidebar-item:hover { background: rgba(167,139,250,.22); color: white; }
.sidebar-item.active { background: rgba(167,139,250,.32); color: white; font-weight: 700; border-left: 3px solid var(--primary); }
.sidebar-item .icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-item .badge-pill {
  margin-left: auto;
  background: var(--blue);
  color: white;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 7px;
}
.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-user {
  padding: 10px 12px;
  font-size: 13px;
  color: rgba(255,255,255,.5);
  display: flex;
  align-items: center;
  gap: 8px;
}

.teacher-content { overflow-y: auto; min-height: 100vh; background: var(--gray-50); }
.teacher-content .main-content { max-width: 1000px; }

/* ─── HEADER MOBILE ─────────────────────────────────────────────────────────── */
.mobile-header { display: none; }
.nav-overlay    { display: none; }

@media (max-width: 768px) {
  /* Header fixe en haut */
  .mobile-header {
    display: flex;
    align-items: center;
    gap: 10px;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: #1e1b4b;
    z-index: 300;
    padding: 0 16px;
  }
  .mobile-header-title {
    font-size: 17px;
    font-weight: 800;
    color: white;
    flex: 1;
  }
  .hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 4px;
  }
  .hamburger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all .2s;
  }

  /* Overlay sombre */
  .nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 299;
  }
  .teacher-app.nav-open .nav-overlay { display: block; }

  /* Sidebar = tiroir coulissant depuis la gauche */
  .teacher-app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 82vw;
    max-width: 300px;
    z-index: 400;
    transform: translateX(-100%);
    transition: transform .25s ease;
    overflow-y: auto;
    flex-direction: column;
    height: 100%;
  }
  .teacher-app.nav-open .sidebar {
    transform: translateX(0);
  }

  /* Tout afficher dans le tiroir */
  .sidebar-logo { display: flex; }
  .sidebar-body { display: flex; flex-direction: column; padding: 8px; overflow-y: visible; }
  .sidebar-body .sidebar-section-label { display: block; }
  .sidebar-footer { display: flex; }
  .sidebar-user { display: flex; }
  .sidebar-item { flex-direction: row; gap: 10px; padding: 10px 12px; font-size: 13px; min-width: unset; height: auto; justify-content: flex-start; }
  .sidebar-item .icon { font-size: 16px; width: 20px; }

  /* Contenu principal */
  .teacher-content {
    padding-top: 56px;
    padding-bottom: 0;
    min-height: 100vh;
  }
  .teacher-content .main-content { padding: 16px 12px; }

  /* Section header responsive */
  .section-header { flex-wrap: wrap; gap: 8px; }
  .section-title { font-size: 20px; }

  /* Lignes élèves responsive */
  .student-row { flex-wrap: wrap; gap: 8px; padding: 12px; }
  .student-row-info { min-width: 0; flex: 1 1 60%; }
  .student-row-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .student-row-code { font-size: 15px; padding: 4px 8px; order: 3; }
  .student-row-points { order: 4; min-width: 60px; }

  /* Stats grid 2 cols ok, garde */
  .stats-grid { grid-template-columns: 1fr 1fr; }

  /* Tabs scrollables */
  .tabs-bar { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .tab-btn { white-space: nowrap; flex-shrink: 0; }
}

/* ===== AGENDA ===== */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--gray-200);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.calendar-day-header {
  background: var(--gray-50);
  padding: 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
}
.calendar-cell {
  background: white;
  min-height: 90px;
  padding: 6px;
  cursor: pointer;
  transition: background .1s;
  position: relative;
}
.calendar-cell:hover { background: var(--blue-light); }
.calendar-cell.today { background: #eff6ff; }
.calendar-cell.today .cell-date { color: var(--blue); font-weight: 800; }
.calendar-cell.selected { background: var(--blue-light); outline: 2px solid var(--blue); }
.calendar-cell.other-month { background: var(--gray-50); }
.calendar-cell.other-month .cell-date { color: var(--gray-300); }
.cell-date { font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 4px; }
.cell-events { display: flex; flex-direction: column; gap: 2px; }
.event-dot {
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.event-card {
  background: white;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  border-left: 4px solid;
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: var(--shadow);
}
.event-card-info { flex: 1; min-width: 0; }
.event-card-title { font-weight: 700; font-size: 14px; color: var(--gray-800); }
.event-card-meta { font-size: 12px; color: var(--gray-500); margin-top: 2px; }

.event-type-cours    { color: #2563eb; background: #eff6ff; border-color: #2563eb; }
.event-type-reunion  { color: #7c3aed; background: #f5f3ff; border-color: #7c3aed; }
.event-type-delai    { color: #dc2626; background: #fef2f2; border-color: #dc2626; }
.event-type-rappel   { color: #d97706; background: #fffbeb; border-color: #d97706; }
.event-type-autre    { color: #059669; background: #ecfdf5; border-color: #059669; }

/* ===== PLANIFICATIONS ===== */
.plan-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.plan-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}
.plan-card-header:hover { background: var(--gray-50); }
.plan-subject-badge {
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
}
.plan-progress-bar {
  height: 6px;
  background: var(--gray-200);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 8px;
}
.plan-progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 99px;
  transition: width .4s;
}
.plan-items { padding: 12px 20px; }
.plan-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--gray-50);
}
.plan-item:last-child { border-bottom: none; }
.plan-item-check {
  width: 18px; height: 18px;
  border: 2px solid var(--gray-300);
  border-radius: 4px;
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  margin-top: 1px;
}
.plan-item-check.checked { background: var(--green); border-color: var(--green); }
.plan-item-check.checked::after { content: '✓'; color: white; font-size: 11px; font-weight: 800; }
.plan-item-text { font-size: 14px; color: var(--gray-700); line-height: 1.4; }
.plan-item-text.done { text-decoration: line-through; color: var(--gray-400); }

/* ===== ÉVALUATIONS ===== */
.eval-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
}
.eval-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.eval-info { flex: 1; min-width: 0; }
.eval-title { font-size: 16px; font-weight: 700; color: var(--gray-800); }
.eval-meta { font-size: 13px; color: var(--gray-500); margin-top: 3px; }
.eval-pts { font-size: 22px; font-weight: 900; color: var(--blue); text-align: right; }
.eval-pts-label { font-size: 11px; color: var(--gray-400); text-align: right; }

.question-row {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.question-num {
  width: 28px; height: 28px;
  background: var(--blue-light);
  color: var(--blue-dark);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ===== SUIVI ÉLÈVES ===== */
.student-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.student-chip {
  padding: 8px 16px;
  border-radius: 99px;
  border: 2px solid var(--gray-200);
  background: white;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  transition: all .15s;
}
.student-chip:hover { border-color: var(--blue); color: var(--blue); }
.student-chip.active { border-color: var(--blue); background: var(--blue); color: white; }

.note-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 8px;
  position: relative;
}
.note-category {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
}
.note-text { font-size: 14px; color: var(--gray-700); line-height: 1.5; }
.note-date { font-size: 11px; color: var(--gray-400); margin-top: 6px; }
.note-delete {
  position: absolute; top: 10px; right: 10px;
  background: none; border: none; cursor: pointer;
  color: var(--gray-300); font-size: 16px;
  transition: color .15s;
}
.note-delete:hover { color: var(--red); }

.competency-grid-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.competency-grid-table th, .competency-grid-table td {
  padding: 8px 10px;
  font-size: 13px;
  border: 1px solid var(--gray-200);
  text-align: center;
}
.competency-grid-table th { background: var(--gray-50); font-weight: 700; color: var(--gray-600); }
.comp-level {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--gray-200);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s;
  background: white;
}
.comp-level:hover { transform: scale(1.15); }
.comp-1 { border-color: #ef4444; background: #fef2f2; color: #ef4444; }
.comp-2 { border-color: #f59e0b; background: #fffbeb; color: #f59e0b; }
.comp-3 { border-color: var(--blue); background: var(--blue-light); color: var(--blue); }
.comp-4 { border-color: var(--green); background: var(--green-light); color: var(--green); }

/* ===== DRIVE (Mes ressources) ===== */
.drive-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  align-items: start;
}

/* Folder panel */
.folder-panel {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  position: sticky;
  top: 20px;
  box-shadow: var(--shadow);
}
.folder-panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-500);
}
.folder-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 14px;
  color: var(--gray-700);
  transition: background .1s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.folder-item:hover { background: var(--gray-50); }
.folder-item.active { background: var(--blue-light); color: var(--blue-dark); font-weight: 700; }
.folder-color-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.folder-item-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-item-count {
  font-size: 11px;
  color: var(--gray-400);
  background: var(--gray-100);
  padding: 1px 7px;
  border-radius: 99px;
  flex-shrink: 0;
}
.folder-item.active .folder-item-count { background: var(--blue); color: white; }
.folder-item-actions { display: none; gap: 2px; flex-shrink: 0; }
.folder-item:hover .folder-item-actions { display: flex; }
.folder-action-btn {
  font-size: 13px;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: background .1s;
  line-height: 1;
}
.folder-action-btn:hover { background: rgba(0,0,0,.07); }
.folder-action-btn.danger:hover { background: #fef2f2; }

.storage-bar {
  padding: 10px 14px 12px;
  border-top: 1px solid var(--gray-100);
  font-size: 11px;
  color: var(--gray-500);
}
.storage-bar-track {
  height: 4px;
  background: var(--gray-200);
  border-radius: 99px;
  margin-top: 6px;
  overflow: hidden;
}
.storage-bar-fill { height: 100%; background: var(--blue); border-radius: 99px; transition: width .4s; }

/* Files panel */
.drive-files-panel { min-width: 0; }

.upload-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  background: white;
  margin-bottom: 16px;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--blue);
  background: var(--blue-light);
}
.upload-zone-icon { font-size: 34px; margin-bottom: 6px; }
.upload-zone p { font-size: 13px; color: var(--gray-500); margin: 0; }
.upload-zone strong { color: var(--blue); }
.upload-zone-hint { font-size: 11px !important; color: var(--gray-400) !important; margin-top: 4px !important; }

.files-area-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.files-area-title { font-size: 16px; font-weight: 800; color: var(--gray-800); }

.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}
.file-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 14px 10px 10px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  position: relative;
  overflow: hidden;
}
.file-card:hover { border-color: var(--blue); box-shadow: 0 4px 14px rgba(59,130,246,.12); transform: translateY(-2px); }
.file-type-icon { font-size: 40px; line-height: 1; margin-bottom: 8px; display: block; }
.file-type-badge {
  position: absolute;
  top: 7px; left: 7px;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.file-card-delete {
  position: absolute;
  top: 5px; right: 5px;
  background: white;
  border: 1px solid var(--gray-200);
  cursor: pointer;
  color: var(--gray-400);
  font-size: 13px;
  padding: 2px 5px;
  border-radius: 4px;
  display: none;
  transition: all .1s;
  line-height: 1;
}
.file-card:hover .file-card-delete { display: block; }
.file-card-delete:hover { color: var(--red); border-color: var(--red); background: #fef2f2; }
.file-card-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}
.file-card-meta { font-size: 10px; color: var(--gray-400); margin-top: 4px; }

/* Image preview modal */
.image-preview-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}
.image-preview-inner { text-align: center; max-width: 90vw; }
.image-preview-inner img { max-width: 100%; max-height: 80vh; border-radius: var(--radius-sm); box-shadow: 0 25px 50px rgba(0,0,0,.5); }
.image-preview-name { color: rgba(255,255,255,.7); font-size: 13px; margin-top: 12px; }
.image-preview-close {
  position: fixed;
  top: 16px; right: 16px;
  background: rgba(255,255,255,.15);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  border-radius: 50%;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.image-preview-close:hover { background: rgba(255,255,255,.28); }

@media (max-width: 768px) {
  .drive-layout { grid-template-columns: 1fr; }
  .folder-panel { position: static; }
  .files-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}

/* ─── AGENDA HEBDOMADAIRE ──────────────────────────────────────────────────── */

.agenda-wrapper {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Navigation */
.agenda-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 10px 14px;
}

.ag-nav-btn {
  font-size: 22px;
  line-height: 1;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 8px;
  flex-shrink: 0;
}

.agenda-week-info {
  flex: 1;
  text-align: center;
  min-width: 0;
}

.ag-week-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.ag-week-label {
  font-weight: 800;
  font-size: 15px;
  color: var(--gray-800);
}

.ag-cycle-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: .06em;
}
.ag-cycle-A { background: #eff6ff; color: #2563eb; }
.ag-cycle-B { background: #f5f3ff; color: #7c3aed; }

.ag-week-dates {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 2px;
}

/* Scroll wrapper + grille */
.agenda-grid-scroll {
  overflow-x: auto;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  background: white;
  -webkit-overflow-scrolling: touch;
}

.agenda-week-grid {
  display: grid;
  grid-template-columns: 40px repeat(5, minmax(130px, 1fr));
  min-width: 700px;
}

/* Coin supérieur gauche */
.ag-corner {
  background: #fafafa;
  border-right: 1px solid var(--gray-200);
  border-bottom: 2px solid var(--gray-200);
}

/* En-têtes de jours */
.ag-day-header {
  padding: 8px 8px 6px;
  text-align: center;
  border-bottom: 2px solid var(--gray-200);
  border-right: 1px solid var(--gray-100);
  background: white;
}
.ag-day-header:last-child { border-right: none; }
.ag-day-header.ag-today  { background: #eff6ff; }

.ag-day-name {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--gray-400);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.ag-day-num {
  display: block;
  font-size: 24px;
  font-weight: 800;
  color: var(--gray-800);
  line-height: 1.1;
  margin: 1px 0 4px;
}
.ag-today .ag-day-num { color: var(--primary); }

.ag-day-events {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: center;
  margin-top: 2px;
}

/* Badges événements (dans les jours et week-end) */
.ag-ev-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.ag-ev-badge:hover { filter: brightness(.93); }

/* Label de période (colonne gauche) */
.ag-period-label {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-400);
  letter-spacing: .04em;
  border-right: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-100);
  background: #fafafa;
  min-height: 64px;
  padding: 4px 2px;
}

/* Cellule de grille */
.ag-cell {
  border-right: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  padding: 6px 8px;
  min-height: 64px;
  position: relative;
  transition: background .12s;
}
.ag-cell:last-child { border-right: none; }

.ag-cell-empty:hover { background: #f8fafc; }

.ag-cell-empty::after {
  content: '+';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 20px;
  color: #d1d5db;
  opacity: 0;
  transition: opacity .15s;
  pointer-events: none;
}
.ag-cell-empty:hover::after { opacity: 1; }

.ag-cell-filled:hover { filter: brightness(.96); }

.ag-cell-subject {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ag-cell-content {
  font-size: 12px;
  color: var(--gray-600);
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Séparateur matin / après-midi */
.ag-break-row {
  grid-column: 1 / -1;
  height: 10px;
  background: repeating-linear-gradient(
    -45deg,
    #f3f4f6,
    #f3f4f6 3px,
    #e9ebee 3px,
    #e9ebee 6px
  );
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
}

/* Week-end + notes */
.agenda-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr 3fr;
  gap: 12px;
}

.ag-weekend-box {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 12px;
}

.ag-weekend-hdr {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--gray-100);
}

.ag-weekend-day-name {
  font-size: 10px;
  font-weight: 700;
  color: var(--gray-400);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.ag-weekend-num {
  font-size: 20px;
  font-weight: 800;
  color: var(--gray-700);
}

.ag-weekend-events {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 24px;
}

.ag-empty { color: var(--gray-300); font-size: 14px; }

.ag-notes-box {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-height: 90px;
}

.ag-notes-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--gray-400);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.ag-notes-input {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  font-size: 13px;
  color: var(--gray-700);
  font-family: inherit;
  min-height: 60px;
  background: transparent;
  line-height: 1.5;
}

/* Swatches de couleur dans les modals */
.color-swatch-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform .15s, border-color .15s;
  outline: none;
}
.color-swatch:hover  { transform: scale(1.18); }
.color-swatch.selected { border-color: var(--gray-800); transform: scale(1.1); }

/* Mobile agenda */
@media (max-width: 768px) {
  .agenda-bottom {
    grid-template-columns: 1fr 1fr;
  }
  .ag-notes-box {
    grid-column: 1 / -1;
  }
  .agenda-nav {
    flex-wrap: wrap;
    gap: 6px;
  }
}

/* ─── CATÉGORIES D'ÉVÉNEMENTS ─────────────────────────────────────────────── */

/* Barre de filtre */
.ag-cat-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 8px 14px;
}

.ag-cat-filter-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-400);
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ag-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1.5px solid;
  cursor: pointer;
  background: transparent;
  transition: all .15s;
  white-space: nowrap;
}
.ag-cat-chip:hover { opacity: .82; }
.ag-cat-chip-active { box-shadow: 0 1px 4px rgba(0,0,0,.15); }

.ag-cat-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ag-cat-manage-btn {
  margin-left: auto;
  font-size: 14px;
  padding: 4px 8px;
}

/* Bannière vacances */
.ag-vacance-banner {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #f59e0b;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #92400e;
  text-align: center;
}

/* Jour férié dans l'en-tête */
.ag-ferie-badge {
  font-size: 9px;
  font-weight: 700;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 4px;
  padding: 1px 5px;
  margin: 2px auto 0;
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Jour de vacances */
.ag-vacance-day {
  background: #f9fafb !important;
}
.ag-vacance-day .ag-day-num {
  color: var(--gray-400) !important;
}

/* Sélecteur de catégorie dans les modals (radio stylisé) */
.ag-cat-radio-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ag-cat-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--gray-200);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  transition: all .15s;
  user-select: none;
}
.ag-cat-radio:hover { border-color: var(--cat-col, #3b82f6); background: #f8fafc; }
.ag-cat-radio-active {
  border-color: var(--cat-col, #3b82f6) !important;
  background: color-mix(in srgb, var(--cat-col, #3b82f6) 8%, white);
}

.ag-cat-radio-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ag-cat-vis-icon {
  margin-left: auto;
  font-size: 14px;
}

/* Liste de gestion des catégories */
.ag-cats-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ag-cat-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: var(--gray-50);
}

.ag-cat-list-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ag-cat-list-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--gray-800);
  flex: 1;
}

.ag-cat-list-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

/* ===== TABS BAR ===== */
.tabs-bar {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 4px;
  background: var(--gray-100);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 8px 16px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}

.tab-btn:hover { background: white; color: var(--gray-800); }

.tab-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow);
}

/* ===== AGENDA ANNUAL GRID ===== */
.agenda-annual-wrapper { padding: 8px 0; }

.agenda-annual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.annual-month-card {
  background: white;
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-100);
}

.annual-month-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 10px;
  text-transform: capitalize;
}

.annual-day-headers {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}
.annual-day-headers span {
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  color: var(--gray-400);
}

.annual-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
}

.annual-day, .annual-day-empty {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--gray-700);
  transition: all .1s;
}
.annual-day-empty { cursor: default; }
.annual-day:hover { background: var(--blue-light); color: var(--blue); }
.annual-weekend { color: var(--gray-400); }
.annual-today { background: var(--blue) !important; color: white !important; border-radius: 50%; }
.annual-ferie { background: #fef3c7; color: #92400e; font-weight: 700; }
.annual-vac { /* background set inline from settings */ color: var(--gray-500); }

.annual-legend {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--gray-600);
  margin-top: 8px;
}
.annual-legend-item { display: flex; align-items: center; gap: 6px; }
.annual-legend-swatch {
  display: inline-block;
  width: 16px; height: 16px;
  border-radius: 4px;
}

/* ===== GRILLE HORAIRE ===== */
.grille-scroll { overflow-x: auto; }

.grille-table {
  min-width: 700px;
  width: 100%;
  border-collapse: collapse;
}

.grille-table th, .grille-table td {
  border: 1px solid var(--gray-200);
  padding: 6px 8px;
}

.grille-matiere-col { min-width: 180px; font-weight: 700; font-size: 12px; }
.grille-matiere-cell { font-size: 12px; font-weight: 600; background: var(--gray-50); }

.grille-cell-input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 12px;
  padding: 2px 4px;
  outline: none;
  color: var(--gray-700);
}
.grille-cell-input:focus { background: var(--blue-light); border-radius: 4px; }

/* ===== HORAIRE DE CLASSE ===== */
.horaire-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 900px) { .horaire-wrapper { grid-template-columns: 1fr; } }

.horaire-scroll { overflow-x: auto; }

.horaire-table {
  min-width: 480px;
  width: 100%;
  border-collapse: collapse;
}
.horaire-table th, .horaire-table td {
  border: 1px solid var(--gray-200);
  padding: 6px 8px;
  font-size: 12px;
}
.horaire-period-label { font-weight: 700; background: var(--gray-50); text-align: center; }

.horaire-cell-input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 12px;
  padding: 2px 4px;
  outline: none;
  color: var(--gray-700);
}
.horaire-cell-input:focus { background: var(--blue-light); border-radius: 4px; }

/* ===== BESOINS PARTICULIERS ===== */
.besoins-scroll { overflow-x: auto; }

.besoins-table {
  min-width: 600px;
  width: 100%;
  border-collapse: collapse;
}
.besoins-table th, .besoins-table td {
  border: 1px solid var(--gray-200);
  padding: 8px 10px;
  font-size: 13px;
}
.besoins-student-name { font-weight: 600; white-space: nowrap; }

.besoins-icon-toggle {
  font-size: 18px;
  cursor: pointer;
  display: inline-block;
  padding: 2px 4px;
  border-radius: 4px;
  color: var(--gray-300);
  transition: all .1s;
  user-select: none;
}
.besoins-icon-toggle:hover { background: var(--gray-100); }
.besoins-icon-toggle.active { color: inherit; }

.besoins-notes-input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 12px;
  padding: 2px 4px;
  outline: none;
  color: var(--gray-700);
  min-width: 120px;
}
.besoins-notes-input:focus { background: var(--blue-light); border-radius: 4px; }

/* ===== INFOS DIVERSES ===== */
.infos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.infos-card { display: flex; flex-direction: column; }

.infos-textarea {
  flex: 1;
  min-height: 160px;
  width: 100%;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  color: var(--gray-700);
  resize: vertical;
  outline: none;
  font-family: inherit;
  line-height: 1.5;
  transition: border-color .15s;
}
.infos-textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,.12); }

/* ===== VACATION COLOR PICKER POPUP ===== */
.vac-color-picker-popup {
  position: absolute;
  z-index: 2000;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  padding: 14px;
  min-width: 200px;
}
.vac-color-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-600);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.vac-color-swatches {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.vac-color-swatch {
  width: 28px; height: 28px;
  border-radius: 6px;
  cursor: pointer;
  transition: transform .1s, box-shadow .1s;
}
.vac-color-swatch:hover { transform: scale(1.15); box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.vac-color-swatch.selected { border-width: 2px !important; box-shadow: 0 0 0 2px var(--blue); }

/* ===== PARASCOLAIRE ===== */
.parascolaire-table-wrap { overflow-x: auto; }

.parascolaire-table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
}
.parascolaire-table th, .parascolaire-table td {
  border: 1px solid var(--gray-200);
  padding: 8px 10px;
  font-size: 13px;
}
.para-name-cell { font-weight: 600; }

.para-inline-input {
  border: none;
  background: transparent;
  font-size: 12px;
  padding: 2px 4px;
  outline: none;
  width: 100%;
  min-width: 60px;
  color: var(--gray-700);
}
.para-inline-input:focus { background: var(--blue-light); border-radius: 4px; }

/* ===== OUTILS DE CLASSE ===== */
.outils-section { /* tab content wrapper */ }

.tirage-zone {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--gray-50);
  border: 2px dashed var(--gray-200);
}
.tirage-placeholder { color: var(--gray-400); font-size: 14px; }

.tirage-winner {
  font-size: 40px;
  font-weight: 800;
  color: var(--blue);
  text-align: center;
}

@keyframes tiragePop {
  0%   { transform: scale(0.5); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}
.tirage-animate { animation: tiragePop .5s cubic-bezier(.34,1.56,.64,1) forwards; }

.tirage-history {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.tirage-history-chip {
  background: var(--blue-light);
  color: var(--blue-dark);
  border-radius: 99px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
}

.groupes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.groupe-card {
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  padding: 14px;
  background: white;
}
.groupe-card-title { font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.groupe-members { display: flex; flex-direction: column; gap: 4px; }
.groupe-member { font-size: 13px; color: var(--gray-700); padding: 4px 8px; background: var(--gray-50); border-radius: 6px; }

/* ===== ANNIVERSAIRES ===== */
.bday-upcoming-list { display: flex; flex-direction: column; gap: 6px; }
.bday-upcoming-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
}
.bday-upcoming-item.bday-today { background: #fffbeb; border-color: var(--amber); }
.bday-name { font-weight: 600; flex: 1; }
.bday-date { font-size: 13px; color: var(--gray-500); }
.bday-days { font-size: 13px; font-weight: 600; color: var(--amber); }

.bday-months-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.bday-month-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.bday-month-name {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-500);
  margin-bottom: 8px;
}
.bday-empty { font-size: 12px; color: var(--gray-300); }
.bday-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 13px;
  color: var(--gray-700);
}
.bday-item.bday-today { color: var(--amber); font-weight: 700; }
.bday-item-actions { display: flex; align-items: center; gap: 2px; }
.bday-day { font-size: 11px; color: var(--gray-400); margin-right: 4px; }

/* ===== NOTES LAYOUT ===== */
.notes-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  height: calc(100vh - 200px);
  min-height: 500px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  background: white;
  box-shadow: var(--shadow);
}

.notes-list-panel {
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  background: var(--gray-50);
}

.notes-list-header {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid var(--gray-200);
}

.notes-list {
  flex: 1;
  overflow-y: auto;
}

.notes-list-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-200);
  cursor: pointer;
  transition: background .1s;
}
.notes-list-item:hover { background: var(--gray-100); }
.notes-list-item.active { background: var(--blue-light); border-left: 3px solid var(--blue); }

.notes-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notes-item-date { font-size: 11px; color: var(--gray-400); }
.notes-list-empty { padding: 24px; text-align: center; color: var(--gray-400); font-size: 13px; }

.notes-editor-panel {
  display: flex;
  flex-direction: column;
  padding: 0;
}
.notes-editor-header {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-200);
}
.notes-title-input {
  flex: 1;
  border: none;
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-800);
  background: transparent;
  padding: 4px 8px;
  outline: none;
}
.notes-title-input:focus { background: var(--gray-50); border-radius: 6px; }

.notes-content-textarea {
  flex: 1;
  border: none;
  outline: none;
  padding: 16px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--gray-700);
  resize: none;
  font-family: inherit;
  height: 100%;
}

.notes-editor-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  font-size: 14px;
}

/* ===== TODO LIST ===== */
.todo-header-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.todo-categories { display: flex; flex-direction: column; gap: 20px; }

.todo-category { background: white; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border: 1px solid var(--gray-100); }

.todo-cat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-left: 10px;
}

.todo-cat-label { font-size: 16px; font-weight: 700; color: var(--gray-800); flex: 1; }

.todo-cat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  padding: 0 8px;
}

.todo-items-list { display: flex; flex-direction: column; gap: 4px; }

.todo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  transition: background .1s;
}
.todo-item:hover { background: var(--gray-100); }
.todo-item.todo-done { opacity: .5; }

.todo-check { width: 16px; height: 16px; cursor: pointer; flex-shrink: 0; }

.todo-item-body { flex: 1; display: flex; align-items: center; gap: 10px; }
.todo-item-text { font-size: 14px; color: var(--gray-800); }
.todo-done .todo-item-text { text-decoration: line-through; }
.todo-item-due { font-size: 11px; color: var(--gray-400); background: var(--gray-100); padding: 2px 6px; border-radius: 99px; }

.todo-add-inline { padding: 8px 0 4px; }

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 12px;
  line-height: 1;
  border-radius: 4px;
  color: var(--gray-400);
  transition: color .1s, background .1s;
}
.btn-icon:hover { background: var(--gray-100); color: var(--gray-600); }

/* ===== ENTRETIENS PARENTS ===== */
.entretiens-list { display: flex; flex-direction: column; gap: 10px; }

.entretien-card {
  background: white;
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-100);
  border-left: 4px solid var(--gray-300);
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.entretien-avenir  { border-left-color: var(--blue); }
.entretien-fait    { border-left-color: var(--green); opacity: .75; }
.entretien-overdue { border-left-color: var(--red); background: #fff8f8; }

.entretien-card-main { flex: 1; }
.entretien-student { font-size: 16px; font-weight: 700; color: var(--gray-800); margin-bottom: 4px; }
.entretien-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--gray-500); margin-bottom: 6px; }
.entretien-type { font-weight: 600; }
.entretien-notes-preview { font-size: 13px; color: var(--gray-500); font-style: italic; }

.entretien-card-actions { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }

/* ===== COMPTABILITÉ ===== */
.compta-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.compta-summary-chip {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.compta-summary-chip strong { font-size: 16px; color: var(--gray-800); }

.compta-table-wrap { overflow-x: auto; }
.compta-table { min-width: 800px; width: 100%; border-collapse: collapse; }
.compta-table th, .compta-table td { border-bottom: 1px solid var(--gray-100); padding: 10px 12px; font-size: 13px; }
.compta-table tfoot td { border-top: 2px solid var(--gray-200); border-bottom: none; background: var(--gray-50); }
.compta-total { font-size: 16px; }
.compta-pos { color: var(--green-dark); }
.compta-neg { color: var(--red); }

/* ===== PRÊT DE MATÉRIEL ===== */
.pret-table-wrap { overflow-x: auto; }
.pret-table { min-width: 700px; width: 100%; border-collapse: collapse; }
.pret-table th, .pret-table td { border-bottom: 1px solid var(--gray-100); padding: 10px 12px; font-size: 13px; }
.pret-overdue { background: #fff8f8 !important; }
.pret-overdue td { color: var(--red); }

/* ===== DOCS D'ÉCOLE ===== */
.docs-categories { display: flex; flex-direction: column; gap: 24px; }

.docs-category-group { }

.docs-cat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 12px;
}
.docs-cat-label { font-size: 15px; font-weight: 700; color: var(--gray-800); flex: 1; }
.docs-cat-count { font-size: 12px; font-weight: 600; color: var(--gray-400); background: var(--gray-100); border-radius: 99px; padding: 2px 8px; }

.docs-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.doc-card {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-100);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.doc-card-title { font-size: 14px; font-weight: 700; color: var(--gray-800); }
.doc-card-notes { font-size: 12px; color: var(--gray-500); flex: 1; }
.doc-card-footer { display: flex; gap: 6px; align-items: center; margin-top: auto; }

.docs-empty-cat { font-size: 13px; color: var(--gray-300); padding: 8px 0; }

/* ===== MISC HELPERS ===== */
.flex { display: flex; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.w-full { width: 100%; }
.text-sm { font-size: 13px; }
.text-gray { color: var(--gray-500); }
.hidden { display: none !important; }
.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 12px; }
.alert-error { background: var(--red-light); color: #dc2626; border: 1px solid #fecaca; }

/* ===== LANDING — 3 cartes ===== */
.landing-cards-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
}
/* Override original 2-card layout when 3 cards are used */
.landing-cards-3 .landing-card {
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 20px;
  border: 2px solid transparent;
  gap: 10px;
}
.landing-cards-3 .landing-card .landing-arrow {
  position: static;
  font-size: 18px;
}
.landing-cards-3 .landing-teacher { border-color: #dbeafe; }
.landing-cards-3 .landing-teacher:hover { border-color: var(--blue); background: var(--blue-light); border-left: 2px solid var(--blue); }
.landing-cards-3 .landing-student { border-color: #d1fae5; }
.landing-cards-3 .landing-student:hover { border-color: var(--green); background: var(--green-light); border-left: 2px solid var(--green); }
.landing-cards-3 .landing-parent { border-color: #ede9fe; }
.landing-cards-3 .landing-parent:hover { border-color: #8b5cf6; background: #f5f3ff; border-left: 2px solid #8b5cf6; }
@media (max-width: 620px) {
  .landing-cards-3 { grid-template-columns: 1fr; }
  .landing-cards-3 .landing-card { flex-direction: row; text-align: left; padding: 18px 20px; }
}

/* ===== PORTAIL PARENT ===== */
.parent-app {
  min-height: 100vh;
  background: var(--gray-50);
  display: flex;
  flex-direction: column;
}
.parent-header {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.parent-header-left { display: flex; align-items: center; gap: 12px; }
.parent-header-logo { font-size: 24px; }
.parent-header-title { font-size: 18px; font-weight: 800; color: var(--gray-800); }
.parent-header-subtitle { font-size: 13px; color: var(--gray-500); }
.parent-header-right { display: flex; align-items: center; gap: 10px; }
.parent-header-name { font-size: 13px; color: var(--gray-600); font-weight: 600; }
.parent-content { flex: 1; padding: 24px; max-width: 860px; margin: 0 auto; width: 100%; }
.parent-tabs {
  display: flex;
  gap: 4px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 6px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.parent-tab-btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: calc(var(--radius) - 2px);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--gray-500);
  transition: all .15s;
}
.parent-tab-btn.active {
  background: var(--blue);
  color: white;
  box-shadow: 0 2px 8px rgba(59,130,246,.3);
}
.parent-tab-btn:not(.active):hover { background: var(--gray-100); color: var(--gray-700); }

/* Devoir items parent */
.parent-week-group { margin-bottom: 24px; }
.parent-week-label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-400);
  margin-bottom: 10px;
}
.parent-devoir-item {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 8px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  box-shadow: var(--shadow);
}
.parent-devoir-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue);
  margin-top: 5px;
  flex-shrink: 0;
}
.parent-devoir-body { flex: 1; min-width: 0; }
.parent-devoir-title { font-size: 15px; font-weight: 700; color: var(--gray-800); margin-bottom: 4px; }
.parent-devoir-content { font-size: 13px; color: var(--gray-600); line-height: 1.5; }
.parent-devoir-due {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
  background: var(--blue-light);
  padding: 2px 8px;
  border-radius: 99px;
}
.parent-commentaire-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.parent-commentaire-week {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 8px;
}
.parent-commentaire-text { font-size: 14px; color: var(--gray-700); line-height: 1.6; }
.parent-rappel-item {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 8px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  box-shadow: var(--shadow);
  transition: opacity .2s;
}
.parent-rappel-item.past { opacity: .5; }
.parent-rappel-icon {
  font-size: 22px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.parent-rappel-body { flex: 1; }
.parent-rappel-title { font-size: 15px; font-weight: 700; color: var(--gray-800); }
.parent-rappel-date { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.parent-rappel-content { font-size: 13px; color: var(--gray-600); margin-top: 4px; line-height: 1.5; }
.parent-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-400);
  font-size: 14px;
}
.parent-empty-icon { font-size: 40px; margin-bottom: 12px; }

/* ===== PLAN DE TRAVAIL ===== */
.pt-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.pt-plans-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.pt-plan-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow .15s, transform .15s;
  cursor: pointer;
}
.pt-plan-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.pt-plan-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.pt-plan-title { font-size: 15px; font-weight: 700; color: var(--gray-800); }
.pt-status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  text-transform: capitalize;
  flex-shrink: 0;
}
.pt-status-brouillon { background: var(--gray-100); color: var(--gray-500); }
.pt-status-actif { background: #d1fae5; color: #065f46; }
.pt-status-archivé { background: #fef9c3; color: #713f12; }
.pt-plan-meta { font-size: 12px; color: var(--gray-500); display: flex; gap: 10px; flex-wrap: wrap; }
.pt-plan-desc { font-size: 13px; color: var(--gray-600); line-height: 1.5; }
.pt-plan-footer { display: flex; gap: 6px; justify-content: flex-end; margin-top: auto; }

/* Activities in plan modal */
.pt-activity-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  border: 1px solid var(--gray-100);
}
.pt-activity-name { flex: 1; font-size: 14px; color: var(--gray-700); }
.pt-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 600px) { .pt-settings-grid { grid-template-columns: 1fr; } }

/* Catalogue activities */
.pt-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.pt-catalog-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 13px;
  cursor: pointer;
  transition: all .12s;
}
.pt-catalog-card:hover { border-color: var(--blue); background: var(--blue-light); }
.pt-catalog-card-title { font-weight: 700; color: var(--gray-800); margin-bottom: 4px; }
.pt-catalog-card-meta { color: var(--gray-400); font-size: 11px; }

/* ===== DEVOIRS & COMMENTAIRES PARENTS (enseignant) ===== */
.dp-week-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.dp-week-label { font-size: 13px; font-weight: 700; color: var(--gray-700); }
.dp-items-list { display: flex; flex-direction: column; gap: 10px; }
.dp-item {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.dp-item-body { flex: 1; min-width: 0; }
.dp-item-title { font-size: 15px; font-weight: 700; color: var(--gray-800); }
.dp-item-content { font-size: 13px; color: var(--gray-600); margin-top: 4px; line-height: 1.5; }
.dp-item-meta { font-size: 11px; color: var(--gray-400); margin-top: 6px; display: flex; gap: 10px; flex-wrap: wrap; }
.dp-item-actions { display: flex; gap: 6px; flex-shrink: 0; }
.dp-rappel-item {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  box-shadow: var(--shadow);
  margin-bottom: 8px;
}
.dp-rappel-icon {
  font-size: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--gray-100);
}
.dp-rappel-body { flex: 1; }
.dp-rappel-title { font-size: 15px; font-weight: 700; color: var(--gray-800); }
.dp-rappel-meta { font-size: 12px; color: var(--gray-500); margin-top: 2px; }

/* ===== LIENS UTILES ===== */
.liens-filter-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.liens-cat-group { margin-bottom: 24px; }
.liens-cat-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-400);
  margin-bottom: 10px;
}
.liens-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.lien-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: all .15s;
  text-decoration: none;
}
.lien-card:hover { border-color: var(--blue); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(59,130,246,.12); }
.lien-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  background: var(--blue-light);
}
.lien-card-info { flex: 1; min-width: 0; }
.lien-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lien-card-url {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lien-card-delete {
  font-size: 14px;
  color: var(--gray-300);
  cursor: pointer;
  background: none;
  border: none;
  padding: 2px;
  line-height: 1;
  flex-shrink: 0;
  transition: color .12s;
}
.lien-card-delete:hover { color: var(--red); }

/* ===== ESPACE DUO ===== */
.duo-messages-container {
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: #f8fafc;
  border-radius: var(--radius);
  margin-bottom: 12px;
  border: 1px solid var(--gray-100);
}
.duo-msg-row { display: flex; align-items: flex-end; gap: 8px; }
.duo-msg-row.moi { flex-direction: row-reverse; }
.duo-msg-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
}
.duo-msg-bubble.moi { background: var(--blue); color: white; border-bottom-right-radius: 4px; }
.duo-msg-bubble.other { background: white; color: var(--gray-800); border: 1px solid var(--gray-200); border-bottom-left-radius: 4px; }
.duo-msg-time { font-size: 10px; opacity: .6; margin-top: 4px; text-align: right; }

/* ===== ESPACE REMPLACEMENT ===== */
.rempl-layout { display: flex; flex-direction: column; gap: 20px; }
.rempl-section { background: white; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.rempl-section-title { font-size: 15px; font-weight: 800; color: var(--gray-800); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.rempl-save-indicator { font-size: 12px; color: var(--green); font-weight: 500; margin-left: auto; }
.rempl-doc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  border: 1px solid var(--gray-100);
}
.rempl-doc-name { flex: 1; font-size: 14px; font-weight: 600; color: var(--gray-700); }
.rempl-doc-url { font-size: 12px; color: var(--gray-400); }
.rempl-code-box {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .1em;
  color: var(--blue);
  font-family: monospace;
}

/* ===== QUILL EDITOR overrides ===== */
.notes-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  height: calc(100vh - 180px);
  min-height: 500px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.notes-list-panel {
  border-right: 1px solid var(--gray-100);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.notes-list-header {
  padding: 12px;
  border-bottom: 1px solid var(--gray-100);
}
.notes-list {
  flex: 1;
  overflow-y: auto;
}
.notes-list-empty { padding: 20px; font-size: 13px; color: var(--gray-400); text-align: center; }
.notes-list-item {
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--gray-50);
  transition: background .1s;
}
.notes-list-item:hover { background: var(--gray-50); }
.notes-list-item.active { background: var(--blue-light); border-left: 3px solid var(--blue); }
.notes-item-title { font-size: 14px; font-weight: 600; color: var(--gray-800); margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes-item-date { font-size: 11px; color: var(--gray-400); }
.notes-editor-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.notes-editor-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.notes-title-input {
  flex: 1;
  font-size: 16px;
  font-weight: 700;
  border: none;
  outline: none;
  padding: 4px 0;
  background: transparent;
  color: var(--gray-800);
}
.notes-title-input:focus { box-shadow: none; border: none; }
.notes-editor-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: var(--gray-400);
  font-size: 14px;
  text-align: center;
}

/* Quill toolbar inside notes */
#quill-toolbar {
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  border-bottom: 1px solid var(--gray-100) !important;
  flex-shrink: 0;
}
#quill-editor {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  font-size: 15px;
}
#quill-editor .ql-editor { min-height: 100%; font-size: 15px; line-height: 1.7; padding: 16px 20px; }
.ql-container { border: none !important; flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.ql-toolbar.ql-snow { border: none; border-bottom: 1px solid var(--gray-100) !important; }

@media (max-width: 768px) {
  .notes-layout { grid-template-columns: 1fr; height: auto; }
  .notes-list-panel { max-height: 200px; border-right: none; border-bottom: 1px solid var(--gray-100); }
  .pt-plans-list { grid-template-columns: 1fr; }
  .liens-grid { grid-template-columns: 1fr; }
  .parent-tabs { flex-direction: column; }
}

/* ===== JEUX ÉLÈVES ===== */
.games-hub {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.game-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all .18s;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.game-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--blue); }
.game-card-icon { font-size: 40px; margin-bottom: 10px; }
.game-card-title { font-size: 16px; font-weight: 800; color: var(--gray-800); margin-bottom: 6px; }
.game-card-desc { font-size: 13px; color: var(--gray-500); line-height: 1.4; }
.game-fullscreen {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  min-height: 400px;
}

/* Tetris */
.tetris-wrapper {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}
#tetris-canvas {
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-sm);
  image-rendering: pixelated;
  display: block;
}
#tetris-next {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  display: block;
  margin-top: 8px;
}
.tetris-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 90px;
}
.tetris-info { text-align: center; }
.tetris-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-400); font-weight: 700; }
.tetris-val { font-size: 24px; font-weight: 900; color: var(--gray-800); }

/* Puissance 4 */
.p4-grid {
  display: grid;
  grid-template-columns: repeat(7, 44px);
  grid-template-rows: repeat(6, 44px);
  gap: 4px;
  background: #2563eb;
  border-radius: var(--radius);
  padding: 8px;
  width: fit-content;
}
.p4-cell {
  width: 44px;
  height: 44px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .1s;
}
.p4-cell:hover { background: #dbeafe; }
.p4-disc {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  box-shadow: inset 0 -3px 6px rgba(0,0,0,.2);
}

/* Mémoire */
.memory-grid {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.memory-card {
  aspect-ratio: 1;
  cursor: pointer;
  perspective: 600px;
  min-height: 64px;
}
.memory-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform .4s;
  border-radius: var(--radius-sm);
}
.memory-card.flipped .memory-card-inner { transform: rotateY(180deg); }
.memory-card-front, .memory-card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  border: 2px solid var(--gray-200);
}
.memory-card-front {
  background: var(--blue);
  color: white;
  font-size: 20px;
  font-weight: 700;
}
.memory-card-back {
  background: white;
  transform: rotateY(180deg);
}
.memory-card.matched .memory-card-back {
  background: var(--green-light);
  border-color: var(--green);
}

/* Défi Maths */
.mathquiz-wrapper { max-width: 480px; }
.mathquiz-stats {
  display: flex;
  gap: 16px;
  font-size: 15px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.mathquiz-problem {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--gray-50);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 12px;
  transition: background .2s, border-color .2s;
}
.mathquiz-expr { font-size: 28px; font-weight: 800; color: var(--gray-800); }
.mathquiz-input {
  font-size: 24px;
  font-weight: 800;
  width: 100px;
  text-align: center;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  outline: none;
  color: var(--gray-800);
}
.mathquiz-input:focus { border-color: var(--blue); }
.mathquiz-result { text-align: center; padding: 40px 24px; }
.mathquiz-result h3 { font-size: 22px; font-weight: 800; margin: 12px 0 8px; }
.mathquiz-result p { font-size: 16px; color: var(--gray-600); margin-bottom: 6px; }

/* ===== AMIS / COLLÈGUES ===== */
.amis-list { display: flex; flex-direction: column; gap: 10px; }
.amis-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  transition: all .15s;
}
.amis-card:hover { border-color: var(--blue-dark); }
.amis-avatar { font-size: 26px; flex-shrink: 0; }
.amis-info { flex: 1; min-width: 0; }
.amis-name { font-size: 15px; font-weight: 700; color: var(--gray-800); }
.amis-meta { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.amis-resources-list { display: flex; flex-direction: column; gap: 10px; }
.amis-res-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.amis-res-title { font-size: 15px; font-weight: 700; color: var(--gray-800); margin-bottom: 4px; }
.amis-res-desc { font-size: 13px; color: var(--gray-600); line-height: 1.5; }
.amis-res-link { font-size: 13px; color: var(--blue); text-decoration: none; margin-top: 6px; display: inline-block; }
.amis-res-link:hover { text-decoration: underline; }

/* ===== ESPACE COMMUN ===== */
.commun-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.commun-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow .15s;
}
.commun-card:hover { box-shadow: var(--shadow-md); }
.commun-card-header { display: flex; align-items: center; justify-content: space-between; }
.commun-cat-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--blue-light);
  color: var(--blue-dark);
}
.commun-card-title { font-size: 15px; font-weight: 800; color: var(--gray-800); line-height: 1.3; }
.commun-card-desc { font-size: 13px; color: var(--gray-600); line-height: 1.5; flex: 1; }
.commun-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}
.commun-author { font-size: 12px; color: var(--gray-400); }
.commun-like-btn { transition: color .12s; }
.commun-like-btn.liked { color: #ef4444; }

/* ===== COMPORTEMENT & AVATARS ===== */
.behavior-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}
.behavior-student-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.behavior-student-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--blue); }
.behavior-avatar-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.behavior-student-name { font-size: 14px; font-weight: 700; color: var(--gray-800); }
.behavior-points-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
}

/* ===== COMMUNICATION ===== */
.comms-announce-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.comms-announce-title { font-size: 16px; font-weight: 800; color: var(--gray-800); margin-bottom: 6px; }
.comms-announce-content { font-size: 14px; color: var(--gray-600); line-height: 1.6; margin-bottom: 8px; white-space: pre-wrap; }
.comms-announce-meta { font-size: 12px; color: var(--gray-400); }
.comms-thread-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  transition: all .15s;
}
.comms-thread-item:hover { border-color: var(--blue); background: var(--blue-light); }

/* ===== ABSENCES ===== */
.absences-grid { width: 100%; border-collapse: collapse; }
.absences-grid th { background: var(--gray-50); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--gray-500); padding: 10px 8px; text-align: center; }
.absences-grid tbody tr:nth-child(even) { background: var(--gray-50); }
.abs-day-header { width: 90px; text-align: center; }
.abs-student-name { font-weight: 700; font-size: 14px; color: var(--gray-800); padding: 8px 14px; white-space: nowrap; }
.abs-cell-td { padding: 6px 8px; text-align: center; }
.absences-cell {
  width: 52px; height: 36px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  font-size: 16px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .12s;
}
.abs-present  { background: #dcfce7; border-color: #16a34a; }
.abs-absent   { background: #fee2e2; border-color: #dc2626; }
.abs-retard   { background: #fef3c7; border-color: #d97706; }
.absences-cell:hover { transform: scale(1.12); }
.abs-week-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.abs-week-label { font-weight: 700; color: var(--gray-800); font-size: 15px; }
.abs-summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 0; }
.abs-summary-chip { font-size: 13px; font-weight: 700; padding: 6px 14px; border-radius: 99px; }
.abs-absent-chip  { background: #fee2e2; color: #dc2626; }
.abs-retard-chip  { background: #fef3c7; color: #d97706; }

/* ===== GÉNÉRATEURS ===== */
.generators-hub {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.generator-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 24px 20px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
  box-shadow: var(--shadow);
  transition: all .15s;
}
.generator-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--blue); }
.gen-card-icon { font-size: 36px; }
.gen-card-title { font-size: 16px; font-weight: 800; color: var(--gray-800); }
.gen-card-desc  { font-size: 13px; color: var(--gray-500); flex: 1; }
.generator-form { display: flex; flex-direction: column; gap: 12px; }
.generator-form .form-group { margin-bottom: 0; }
.gen-output {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.gen-output-inner { font-family: Georgia, serif; }
.gen-output-header { margin-bottom: 20px; }
.gen-output-header h2 { font-size: 20px; font-weight: 900; color: var(--gray-900); margin-bottom: 8px; }
.gen-output-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--gray-600); border-top: 1px solid var(--gray-200); padding-top: 8px; margin-top: 8px; }
.gen-ex-grid { display: grid; gap: 12px; margin-top: 16px; }
.gen-ex-item { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; background: #f8fafc; border-radius: 8px; border: 1px solid var(--gray-200); }
.gen-ex-num { font-weight: 900; color: var(--blue); min-width: 24px; }
.gen-ex-text { font-size: 18px; font-weight: 700; color: var(--gray-800); font-family: monospace; }
.gen-ex-space { width: 100%; height: 32px; border-bottom: 1px solid var(--gray-300); margin-top: 8px; }
.gen-dicte-box { background: #f8fafc; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); padding: 16px 20px; margin-top: 12px; }
.gen-mots-cles h4 { font-size: 14px; font-weight: 800; color: var(--gray-700); }
.gen-prob-item { padding: 16px; background: #f8fafc; border-radius: var(--radius-sm); border: 1px solid var(--gray-200); }
.gen-prob-num { font-size: 12px; font-weight: 800; text-transform: uppercase; color: var(--blue); letter-spacing: .05em; display: block; margin-bottom: 6px; }
.gen-prob-text { font-size: 16px; color: var(--gray-800); line-height: 1.5; margin-bottom: 10px; }
.gen-prob-space { padding: 8px 12px; background: white; border-radius: 6px; border: 1px solid var(--gray-200); }
.gen-act-section { margin-bottom: 14px; font-size: 14px; line-height: 1.6; color: var(--gray-800); }
.gen-voc-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.gen-voc-table th { background: var(--gray-100); font-size: 12px; font-weight: 800; text-transform: uppercase; color: var(--gray-500); padding: 8px 12px; text-align: left; border-bottom: 2px solid var(--gray-200); }
.gen-voc-table td { padding: 8px 12px; border-bottom: 1px solid var(--gray-100); font-size: 14px; }
.gen-voc-table tr:hover td { background: var(--blue-light); }
@media print {
  .no-print { display: none !important; }
  .sidebar, .navbar, nav, header, .tabs-bar { display: none !important; }
  body { background: white !important; }
  .gen-output, .gen-output-inner, .code-print-sheet, .gen-dicte-box { box-shadow: none; border: none; }
  .absences-grid th, .absences-grid td { border: 1px solid #ccc; }
}

/* ===== PRINT — codes élèves uniquement ===== */
@media print {
  body > * { display: none !important; }
  #app { display: block !important; }
  #app > * { display: none !important; }
  .teacher-app { display: block !important; }
  .sidebar { display: none !important; }
  .teacher-content { display: block !important; }
  .main-content { display: block !important; padding: 0 !important; max-width: 100% !important; }
  .no-print { display: none !important; }
  .section-header { display: none !important; }
  .stats-grid { display: none !important; }
  .students-tabs .tabs-bar { display: none !important; }
  .code-print-sheet { display: grid !important; }
}

/* ===== STUDENTS TABS ===== */
.students-tabs { margin-top: 16px; }
.toggle-switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; gap: 8px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  display: inline-block; width: 42px; height: 24px;
  background: var(--gray-300); border-radius: 99px; position: relative;
  transition: background .2s;
}
.toggle-slider::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%; background: white;
  transition: left .2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--green); }
.toggle-switch input:checked + .toggle-slider::after { left: 21px; }

/* ===== BOUTIQUE ===== */
.boutique-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: white; border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.boutique-item-emoji { font-size: 22px; }
.boutique-item-label { font-size: 14px; font-weight: 700; color: var(--gray-800); flex: 1; }
.boutique-modal .modal { max-height: 80vh; overflow-y: auto; }

/* ===== LEVEL BADGES ===== */
.level-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 800;
  padding: 3px 10px; border-radius: 99px;
  text-transform: uppercase; letter-spacing: .04em;
}
.level-bronze  { background: #fef3c7; color: #92400e; }
.level-argent  { background: #f1f5f9; color: #475569; }
.level-or      { background: #fef9c3; color: #854d0e; }
.level-diamant { background: #ede9fe; color: #5b21b6; }

/* ===== PARENT ACCOUNTS ===== */
.parent-account-card {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; background: white;
  border: 1px solid var(--gray-200); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.parent-card-info { flex: 1; min-width: 150px; }
.parent-card-name { font-size: 15px; font-weight: 800; color: var(--gray-800); }
.parent-card-email { margin-top: 2px; }
.parent-card-code { }
.code-display {
  font-family: monospace; font-size: 18px; font-weight: 900;
  letter-spacing: 3px; color: var(--blue);
  background: var(--blue-light); padding: 6px 14px; border-radius: 8px;
}
.parent-card-actions { display: flex; gap: 6px; }

/* ===== PRINTABLE CODE SHEET ===== */
.code-print-sheet { margin-top: 16px; }
.codes-grid-2col { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.codes-grid-1col { display: flex; flex-direction: column; gap: 12px; }
.code-print-card {
  background: white; border: 2px solid var(--gray-200); border-radius: var(--radius);
  padding: 20px; text-align: center; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.code-print-logo { font-size: 13px; color: var(--gray-400); font-weight: 700; }
.code-print-class { font-size: 13px; color: var(--gray-500); }
.code-print-name  { font-size: 22px; font-weight: 900; color: var(--gray-800); }
.code-print-code  { font-family: monospace; font-size: 32px; font-weight: 900; letter-spacing: 4px; color: var(--blue); background: var(--blue-light); padding: 8px 16px; border-radius: 10px; margin-top: 4px; }

/* ===== JEUX MGMT ===== */
.jeux-mgmt-grid { display: flex; flex-direction: column; gap: 10px; }
.jeux-mgmt-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; background: white;
  border: 1px solid var(--gray-200); border-radius: var(--radius);
  box-shadow: var(--shadow); transition: all .15s;
}
.jeux-mgmt-card.disabled { opacity: 0.6; }
.jeux-mgmt-icon { font-size: 28px; }
.jeux-mgmt-info { flex: 1; }
.jeux-mgmt-title { font-size: 15px; font-weight: 800; color: var(--gray-800); }
.jeux-mgmt-desc  { font-size: 13px; color: var(--gray-500); }
.jeux-status-label { font-size: 13px; font-weight: 700; min-width: 90px; text-align: right; }

/* ===== DOWNLOADS ===== */
.download-item {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; background: white;
  border: 1px solid var(--gray-200); border-radius: var(--radius);
  box-shadow: var(--shadow); transition: box-shadow .15s;
  margin-bottom: 8px;
}
.download-item:hover { box-shadow: var(--shadow-md); }
.dl-icon { font-size: 28px; }
.dl-info { flex: 1; min-width: 150px; }
.dl-title { font-size: 15px; font-weight: 800; color: var(--gray-800); }
.dl-meta  { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.dl-actions { display: flex; gap: 6px; }

/* ===== CATALOGUE STANDALONE ===== */
.catalogue-standalone { }
.pt-catalog-card {
  background: white; border: 1px solid var(--gray-200); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column;
  gap: 6px; transition: all .15s;
}
.pt-catalog-card:hover { box-shadow: var(--shadow-md); border-color: var(--blue); }


/* ═══════════════════════════════════════════════════════════
   GRILLE HORAIRE v2 — structure PER / DIP Genève
   ═══════════════════════════════════════════════════════════ */
.grille-v2-card { padding: 20px; }

.grille-v2-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.grille-v2-subtitle {
  font-size: 12px;
  color: var(--gray-400);
  margin: 4px 0 0;
}

/* Table */
.grille-table-v2 {
  border-collapse: collapse;
  min-width: 720px;
  width: 100%;
  font-size: 13px;
}
.grille-table-v2 th,
.grille-table-v2 td {
  border: 1px solid var(--gray-200);
  padding: 0;
}

/* Header row */
.grille-v2-domain-th {
  text-align: left;
  padding: 8px 14px;
  background: var(--gray-100);
  font-size: 12px;
  font-weight: 600;
  min-width: 260px;
  white-space: nowrap;
}
.grille-v2-deg-th {
  text-align: center;
  padding: 8px 4px;
  background: var(--gray-100);
  font-size: 12px;
  font-weight: 700;
  min-width: 50px;
  color: var(--primary);
}

/* Cycle sub-header */
.grille-cycle-row td { border-top: none; }
.grille-cycle-cell {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--gray-500);
  letter-spacing: .03em;
  padding: 3px 4px;
  background: var(--gray-50);
  border-bottom: 2px solid var(--gray-300);
}

/* Domain header row */
.grille-v2-domain-row td {
  background: var(--domain-bg, #f1f5f9);
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-700);
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* Subject rows */
.grille-v2-sub-row:hover { background: var(--gray-50); }
.grille-v2-sub-cell {
  padding: 5px 8px 5px 22px;
  color: var(--gray-700);
  white-space: nowrap;
}
.grille-v2-num-cell {
  text-align: center;
  padding: 0;
}

/* Inputs */
.grille-cell-input {
  width: 46px;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 13px;
  padding: 6px 2px;
  color: var(--gray-800);
  font-weight: 500;
}
.grille-cell-input.grille-ref-val {
  color: var(--gray-400);
  font-style: italic;
}
.grille-cell-input:focus {
  outline: 2px solid var(--primary);
  border-radius: 3px;
  background: #eff6ff;
  color: var(--gray-900);
  font-style: normal;
}

/* Total row */
.grille-v2-total-row {
  background: var(--gray-100);
  border-top: 2px solid var(--gray-300);
}
.grille-v2-total-label {
  padding: 8px 14px;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--gray-700);
}
.grille-v2-total-cell {
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  padding: 8px 4px;
  color: var(--primary);
}

/* Footnote */
.grille-v2-footnote {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 10px;
  line-height: 1.5;
}

/* ─── Grille horaire — Sélecteur de degré ─────────────────── */
.grille-deg-selector {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  margin-top: 14px;
}
.grille-deg-selector-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.grille-deg-selector-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  white-space: nowrap;
  min-width: 110px;
}
.grille-deg-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.grille-deg-btn {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border: 2px solid var(--gray-300);
  border-radius: 20px;
  background: #fff;
  color: var(--gray-600);
  cursor: pointer;
  transition: all .15s;
}
.grille-deg-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #eff6ff;
}
.grille-deg-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.grille-show-all-btn {
  align-self: flex-start;
  font-size: 12px;
  padding: 4px 10px;
}

/* Badge degré courant */
.grille-current-deg-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--primary-light, #eff6ff);
  border: 1px solid var(--primary);
  border-radius: 20px;
  font-size: 13px;
  color: var(--primary);
}

/* Table en mode filtré — colonnes plus larges */
.grille-filtered .grille-v2-deg-th {
  min-width: 90px;
  font-size: 15px;
}
.grille-filtered .grille-cell-input {
  width: 80px;
  font-size: 15px;
  padding: 8px 4px;
}
.grille-filtered .grille-v2-total-cell {
  font-size: 16px;
}

/* Grille — hint texte sous le sélecteur */
.grille-deg-hint {
  font-size: 12px;
  color: var(--gray-500);
  margin: 2px 0 0;
  padding-left: 2px;
}

/* ─── FÊTES OBLIGATOIRES (calendrier annuel) ─────────────────────────────── */
.annual-fete-oblig {
  position: relative;
  background: #fef9c3;
  border-radius: 4px;
}
.annual-fete-dot {
  position: absolute;
  bottom: -2px;
  right: 0;
  font-size: 8px;
  line-height: 1;
}

/* ─── GRILLE CONFORMITÉ ──────────────────────────────────────────────────── */
.grille-conform-card {
  padding: 0;
  overflow: hidden;
}
.grille-conform-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--gray-50, #f8fafc);
  border-bottom: 1px solid var(--gray-200, #e2e8f0);
  user-select: none;
}
.grille-conform-header:hover {
  background: var(--gray-100, #f1f5f9);
}
.grille-conform-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--gray-700, #374151);
}
.grille-conform-chevron {
  font-size: 12px;
  color: var(--gray-400);
}
.grille-conform-body {
  padding: 16px;
}
.grille-conform-deg-block {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-100, #f1f5f9);
}
.grille-conform-deg-block:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.grille-conform-deg-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 15px;
}
.grille-conform-status {
  font-size: 13px;
  padding: 2px 10px;
  border-radius: 20px;
}
.conform-ok {
  background: #dcfce7;
  color: #166534;
}
.conform-warn {
  background: #fef9c3;
  color: #713f12;
}
.grille-conform-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 6px;
}
.grille-conform-table th {
  text-align: left;
  padding: 5px 10px;
  background: var(--gray-50);
  font-weight: 600;
  color: var(--gray-600);
  border-bottom: 1px solid var(--gray-200);
}
.grille-conform-table td {
  padding: 5px 10px;
  border-bottom: 1px solid var(--gray-100);
}
.conform-ref   { color: var(--gray-500); }
.conform-user  { font-weight: 600; }
.conform-plus  { color: #16a34a; font-weight: 600; }
.conform-minus { color: #dc2626; font-weight: 600; }
.conform-ok-msg {
  font-size: 13px;
  color: #166534;
  background: #dcfce7;
  padding: 8px 12px;
  border-radius: 6px;
  margin: 0;
}

/* ─── AMÉNAGEMENTS FORMELS ───────────────────────────────────────────────── */
.amenage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}
.amenage-card {
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 16px;
  background: #fff;
}
.amenage-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.amenage-card-name {
  font-weight: 600;
  font-size: 15px;
}
.amenage-badge {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.amenage-badge-attente  { background: #fef9c3; color: #713f12; }
.amenage-badge-accorde  { background: #dcfce7; color: #166534; }
.amenage-badge-refuse   { background: #fee2e2; color: #991b1b; }
.amenage-badge-expire   { background: var(--gray-100); color: var(--gray-500); }
.amenage-detail {
  font-size: 13px;
  color: var(--gray-600);
  margin-bottom: 4px;
}
.amenage-expiry-warn  { color: #d97706; font-weight: 600; }
.amenage-expiry-alert { color: #dc2626; font-weight: 600; }
.amenage-deadline-banner {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #92400e;
}

/* ─── CO-INTERVENANTS ────────────────────────────────────────────────────── */
.cointerv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.cointerv-card {
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 16px;
  background: #fff;
}
.cointerv-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: #fff;
  flex-shrink: 0;
}
.cointerv-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.cointerv-name {
  font-weight: 600;
  font-size: 15px;
}
.cointerv-role-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--primary-light, #eff6ff);
  color: var(--primary);
}
.cointerv-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}
.cointerv-chip {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--gray-100);
  color: var(--gray-600);
}
.cointerv-detail {
  font-size: 13px;
  color: var(--gray-600);
  margin-bottom: 3px;
}

/* ─── PLANIFICATEUR PER ──────────────────────────────────────────────────── */
.planper-deg-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.planper-deg-btn {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--gray-300);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  transition: all .15s;
}
.planper-deg-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.planper-disc-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--gray-200);
  padding-bottom: 4px;
}
.planper-disc-tab {
  padding: 5px 12px;
  border-radius: 6px 6px 0 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  color: var(--gray-600);
  transition: all .15s;
}
.planper-disc-tab.active {
  background: var(--primary);
  color: #fff;
}
.planper-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.planper-sem-title {
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 15px;
  color: var(--gray-700);
}
.planper-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--gray-100);
}
.planper-status-btn {
  font-size: 20px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 2px;
  line-height: 1;
  transition: transform .1s;
}
.planper-status-btn:hover { transform: scale(1.2); }
.planper-item-label {
  font-size: 13px;
  flex: 1;
  color: var(--gray-700);
}
.planper-progress-wrap {
  margin-top: 12px;
}
.planper-progress-bar {
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}
.planper-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width .3s;
}
.planper-progress-label {
  font-size: 12px;
  color: var(--gray-500);
}

/* ─── COMMENTAIRES BULLETIN ──────────────────────────────────────────────── */
.cbul-deadline-banner {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 600;
}
.cbul-deadline-green  { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.cbul-deadline-orange { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.cbul-deadline-red    { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.cbul-sem-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.cbul-student-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.cbul-student-chip {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--gray-300);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  transition: all .15s;
}
.cbul-student-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.cbul-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.cbul-field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cbul-field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}
.cbul-textarea {
  width: 100%;
  padding: 8px;
  border: 1.5px solid var(--gray-200);
  border-radius: 6px;
  font-size: 13px;
  resize: vertical;
  min-height: 70px;
  font-family: inherit;
  transition: border-color .15s;
  box-sizing: border-box;
}
.cbul-textarea:focus {
  border-color: var(--primary);
  outline: none;
}
.cbul-char-counter {
  font-size: 11px;
  color: var(--gray-400);
  text-align: right;
}
.cbul-char-counter.warn { color: #d97706; }
.cbul-char-counter.over { color: #dc2626; }
.cbul-templates {
  margin-top: 6px;
}
.cbul-template-btn {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid var(--gray-200);
  background: #fff;
  cursor: pointer;
  margin: 2px;
  color: var(--gray-600);
  transition: all .15s;
}
.cbul-template-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ═══════════════════════════════════════════════════════════════
   LANDING PAGE  (.lp-*)
   ═══════════════════════════════════════════════════════════════ */

.lp-root {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #0f172a;
  background: #fff;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── BOUTONS ─────────────────────────────────────────────────── */
.lp-btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: 10px;
  background: linear-gradient(135deg, #a78bfa, #8b5cf6); color: #fff;
  font-weight: 700; font-size: 15px;
  border: none; cursor: pointer;
  transition: background .15s, transform .12s, box-shadow .15s;
  box-shadow: 0 2px 10px rgba(167,139,250,.3);
}
.lp-btn-primary:hover { background: linear-gradient(135deg, #8b5cf6, #7c3aed); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(167,139,250,.4); }

.lp-btn-outline {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: 10px;
  border: 2px solid #e2e8f0; color: #334155;
  font-weight: 600; font-size: 15px;
  background: #fff; cursor: pointer;
  transition: border-color .15s, color .15s, transform .12s;
}
.lp-btn-outline:hover { border-color: #3b82f6; color: #3b82f6; transform: translateY(-2px); }

.lp-btn-ghost {
  background: none; border: none; cursor: pointer;
  font-size: 14px; font-weight: 600; color: #475569;
  padding: 8px 14px; border-radius: 8px;
  transition: color .15s, background .15s;
}
.lp-btn-ghost:hover { color: #3b82f6; background: #eff6ff; }

.lp-btn-lg { padding: 15px 32px; font-size: 16px; border-radius: 12px; }
.lp-btn-sm { padding: 8px 18px; font-size: 13px; }

/* ── NAVBAR ──────────────────────────────────────────────────── */
.lp-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #e2e8f0;
}
.lp-nav-inner {
  max-width: 1140px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; height: 62px;
}
.lp-nav-logo {
  display: flex; align-items: center; gap: 9px;
  font-size: 20px; font-weight: 900; color: #0f172a;
  text-decoration: none; letter-spacing: -.3px;
}
.lp-nav-logo span { font-size: 26px; }
.lp-nav-actions { display: flex; align-items: center; gap: 8px; }

/* ── HERO ────────────────────────────────────────────────────── */
.lp-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr;
  align-items: center;
  gap: 0 64px;
  max-width: 1140px; margin: 0 auto;
  padding: 48px 32px 96px;
  min-height: calc(100vh - 62px);
}
.lp-hero-inner { max-width: 560px; align-self: center; }
.lp-hero-visual { align-self: center; }

.lp-hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 14px; border-radius: 20px;
  background: linear-gradient(135deg, #faf5ff, #ede9fe); color: #7c3aed;
  font-size: 12px; font-weight: 600; margin-bottom: 28px;
  border: 1px solid #c4b5fd; letter-spacing: .2px;
}

.lp-hero-title {
  font-size: clamp(42px, 5vw, 68px);
  font-weight: 900; line-height: 1.05;
  letter-spacing: -2px; margin-bottom: 20px;
  color: #0f172a;
}
.lp-hero-accent {
  background: linear-gradient(135deg, #a855f7, #8b5cf6, #6366f1);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.lp-hero-sub {
  font-size: 17px; color: #64748b; margin-bottom: 36px;
  line-height: 1.65; max-width: 480px;
}

.lp-hero-btns { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 48px; }

.lp-hero-stats {
  display: flex; align-items: center; gap: 0;
  padding: 18px 24px; background: #f8fafc;
  border: 1px solid #e2e8f0; border-radius: 14px;
  flex-wrap: wrap; gap: 8px;
}
.lp-stat { text-align: center; padding: 0 20px; }
.lp-stat strong { display: block; font-size: 22px; font-weight: 800; color: #0f172a; line-height: 1; }
.lp-stat span   { font-size: 11px; color: #94a3b8; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; display: block; }
.lp-stat-sep    { width: 1px; height: 36px; background: #e2e8f0; flex-shrink: 0; }

/* ── HERO VISUAL ─────────────────────────────────────────────── */
.lp-hero-visual {
  position: relative; height: 420px;
}
.lp-hero-card {
  position: absolute;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,.08);
  overflow: hidden;
  transition: transform .3s;
}
.lp-hero-card:hover { transform: translateY(-4px) !important; }

.lp-hc-1 { width: 240px; top: 20px; left: 30px; }
.lp-hc-2 { width: 220px; top: 110px; right: 10px; z-index: 2;
  box-shadow: 0 16px 48px rgba(0,0,0,.12); }
.lp-hc-3 { width: 220px; bottom: 20px; left: 60px; }

.lp-hc-bar { height: 4px; border-radius: 2px; margin-bottom: 14px; margin: -20px -20px 14px; }
.lp-hc-line { height: 10px; background: #f1f5f9; border-radius: 5px; margin-bottom: 8px; }
.lp-hc-line.w80 { width: 80%; }
.lp-hc-line.w70 { width: 70%; }
.lp-hc-line.w60 { width: 60%; }
.lp-hc-line.w45 { width: 45%; }

.lp-hc-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.lp-chip {
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px;
}
.lp-chip.blue   { background: #dbeafe; color: #1d4ed8; }
.lp-chip.green  { background: #dcfce7; color: #166534; }
.lp-chip.amber  { background: #fef9c3; color: #713f12; }

.lp-hc-avatar-row { display: flex; align-items: center; gap: 4px; margin-bottom: 12px; }
.lp-av {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  border: 2px solid #fff;
}
.lp-hc-more { font-size: 12px; color: #94a3b8; font-weight: 600; margin-left: 4px; }

/* ── SECTIONS ────────────────────────────────────────────────── */
.lp-section { padding: 96px 32px; }
.lp-section-gray { background: #f8fafc; }
.lp-section-dark { background: linear-gradient(135deg, #1e3a5f, #1e1b4b); }
.lp-section-inner { max-width: 1140px; margin: 0 auto; }

.lp-eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: var(--primary); margin-bottom: 10px;
}
.lp-eyebrow-light { color: #93c5fd; }
.lp-section-title {
  font-size: clamp(28px, 4vw, 42px); font-weight: 800;
  letter-spacing: -1px; color: #0f172a; margin-bottom: 12px;
}
.lp-title-light { color: #fff; }
.lp-section-sub { font-size: 17px; color: #64748b; max-width: 540px; margin-bottom: 56px; }

/* ── ESPACES ─────────────────────────────────────────────────── */
.lp-espaces {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px; margin-top: 48px;
}
.lp-espace-right { display: flex; flex-direction: column; gap: 20px; }

.lp-espace {
  border-radius: 20px; padding: 32px;
  border: 2px solid transparent;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.lp-espace:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(0,0,0,.1); }

.lp-espace-teacher { background: linear-gradient(135deg, #eff6ff, #e0f2fe); border-color: #bfdbfe; }
.lp-espace-student { background: linear-gradient(135deg, #f0fdf4, #dcfce7); }
.lp-espace-parent  { background: linear-gradient(135deg, #fffbeb, #fef9c3); }
.lp-espace-teacher:hover { border-color: #3b82f6; }
.lp-espace-student:hover { border-color: #10b981; }
.lp-espace-parent:hover  { border-color: #f59e0b; }

.lp-espace-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.lp-espace-icon { font-size: 36px; }
.lp-espace-title { font-size: 20px; font-weight: 800; color: #0f172a; }
.lp-espace-role  { font-size: 12px; color: #64748b; font-weight: 600; letter-spacing: .3px; margin-top: 1px; }
.lp-espace-desc  { font-size: 14px; color: #475569; margin-bottom: 18px; }

.lp-espace-list {
  list-style: none; display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 24px;
}
.lp-espace-list li {
  font-size: 13px; color: #334155;
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0;
}
.lp-espace-list li::before {
  content: '✓'; font-weight: 800; color: #3b82f6; font-size: 13px;
  flex-shrink: 0;
}

.lp-espace-btn {
  width: 100%; padding: 11px 20px; border-radius: 10px;
  font-weight: 700; font-size: 14px; cursor: pointer;
  border: none; transition: transform .12s, box-shadow .15s;
}
.lp-espace-btn:hover { transform: translateY(-2px); }
.lp-espace-btn-teacher { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; box-shadow: 0 2px 12px rgba(99,102,241,.35); }
.lp-espace-btn-teacher:hover { background: linear-gradient(135deg, var(--primary-dark), var(--primary-darker)); box-shadow: 0 6px 18px rgba(99,102,241,.45); }
.lp-espace-btn-student { background: #10b981; color: #fff; }
.lp-espace-btn-student:hover { background: #059669; }
.lp-espace-btn-parent  { background: #f59e0b; color: #fff; }
.lp-espace-btn-parent:hover  { background: #d97706; }

/* ── FEATURES ────────────────────────────────────────────────── */
.lp-feat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px; margin-top: 48px;
}
.lp-feat {
  padding: 28px; border-radius: 16px;
  border: 1.5px solid #e2e8f0; background: #fff;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.lp-feat:hover { border-color: #3b82f6; transform: translateY(-4px); box-shadow: 0 12px 32px rgba(59,130,246,.1); }
.lp-feat-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; margin-bottom: 16px;
}
.lp-feat-title { font-size: 16px; font-weight: 700; color: #0f172a; margin-bottom: 7px; }
.lp-feat-desc  { font-size: 13px; color: #64748b; line-height: 1.55; }

/* ── GENÈVE ──────────────────────────────────────────────────── */
.lp-geneve-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px; margin-top: 48px;
}
.lp-geneve-item {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px; padding: 22px 20px;
  transition: background .2s;
}
.lp-geneve-item:hover { background: rgba(255,255,255,.13); }
.lp-geneve-icon  { font-size: 28px; margin-bottom: 10px; display: block; }
.lp-geneve-title { font-size: 14px; font-weight: 700; color: #e2e8f0; margin-bottom: 5px; }
.lp-geneve-desc  { font-size: 13px; color: #94a3b8; line-height: 1.5; }

/* ── CTA FINAL ───────────────────────────────────────────────── */
.lp-cta-section {
  background: linear-gradient(135deg, #eff6ff, #f5f3ff);
  padding: 96px 32px; text-align: center;
}
.lp-cta-inner { max-width: 600px; margin: 0 auto; }
.lp-cta-title { font-size: clamp(28px, 4vw, 42px); font-weight: 800; letter-spacing: -1px; color: #0f172a; margin-bottom: 12px; }
.lp-cta-sub   { font-size: 15px; color: #64748b; margin-bottom: 36px; }

/* ── FOOTER ──────────────────────────────────────────────────── */
.lp-footer {
  background: #0f172a; color: #64748b;
  padding: 32px; text-align: center; font-size: 13px;
}
.lp-footer-logo { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; color: #fff; margin-bottom: 8px; justify-content: center; }
.lp-footer-logo-img { width: 36px; height: 36px; border-radius: 50%; opacity: .85; }
.lp-footer-note { color: #334155; font-size: 12px; margin-top: 6px; }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .lp-hero { grid-template-columns: 1fr; gap: 0; padding: 48px 24px 72px; }
  .lp-hero-logo-wrap { padding-bottom: 28px; }
  .lp-hero-visual { display: none; }
  .lp-espaces { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .lp-nav-inner { padding: 0 20px; }
  .lp-section { padding: 64px 20px; }
  .lp-hero-stats { flex-direction: column; gap: 12px; }
  .lp-stat-sep { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   TEACHER SETUP / PROFIL (.setup-*)
   ═══════════════════════════════════════════════════════════════ */

.setup-page {
  position: fixed;
  inset: 0;
  overflow-y: auto;
  background: linear-gradient(135deg, #fce7f3 0%, #e9d5ff 30%, #c4b5fd 60%, #818cf8 100%);
  padding: 48px 24px 64px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 10;
}
.setup-page::before {
  content: '';
  position: fixed;
  width: 520px; height: 520px;
  top: -180px; right: -120px;
  background: radial-gradient(circle, rgba(167,139,250,.40) 0%, transparent 70%);
  pointer-events: none;
  animation: blob-drift 8s ease-in-out infinite alternate;
  z-index: -1;
}
.setup-page::after {
  content: '';
  position: fixed;
  width: 420px; height: 420px;
  bottom: -120px; left: -80px;
  background: radial-gradient(circle, rgba(232,121,249,.30) 0%, transparent 70%);
  pointer-events: none;
  animation: blob-drift 10s ease-in-out infinite alternate-reverse;
  z-index: -1;
}

.setup-card {
  background: #fff;
  border-radius: 24px;
  padding: 40px;
  width: 100%;
  max-width: 580px;
  box-shadow: 0 24px 64px rgba(139,92,246,.22);
}

.setup-header { text-align: center; margin-bottom: 36px; }
.setup-logo { font-size: 52px; margin-bottom: 12px; }
.setup-title { font-size: 26px; font-weight: 800; color: #1e1b4b; letter-spacing: -.5px; margin-bottom: 8px; }
.setup-sub { font-size: 14px; color: #64748b; max-width: 420px; margin: 0 auto; line-height: 1.6; }

.setup-section { margin-bottom: 28px; }

.setup-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: #1e1b4b;
  margin-bottom: 12px;
}
.setup-label-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.setup-multi-hint { font-size: 12px; font-weight: 500; color: #94a3b8; }

.setup-roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.setup-role-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 2px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  transition: all .15s;
  text-align: left;
  font-family: inherit;
}
.setup-role-btn:hover { border-color: #c4b5fd; background: #faf5ff; }
.setup-role-btn.active {
  border-color: #8b5cf6;
  background: linear-gradient(135deg, #ede9fe, #faf5ff);
  box-shadow: 0 0 0 1px #8b5cf6;
}
.setup-role-icon { font-size: 22px; flex-shrink: 0; }
.setup-role-label { font-size: 13px; font-weight: 600; color: #374151; }
.setup-role-btn.active .setup-role-label { color: #7c3aed; }

.setup-actions { margin-top: 32px; }

/* ═══════════════════════════════════════════════════════════════
   MON COMPTE (.compte-*)
   ═══════════════════════════════════════════════════════════════ */

.compte-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 20px;
  align-items: start;
}
@media (max-width: 780px) { .compte-grid { grid-template-columns: 1fr; } }

/* Card with coloured top bar */
.compte-card {
  position: relative;
  overflow: hidden;
  padding-top: 28px;
}
.compte-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, var(--primary), var(--primary-mid));
}

.compte-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.compte-card-icon { font-size: 22px; flex-shrink: 0; }
.compte-card-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--gray-800);
  margin: 0;
}

.compte-card-footer {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.compte-save-msg {
  font-size: 13px;
  font-weight: 600;
  color: var(--green-dark);
  background: var(--green-light);
  padding: 4px 10px;
  border-radius: 6px;
}

.form-hint { font-size: 12px; color: var(--gray-400); margin-top: 4px; }

.compte-roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}

/* Abonnement */
.compte-abo-card .compte-card::before {
  background: linear-gradient(90deg, #f59e0b, #f97316);
}

.compte-abo-plan-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #fffbeb, #fef9c3);
  border-radius: var(--radius-sm);
  border: 1px solid #fde68a;
  margin-bottom: 16px;
}
.compte-abo-plan-emoji { font-size: 32px; flex-shrink: 0; }
.compte-abo-plan-name { font-size: 15px; font-weight: 800; color: var(--gray-800); }
.compte-abo-plan-desc { font-size: 12px; color: var(--gray-500); margin-top: 1px; }

.compte-abo-feats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.compte-abo-feat { font-size: 14px; color: var(--gray-700); line-height: 1.4; }
.compte-abo-locked { color: var(--gray-400); }

.compte-pro-btn {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
  font-weight: 700;
  border: none;
  cursor: pointer;
  width: 100%;
  transition: transform .15s, box-shadow .15s;
}
.compte-pro-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(249,115,22,.35); }

/* Danger zone */
.compte-danger-card { border: 1px solid #fecaca !important; }
.compte-danger-card::before { background: linear-gradient(90deg, #ef4444, #f87171) !important; }

/* ===== LOGO IMAGES ===== */

/* Loading screen */
.loading-logo-img {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  box-shadow: 0 8px 32px rgba(0,0,0,.22), 0 2px 8px rgba(0,0,0,.12);
  display: block;
}

/* Auth card (horizontal logo) */
.auth-logo-img {
  width: 260px;
  max-width: 100%;
  display: block;
  margin: 0 auto 6px;
  border-radius: var(--radius-sm);
}
.auth-logo p { color: var(--gray-500); font-size: 14px; margin-top: 2px; }

/* Setup page */
.setup-logo-img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  box-shadow: 0 6px 20px rgba(139,92,246,.25);
  display: block;
  margin: 0 auto;
}

/* Sidebar */
.sidebar-logo-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

/* Landing navbar */
.lp-nav-logo-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 6px;
  box-shadow: 0 2px 8px rgba(139,92,246,.30);
}

/* Landing hero logo — pleine largeur */
.lp-hero-logo-wrap {
  grid-column: 1 / -1;
  width: 100%;
  padding-bottom: 40px;
}
.lp-hero-logo-img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 6px 32px rgba(139,92,246,.35));
}

/* ===== MODALE CHOIX D'ESPACE ===== */
.lp-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.lp-modal-overlay.lp-modal-open {
  opacity: 1;
  pointer-events: all;
}
.lp-modal-card {
  background: #fff;
  border-radius: 28px;
  padding: 36px 28px 28px;
  max-width: 440px;
  width: 100%;
  position: relative;
  box-shadow: 0 32px 80px rgba(0,0,0,.22), 0 8px 24px rgba(139,92,246,.15);
  transform: translateY(16px) scale(.97);
  transition: transform .25s ease, opacity .2s ease;
  opacity: 0;
}
.lp-modal-overlay.lp-modal-open .lp-modal-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.lp-modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px;
  background: #f1f5f9; border: none; border-radius: 50%;
  font-size: 13px; cursor: pointer; color: #64748b;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.lp-modal-close:hover { background: #e2e8f0; color: #1e293b; }
.lp-modal-top { text-align: center; margin-bottom: 24px; }
.lp-modal-logo-img {
  width: 64px; height: 64px; border-radius: 50%;
  box-shadow: 0 4px 16px rgba(139,92,246,.25);
  margin: 0 auto 12px;
  display: block;
}
.lp-modal-title { font-size: 22px; font-weight: 800; color: #0f172a; margin-bottom: 4px; }
.lp-modal-sub   { font-size: 14px; color: #64748b; }
.lp-modal-choices { display: flex; flex-direction: column; gap: 10px; }
.lp-modal-choice {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border: 2px solid #e2e8f0; border-radius: 16px;
  background: #fff; cursor: pointer; text-align: left;
  transition: border-color .15s, background .15s, transform .15s, box-shadow .15s;
  width: 100%;
}
.lp-modal-choice:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.lp-mc-icon  { font-size: 30px; flex-shrink: 0; width: 42px; text-align: center; }
.lp-mc-body  { flex: 1; }
.lp-mc-label { font-size: 15px; font-weight: 700; color: #0f172a; line-height: 1.2; }
.lp-mc-desc  { font-size: 12px; color: #64748b; margin-top: 2px; }
.lp-mc-arrow { font-size: 16px; color: #a78bfa; flex-shrink: 0; font-weight: 700; }
.lp-mc-teacher:hover { border-color: #8b5cf6; background: #f5f3ff; }
.lp-mc-student:hover { border-color: #3b82f6; background: #eff6ff; }
.lp-mc-parent:hover  { border-color: #10b981; background: #f0fdf4; }

/* ===== EMAIL PENDING SCREEN ===== */
.email-pending-icon {
  font-size: 64px;
  margin: 8px 0 16px;
  animation: ep-bounce .8s ease infinite alternate;
}
@keyframes ep-bounce {
  from { transform: translateY(0); }
  to   { transform: translateY(-8px); }
}
.text-primary { color: var(--primary-dark); }

/* ===== SCHOOL MULTI-SELECT ===== */
.school-multiselect { position: relative; }
.school-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: white;
  border: 1.5px solid var(--primary-mid);
  border-radius: var(--radius-sm);
  max-height: 220px;
  overflow-y: auto;
  z-index: 200;
  box-shadow: var(--shadow-md);
}
.school-dropdown.hidden { display: none; }
.school-dropdown-group {
  padding: 5px 12px 2px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-400);
  background: var(--gray-50);
  position: sticky;
  top: 0;
}
.school-dropdown-item {
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  transition: background .1s;
  color: var(--gray-700);
}
.school-dropdown-item:hover,
.school-dropdown-item.selected { background: var(--primary-light); color: var(--primary-darker); }
.school-dropdown-item.selected::after { content: ' ✓'; font-weight: 700; }
.school-dropdown-empty {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--gray-400);
  font-style: italic;
}
.school-dropdown-add {
  padding: 9px 14px;
  font-size: 13px;
  cursor: pointer;
  color: var(--primary-darker);
  border-top: 1px dashed var(--primary-mid);
  margin-top: 2px;
  transition: background .1s;
}
.school-dropdown-add:hover { background: var(--primary-light); }
.school-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  min-height: 28px;
}
.school-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: linear-gradient(135deg, var(--primary-light), #faf5ff);
  color: var(--primary-darker);
  border: 1px solid var(--primary-mid);
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
}
.school-chip-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--primary-dark);
  font-size: 14px;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
}
.school-chip-remove:hover { color: var(--red); }

/* ===== BEHAVIOR BULK ACTIONS ===== */
.beh-bulk-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: linear-gradient(135deg, var(--primary-light), #faf5ff);
  border-radius: var(--radius-sm);
  border: 1px solid var(--primary-mid);
  margin-bottom: 16px;
}
.beh-bulk-bar .beh-bulk-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-darker);
  white-space: nowrap;
}
.beh-class-total {
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
  background: white;
  padding: 4px 12px;
  border-radius: 99px;
  border: 1px solid var(--primary-mid);
  white-space: nowrap;
}
.behavior-student-card.selected-for-bulk {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}
.beh-select-checkbox {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}
.behavior-student-card { position: relative; }
