/*
 * LAME — Module LEÇON : styles spécifiques
 * Dépend de assets/css/design-system.css (variables partagées LAME)
 */

/* ══════════════════════════════════════════
   BASE (reprise des variables LAME)
   Les variables --bg, --gold, etc. viennent
   de ../../assets/css/design-system.css
══════════════════════════════════════════ */

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

:root {
  /* Surcharges locales si design-system.css non chargé */
  --bg:       #0c1220;
  --surface:  #111d2e;
  --surface2: #192537;
  --surface3: #223148;
  --gold:     #C9A84C;
  --gold-pale: rgba(201,168,76,0.12);
  --border-gold: rgba(201,168,76,0.35);
  --blue:     #4A9EE0;
  --blue-dim: rgba(74,158,224,0.13);
  --blue-b:   rgba(74,158,224,0.30);
  --red:      #E05A4A;
  --red-dim:  rgba(224,90,74,0.13);
  --green:    #3ecc88;
  --green-dim: rgba(62,204,136,0.12);
  --green-b:  rgba(62,204,136,0.30);
  --text:     #E8EDF2;
  --text-dim: rgba(232,237,242,0.52);
  --text-faint: rgba(232,237,242,0.22);
  --border:   rgba(255,255,255,0.07);
  --border2:  rgba(255,255,255,0.11);
  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px;
}

html { font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ══════════════════════════════════════════
   TOPBAR — Navigation principale LEÇON
══════════════════════════════════════════ */
.topbar {
  display: flex;
  align-items: center;
  height: 54px;
  padding: 0 20px;
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: rgba(9, 14, 26, 0.97);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  position: sticky; top: 0; z-index: 100;
}

/* Marque LAME */
.topbar-brand {
  font-family: var(--font-display);
  font-size: 21px;
  letter-spacing: 0.12em;
  color: var(--gold);
  text-decoration: none;
  line-height: 1;
  flex-shrink: 0;
  transition: opacity 0.18s;
}
.topbar-brand:hover { opacity: 0.75; text-decoration: none; }

/* Séparateur vertical */
.topbar-brand::after {
  content: '';
  display: inline-block;
  width: 1px; height: 18px;
  background: var(--border2);
  margin: 0 12px 0 14px;
  vertical-align: middle;
}

/* Label module "Leçons" */
.topbar-module {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-right: auto; /* pousse les liens vers la droite */
  user-select: none;
}

/* Lien Imprimer : discret, icône externe */
.topbar-print {
  color: var(--text-faint) !important;
  font-size: 11.5px !important;
}
.topbar-print:hover {
  color: var(--blue) !important;
  background: rgba(74,158,224,0.08) !important;
}

/* Liens de navigation */
.topbar-links {
  display: flex;
  align-items: center;
  gap: 2px;
}

.topbar-links a {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 11px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  white-space: nowrap;
  letter-spacing: 0.01em;
  position: relative;
}
.topbar-links a:hover {
  color: var(--text);
  background: rgba(255,255,255,0.07);
  text-decoration: none;
}

/* ── État actif : page en cours ── */
.topbar-links a.active {
  color: var(--gold);
  background: rgba(201,168,76,0.14);
  border-color: rgba(201,168,76,0.30);
}
.topbar-links a.active::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 20%; right: 20%;
  height: 2px;
  background: var(--gold);
  border-radius: 2px 2px 0 0;
}

/* Lien déconnexion */
.topbar-links a[href$="logout.php"] {
  color: rgba(232,237,242,0.28);
  margin-left: 4px;
}
.topbar-links a[href$="logout.php"]:hover {
  color: var(--red);
  background: rgba(224,90,74,0.09);
}

/* Nom utilisateur (span, pas un lien) */
.topbar-links .topbar-user {
  font-size: 11.5px;
  color: var(--text-faint);
  padding: 0 10px 0 6px;
  border-right: 1px solid var(--border2);
  margin-right: 4px;
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ══════════════════════════════════════════
   LAYOUT PAGE
══════════════════════════════════════════ */
.lecon-container {
  max-width: 960px; margin: 0 auto; padding: 20px 16px 60px;
}
.lecon-container--wide {
  max-width: 1200px;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 6vw, 44px);
  letter-spacing: 0.04em; line-height: 1;
  margin-bottom: 4px; color: var(--text);
}
.page-title em {
  font-style: normal; color: var(--gold);
}
.page-subtitle {
  font-size: 12px; color: var(--text-faint);
  letter-spacing: 0.10em; text-transform: uppercase; margin-bottom: 24px;
}

/* ══════════════════════════════════════════
   CARTES GÉNÉRIQUES
══════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--r-lg);
  padding: 18px;
  margin-bottom: 14px;
}
.card--gold   { border-top: 2px solid var(--gold); }
.card--blue   { border-top: 2px solid var(--blue); }
.card--green  { border-top: 2px solid var(--green); }
.card--red    { border-top: 2px solid var(--red); }

.card-title {
  font-family: var(--font-display);
  font-size: 18px; letter-spacing: 0.04em; margin-bottom: 12px; color: var(--gold);
}

/* ══════════════════════════════════════════
   BOUTONS
══════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--r-sm); border: none;
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 150ms ease; text-decoration: none;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary {
  background: var(--gold); color: #0c1220; font-weight: 600;
}
.btn-primary:hover:not(:disabled) { opacity: .88; }

.btn-success {
  background: var(--green); color: #0c1220; font-weight: 600;
}
.btn-danger {
  background: var(--red); color: #fff; font-weight: 600;
}
.btn-outline {
  background: transparent; border: 1px solid var(--border2); color: var(--text-dim);
}
.btn-outline:hover { border-color: var(--border-gold); color: var(--gold); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-full { width: 100%; }

/* ══════════════════════════════════════════
   FORMULAIRES
══════════════════════════════════════════ */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block; font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--gold); font-weight: 500; margin-bottom: 5px;
}
.form-input, .form-select, .form-textarea {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 10px 12px; color: var(--text);
  font-family: var(--font-body); font-size: 14px;
  -webkit-appearance: none; appearance: none;
  transition: border-color 150ms;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--border-gold);
}
.form-input::placeholder { color: var(--text-faint); }
.form-select option { background: var(--surface2); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-error {
  font-size: 12px; color: var(--red); margin-top: 4px; display: none;
}
.form-error.visible { display: block; }
.form-info {
  font-size: 12px; color: var(--text-faint); margin-top: 4px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ══════════════════════════════════════════
   ALERTES / MESSAGES
══════════════════════════════════════════ */
.alert {
  padding: 12px 16px; border-radius: var(--r-sm); font-size: 13px; margin-bottom: 14px;
}
.alert-success { background: var(--green-dim); color: var(--green); border: 1px solid var(--green-b); }
.alert-error   { background: var(--red-dim);   color: var(--red);   border: 1px solid rgba(224,90,74,.3); }
.alert-info    { background: var(--blue-dim);   color: var(--blue);  border: 1px solid var(--blue-b); }
.alert-warning { background: var(--gold-pale);  color: var(--gold);  border: 1px solid var(--border-gold); }

/* ══════════════════════════════════════════
   TABLEAUX
══════════════════════════════════════════ */
.table-lame {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.table-lame th {
  background: var(--surface2); border-bottom: 1px solid var(--border);
  padding: 8px 12px; text-align: left;
  font-size: 10px; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--text-faint); font-weight: 500;
}
.table-lame td {
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table-lame tr:hover td { background: var(--surface2); }
.table-lame tr:nth-child(even) td { background: rgba(255,255,255,.018); }

/* ══════════════════════════════════════════
   BADGES / TAGS
══════════════════════════════════════════ */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
}
.badge-fixe      { background: rgba(0,35,149,.2);  color: #6688dd; border: 1px solid rgba(0,35,149,.4); }
.badge-flexible  { background: var(--gold-pale);   color: var(--gold); border: 1px solid var(--border-gold); }
.badge-libre     { background: var(--green-dim);   color: var(--green); border: 1px solid var(--green-b); }
.badge-indispo   { background: var(--surface3);    color: var(--text-faint); border: 1px solid var(--border); }
.badge-annulee   { background: var(--red-dim);     color: var(--red); border: 1px solid rgba(224,90,74,.3); }
.badge-attente   { background: var(--gold-pale);   color: var(--gold); border: 1px solid var(--border-gold); }
.badge-competition { background: rgba(74,158,224,.15); color: var(--blue); border: 1px solid var(--blue-b); }
.badge-standard  { background: var(--surface3); color: var(--text-faint); border: 1px solid var(--border); }

/* ══════════════════════════════════════════
   CALENDRIER CUSTOM
══════════════════════════════════════════ */
.cal-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
}
.cal-title {
  font-family: var(--font-display);
  font-size: 22px; letter-spacing: 0.04em; color: var(--gold);
  text-transform: capitalize;
}
.cal-nav { display: flex; gap: 6px; }
.cal-nav-btn {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text-dim); padding: 6px 12px; border-radius: var(--r-sm);
  cursor: pointer; font-size: 14px; transition: all 150ms;
}
.cal-nav-btn:hover { border-color: var(--border-gold); color: var(--gold); }

.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden;
}

/* En-têtes jours */
.cal-header {
  background: var(--surface2); padding: 7px 4px; text-align: center;
  font-size: 10px; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--text-faint); font-weight: 500; user-select: none;
}

/* Cellules de base */
.cal-day {
  background: var(--surface); min-height: 68px; padding: 6px;
  cursor: default; transition: background 150ms; position: relative;
}
.cal-day.vide { background: rgba(6,9,18,0.88); }

/* ── Jours non réservables (pas mardi/jeudi) ── */
.cal-day.non-reservable {
  background: var(--bg);
}
.cal-day.non-reservable .cal-num {
  color: var(--text-faint);
  opacity: 0.45;
}

/* ── Jours réservables (mardi/jeudi) ── */
.cal-day.lecon-day {
  cursor: pointer;
  background: var(--surface3);
  border-top: 2px solid rgba(62,204,136,0.28);
}
.cal-day.lecon-day:hover:not(.past) {
  background: #293d5a;
  border-top-color: rgba(62,204,136,0.6);
}
.cal-day.lecon-day .cal-num { color: var(--text); }

/* ── Jours passés ── */
.cal-day.past {
  cursor: default;
}
.cal-day.past .cal-num {
  opacity: 0.35;
}
.cal-day.lecon-day.past {
  background: rgba(22,33,52,0.55);
  border-top-color: transparent;
}
.cal-day.lecon-day.past:hover { background: rgba(22,33,52,0.55); }

/* Strikethrough discret sur les jours passés non réservables */
.cal-day.non-reservable.past .cal-num {
  text-decoration: line-through;
  opacity: 0.25;
}

/* ── Aujourd'hui ── */
.cal-day.today {
  outline: 2px solid rgba(201,168,76,0.5);
  outline-offset: -2px;
}
.cal-day.today .cal-num {
  color: var(--gold) !important;
  font-weight: 700;
  opacity: 1 !important;
}

/* Numéro du jour */
.cal-num {
  display: block;
  font-size: 12px; font-weight: 500;
  color: var(--text-dim); margin-bottom: 4px;
}

/* Indicateurs de créneaux */
.cal-dot {
  display: block;
  width: 7px; height: 7px; border-radius: 50%;
  position: absolute; bottom: 6px; right: 6px;
}
.dot-libre   { background: var(--green);  box-shadow: 0 0 5px rgba(62,204,136,0.5); }
.dot-resa    { background: var(--blue);   box-shadow: 0 0 5px rgba(74,158,224,0.5); }
.dot-assign  { background: var(--gold);   box-shadow: 0 0 5px rgba(201,168,76,0.5); }
.past-dot    { opacity: 0.4; box-shadow: none; }

/* ── Vue journalière (détail créneaux) ── */
.day-panel {
  background: var(--surface); border: 1px solid var(--border-gold);
  border-radius: var(--r-lg); padding: 18px; margin-top: 16px;
}
.day-panel-title {
  font-family: var(--font-display);
  font-size: 20px; letter-spacing: 0.04em; color: var(--gold); margin-bottom: 14px;
}
.slot-list { display: flex; flex-direction: column; gap: 8px; }
.slot-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--surface2);
  transition: all 150ms;
}
.slot-item.libre { cursor: pointer; }
.slot-item.libre:hover {
  border-color: var(--green-b); background: var(--green-dim);
}
.slot-item.occupe    { opacity: .75; cursor: default; }
.slot-item.indispo   { opacity: .45; cursor: default; }

.slot-time {
  font-family: var(--font-display); font-size: 20px;
  color: var(--text); min-width: 54px;
}
.slot-enseignant { flex: 1; }
.slot-ens-name { font-size: 13px; font-weight: 500; color: var(--text); }
.slot-ens-titre { font-size: 11px; color: var(--text-faint); }
.slot-status { margin-left: auto; }

/* ══════════════════════════════════════════
   MODAL DE RÉSERVATION
══════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  z-index: 200; display: flex; align-items: flex-end; justify-content: center;
}
.modal-overlay.hidden { display: none; }
.modal-box,
.modal {
  background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 24px; width: 100%; max-width: 500px;
  border-top: 1px solid var(--border-gold);
  animation: slideUpM .22s ease both;
}
@keyframes slideUpM {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: none; }
}
.modal-title {
  font-family: var(--font-display);
  font-size: 22px; letter-spacing: 0.04em; color: var(--gold); margin-bottom: 4px;
}
.modal-subtitle { font-size: 13px; color: var(--text-dim); margin-bottom: 20px; }
.modal-close {
  float: right; background: none; border: none; color: var(--text-faint);
  font-size: 20px; cursor: pointer; margin-top: -4px;
}
.modal-close:hover { color: var(--text); }

/* Sélection enseignant */
.ens-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.ens-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--r-md);
  cursor: pointer; transition: all 150ms;
}
.ens-item:hover, .ens-item.selected {
  border-color: var(--border-gold); background: var(--gold-pale);
}
.ens-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 16px; color: var(--gold); flex-shrink: 0;
}
.ens-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.ens-info { flex: 1; }
.ens-name { font-size: 14px; font-weight: 500; }
.ens-titre { font-size: 11px; color: var(--text-faint); }
.ens-decomptee-info { font-size: 11px; color: var(--blue); margin-top: 2px; }

/* ══════════════════════════════════════════
   AVATAR UTILISATEUR
══════════════════════════════════════════ */
.user-avatar {
  position: relative;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface3); border: 2px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
  font-family: var(--font-display); font-weight: 700;
  font-size: 13px; color: var(--gold);
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-avatar.editable { cursor: pointer; }
.user-avatar.editable:hover .uav-overlay { opacity: 1; }
.uav-overlay {
  position: absolute; inset: 0; border-radius: 50%;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .18s; font-size: 18px;
}

/* Type fixe/flexible */
.type-choice { display: flex; gap: 8px; margin-bottom: 16px; }
.type-btn {
  flex: 1; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface2); color: var(--text-dim); cursor: pointer;
  text-align: left; transition: all 150ms; line-height: 1.4;
}
.type-btn:hover {
  border-color: var(--border-gold); background: var(--gold-pale); color: var(--text);
}
.type-btn.active, .type-btn.selected {
  border-color: var(--gold);
  background: rgba(201,168,76,0.18);
  color: var(--text);
  box-shadow: 0 0 0 2px rgba(201,168,76,0.18);
}
.type-btn.active strong { color: var(--gold); }
.type-btn strong { display: block; font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.type-btn small  { display: block; font-size: 11px; color: var(--text-faint); line-height: 1.35; }
.type-btn.active small { color: rgba(201,168,76,0.7); }
.type-btn-label { font-size: 13px; font-weight: 500; }
.type-btn-desc  { font-size: 11px; color: var(--text-faint); margin-top: 2px; }

/* ══════════════════════════════════════════
   COMPTEUR DE LEÇONS (profil)
══════════════════════════════════════════ */
.lecons-counter {
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px; background: var(--surface2); border-radius: var(--r-md);
  border: 1px solid var(--border-gold); margin-bottom: 20px;
}
.lecons-counter-header {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--text-dim);
}
.lecons-counter-header strong {
  font-family: var(--font-display); font-size: 20px; color: var(--gold);
}
.lecons-count {
  font-family: var(--font-display); font-size: 48px; color: var(--gold); line-height: 1;
}
.lecons-total { font-size: 18px; color: var(--text-faint); }
.lecons-info  { flex: 1; }
.lecons-label { font-size: 12px; color: var(--text-dim); margin-bottom: 4px; }
.lecons-bar {
  height: 6px; background: var(--surface3); border-radius: 999px; overflow: hidden;
}
.lecons-bar-fill {
  height: 100%; border-radius: 999px; background: var(--gold);
  transition: width .4s ease;
}
.lecons-bar-fill.warning { background: var(--orange, #e07b3a); }
.lecons-bar-fill.danger  { background: var(--red); }

/* ══════════════════════════════════════════
   METRIC CARDS (KPI admin)
══════════════════════════════════════════ */
.metric-card {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-top: 2px solid rgba(201,168,76,0.4);
  border-radius: var(--r-md);
  padding: 14px 16px;
}
.metric-value {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 4px;
}
.metric-label {
  font-size: 10px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ══════════════════════════════════════════
   PLANNING ADMIN (tableau multi-enseignants)
══════════════════════════════════════════ */
.planning-grid {
  display: grid; gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden;
  overflow-x: auto;
}
.planning-cell {
  background: var(--surface); padding: 8px; min-height: 60px; min-width: 120px;
}
.planning-header {
  background: var(--surface2); padding: 8px 12px; text-align: center;
  font-size: 11px; color: var(--text-dim); font-weight: 500;
}
.planning-time {
  background: var(--surface3); padding: 8px 10px;
  font-family: var(--font-display); font-size: 16px; color: var(--text-faint);
  text-align: center; white-space: nowrap;
}
.planning-resa {
  padding: 4px 8px; border-radius: var(--r-sm); font-size: 11px; margin-bottom: 3px;
  cursor: pointer; transition: opacity 150ms;
}
.planning-resa:hover { opacity: .8; }
.planning-resa.fixe     { background: rgba(0,35,149,.25); color: #8899ee; }
.planning-resa.flexible { background: var(--gold-pale); color: var(--gold); }
.planning-resa.libre    { background: var(--green-dim); color: var(--green); font-size: 10px; }
.planning-resa.indispo  { background: var(--surface3); color: var(--text-faint); font-size: 10px; }

/* ══════════════════════════════════════════
   FICHE ENSEIGNANT
══════════════════════════════════════════ */
.ens-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px; border: 1px solid var(--border);
  border-radius: var(--r-md); background: var(--surface2); margin-bottom: 8px;
}
.ens-card-avatar {
  width: 50px; height: 50px; border-radius: 50%;
  background: var(--surface3); border: 1px solid var(--border-gold);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 20px; color: var(--gold); flex-shrink: 0;
}
.ens-card-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.ens-card-info { flex: 1; }
.ens-card-name { font-size: 15px; font-weight: 500; }
.ens-card-titre { font-size: 12px; color: var(--gold); }
.ens-card-decomptee { font-size: 11px; color: var(--text-faint); margin-top: 2px; }

/* ══════════════════════════════════════════
   PAGE DE CONNEXION
══════════════════════════════════════════ */
.login-wrapper {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 400px;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--r-lg); padding: 32px;
}
.login-logo {
  text-align: center; margin-bottom: 24px;
}
.login-logo-title {
  font-family: var(--font-display);
  font-size: 42px; letter-spacing: 0.08em;
  background: linear-gradient(135deg,#d4a94e,#f0d080,#b8923a);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.login-logo-sub {
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-faint); margin-top: 4px;
}
.login-title {
  font-family: var(--font-display); font-size: 20px;
  letter-spacing: 0.04em; color: var(--text); margin-bottom: 20px; text-align: center;
}

/* ══════════════════════════════════════════
   SLOT LISTE — style créneau élève
══════════════════════════════════════════ */
.slot-heure { margin-bottom: 12px; }
.slot-heure > strong {
  display: block; font-size: 12px; letter-spacing: 0.08em;
  color: var(--text-faint); margin-bottom: 6px; text-transform: uppercase;
}
.slot-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--surface2);
  transition: all 150ms; margin-bottom: 6px; flex-wrap: wrap;
}
.slot-item.slot-libre { cursor: pointer; }
.slot-item.slot-libre:hover { border-color: var(--green-b); background: var(--green-dim); }
.slot-ens { flex: 1; font-size: 13px; font-weight: 500; color: var(--text); min-width: 120px; }
.slot-ens-anon { color: var(--text-dim); font-style: italic; font-weight: 400; }

/* ══════════════════════════════════════════
   HAMBURGER BUTTON
══════════════════════════════════════════ */
.topbar-hamburger {
  display: none;
  flex-direction: column; align-items: center; justify-content: center;
  width: 34px; height: 34px; gap: 5px;
  background: none; border: 1px solid var(--border2);
  border-radius: var(--r-sm); cursor: pointer; padding: 0;
  margin-left: 8px; flex-shrink: 0;
}
.topbar-hamburger span {
  display: block; width: 18px; height: 2px;
  background: var(--text-dim); border-radius: 2px; transition: all 0.22s ease;
}
.topbar-hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.topbar-hamburger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.topbar-hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ══════════════════════════════════════════
   RESPONSIVE MOBILE (≤ 720px)
══════════════════════════════════════════ */
@media (max-width: 720px) {
  /* Topbar : masquer liens, afficher hamburger */
  .topbar { position: relative; }
  .topbar-hamburger { display: flex; }
  .topbar-module { display: none; }

  .topbar-links {
    display: none;
    position: absolute; top: 54px; left: 0; right: 0;
    flex-direction: column;
    background: rgba(9,14,26,0.98);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 8px;
    z-index: 99;
    gap: 2px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  }
  .topbar-links.nav-open { display: flex; }
  .topbar-links a { height: 44px; font-size: 14px; padding: 0 16px; border-radius: var(--r-sm); }
  .topbar-links .topbar-user {
    border-right: none; padding: 10px 16px; height: auto; max-width: none;
    font-size: 13px; border-bottom: 1px solid var(--border); margin-bottom: 4px;
    order: -1;
  }

  /* Wrapper */
  .wrapper { padding: 12px 12px 60px !important; }
  .card { padding: 14px 12px; }

  /* Calendrier */
  .cal-day { min-height: 48px; padding: 3px 2px; }
  .cal-num { font-size: 11px; }
  .cal-dot { width: 6px; height: 6px; }

  /* Planning admin scrollable */
  #planningGrid { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Formulaires — empilement */
  .grid-2 { grid-template-columns: 1fr; }
  .modal-box { padding: 18px; }
  .type-choice { flex-direction: column; }

  /* Stat cards 2×2 */
  .stats-grid { grid-template-columns: repeat(2,1fr) !important; }

  /* Tables scrollables */
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-scroll .table-lame { min-width: 460px; }
}

/* ══════════════════════════════════════════
   PROCHAINES LEÇONS (cards mobiles)
══════════════════════════════════════════ */
.prochaine-item {
  padding: 12px 14px;
  border: 1px solid var(--border2);
  border-radius: var(--r-md);
  background: var(--surface2);
  margin-bottom: 8px;
}
.prochaine-header {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; margin-bottom: 6px;
}
.prochaine-date {
  font-size: .9rem; font-weight: 600; color: var(--text); flex: 1; min-width: 100px;
}
.prochaine-ens {
  font-size: .82rem; color: var(--text-dim); margin-bottom: 8px;
}
.prochaine-footer {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; justify-content: space-between;
}

/* ══════════════════════════════════════════
   RESPONSIVE ancienne (gardée pour compat)
══════════════════════════════════════════ */
@media (max-width: 600px) {
  .lecon-container { padding: 14px 10px 50px; }
  .cal-grid { grid-template-columns: repeat(7, 1fr); }
  .cal-day  { min-height: 46px; padding: 4px; }
  .cal-day-num { font-size: 11px; }
  .grid-2   { grid-template-columns: 1fr; }
  .modal-box { padding: 18px; }
  .type-choice { flex-direction: column; }
  .lecon-topbar { padding: 8px 12px; }
}

/* ══════════════════════════════════════════
   PLANNING IMPRIMABLE
══════════════════════════════════════════ */
@media print {
  body {
    background: #fff !important; color: #1a2340 !important;
    font-size: 11px;
  }
  .lecon-topbar, .no-print { display: none !important; }
  .print-only { display: block !important; }

  .print-header {
    text-align: center; border-bottom: 2px solid #1a2340;
    padding-bottom: 8px; margin-bottom: 12px;
  }
  .print-title { font-size: 18px; font-weight: bold; color: #1a2340; }
  .print-subtitle { font-size: 11px; color: #5a6a82; }

  .print-grid {
    display: grid; gap: 0; border: 1px solid #ccd4e0; width: 100%;
  }
  .print-cell {
    border: 1px solid #ccd4e0; padding: 4px 6px; min-height: 40px;
  }
  .print-header-cell {
    background: #eef2f8; font-weight: bold; text-align: center;
    font-size: 10px; padding: 6px;
  }
  .print-time-cell {
    background: #f4f6fa; font-weight: bold; font-size: 12px;
    text-align: center; padding: 4px;
  }
  .print-resa-fixe     { background: #e8ecff; border-left: 3px solid #002395; padding: 2px 4px; margin-bottom: 2px; }
  .print-resa-flexible { background: #fff8e8; border-left: 3px solid #C9A84C; padding: 2px 4px; margin-bottom: 2px; }
  .print-closed        { background: #f0f0f0; color: #999; text-align: center; font-style: italic; }

  @page { size: A4 landscape; margin: 15mm; }
}
.print-only { display: none; }

/* ══════════════════════════════════════════
   GRILLE D'INDISPONIBILITÉS CRÉNEAUX (admin)
══════════════════════════════════════════ */
.ig-grid {
  display: grid;
  gap: 2px;
  background: var(--surface2);
  border-radius: var(--r-md);
  overflow: hidden;
  font-size: 0.75rem;
}
.ig-cell {
  display: flex; align-items: center; justify-content: center;
  padding: 5px 3px; text-align: center;
}
.ig-corner { background: var(--bg); }
.ig-head {
  background: var(--bg);
  color: var(--text-faint);
  font-size: 0.68rem; font-weight: 600;
  padding: 6px 2px;
  letter-spacing: 0.04em;
}
.ig-date {
  background: var(--bg);
  color: var(--text-dim);
  justify-content: flex-start;
  padding: 5px 8px;
  font-size: 0.77rem;
  white-space: nowrap;
}
.ig-slot {
  border: none; cursor: pointer; border-radius: 3px;
  min-height: 28px; min-width: 26px;
  transition: background 0.12s, color 0.12s;
  font-size: 0.78rem; line-height: 1;
}
.ig-slot:disabled { cursor: wait; opacity: 0.5; }
.ig-free {
  background: rgba(62, 204, 136, 0.07);
  color: rgba(62, 204, 136, 0.3);
}
.ig-free:hover { background: rgba(62, 204, 136, 0.18); color: var(--green); }
.ig-blocked {
  background: rgba(224, 90, 74, 0.18);
  color: var(--red);
  font-weight: 700;
}
.ig-blocked:hover { background: rgba(224, 90, 74, 0.28); }
