/* ============================================================
   CSFORM MOBILITÉ INTERNATIONALE — FEUILLE DE STYLE PRINCIPALE
   Couleurs extraites du logo CSForm (bleu marine / bleu acier)
   ============================================================ */

/* ── Variables de couleurs ─────────────────────────────────── */
:root {
  /* Palette CSForm (logo bleu) */
  --csf-navy:       #1B2A4A;   /* Bleu marine foncé — fond header */
  --csf-blue:       #2E5FA3;   /* Bleu principal — boutons, liens */
  --csf-steel:      #4A7FBF;   /* Bleu acier — accents */
  --csf-light-blue: #7AAED4;   /* Bleu clair — highlights */
  --csf-pale:       #EEF4FB;   /* Bleu très clair — fonds de sections */
  --csf-white:      #FFFFFF;

  /* Neutres */
  --gray-50:        #F8FAFC;
  --gray-100:       #F1F5F9;
  --gray-200:       #E2E8F0;
  --gray-400:       #94A3B8;
  --gray-600:       #475569;
  --gray-800:       #1E293B;

  /* Sémantiques */
  --success:        #16A34A;
  --success-bg:     #DCFCE7;
  --warning:        #D97706;
  --warning-bg:     #FEF3C7;
  --danger:         #DC2626;
  --danger-bg:      #FEE2E2;
  --info:           #0284C7;
  --info-bg:        #E0F2FE;

  /* Typographie */
  --font-main:  'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-title: Georgia, 'Times New Roman', serif;

  /* Espacements */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  /* Ombres */
  --shadow-sm:  0 1px 4px rgba(27,42,74,0.08);
  --shadow-md:  0 4px 16px rgba(27,42,74,0.12);
  --shadow-lg:  0 8px 32px rgba(27,42,74,0.16);
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  font-size: 16px;
  color: var(--gray-800);
  background: var(--gray-50);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--csf-blue); text-decoration: none; }
a:hover { color: var(--csf-navy); text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  background: var(--csf-navy);
  padding: 0 2rem;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.navbar-brand img { height: 42px; width: auto; }

.brand-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: white;
  font-family: var(--font-title);
}

.brand-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.navbar-nav a {
  color: rgba(255,255,255,0.85);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  text-decoration: none;
}

.navbar-nav a:hover { color: white; background: rgba(255,255,255,0.1); }
.navbar-nav a.active { color: white; background: var(--csf-blue); }

/* ── Boutons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--csf-blue);
  color: white;
  box-shadow: 0 2px 8px rgba(46,95,163,0.35);
}
.btn-primary:hover {
  background: var(--csf-navy);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(27,42,74,0.4);
  color: white;
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--csf-blue);
  border: 2px solid var(--csf-blue);
}
.btn-outline:hover { background: var(--csf-blue); color: white; text-decoration: none; }

.btn-white {
  background: white;
  color: var(--csf-navy);
  font-weight: 700;
}
.btn-white:hover { background: var(--csf-pale); color: var(--csf-navy); text-decoration: none; }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #15803D; color: white; text-decoration: none; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #B91C1C; color: white; text-decoration: none; }

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 16px 36px; font-size: 17px; }
.btn-full { width: 100%; justify-content: center; }

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--csf-navy) 0%, #243B6E 50%, var(--csf-blue) 100%);
  padding: 90px 2rem 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 50%, rgba(74,127,191,0.2) 0%, transparent 50%),
                    radial-gradient(circle at 80% 20%, rgba(46,95,163,0.3) 0%, transparent 40%);
}

.hero-inner { position: relative; z-index: 1; max-width: 800px; margin: 0 auto; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.9);
  padding: 6px 18px;
  border-radius: 100px;
  font-size: 13px;
  margin-bottom: 28px;
}

.hero h1 {
  font-family: var(--font-title);
  font-size: clamp(2rem, 5vw, 3.8rem);
  color: white;
  margin-bottom: 20px;
  line-height: 1.15;
}

.hero p {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.82);
  max-width: 580px;
  margin: 0 auto 36px;
  line-height: 1.75;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid rgba(255,255,255,0.18);
  flex-wrap: wrap;
}

.hero-stat-num {
  font-family: var(--font-title);
  font-size: 2.4rem;
  font-weight: 700;
  color: white;
}

.hero-stat-label {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  margin-top: 2px;
}

/* ── Sections ───────────────────────────────────────────────── */
.section { padding: 72px 2rem; }
.section-white { background: white; }
.section-gray  { background: var(--gray-100); }
.section-blue  { background: var(--csf-pale); }
.section-navy  { background: var(--csf-navy); }

.container { max-width: 1140px; margin: 0 auto; }
.container-sm { max-width: 760px; margin: 0 auto; }

.section-header { text-align: center; margin-bottom: 52px; }
.section-title {
  font-family: var(--font-title);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  color: var(--csf-navy);
  margin-bottom: 12px;
}
.section-subtitle { color: var(--gray-600); font-size: 16px; max-width: 500px; margin: 0 auto; }

/* ── Grilles ────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  transition: all 0.25s;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--csf-light-blue); }

.card-icon {
  width: 52px;
  height: 52px;
  background: var(--csf-pale);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 18px;
}

.card h3 { font-size: 1.05rem; color: var(--csf-navy); margin-bottom: 8px; font-weight: 600; }
.card p  { font-size: 14px; color: var(--gray-600); line-height: 1.7; }

/* ── Pays grid ───────────────────────────────────────────────── */
.country-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }

.country-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 18px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.country-card:hover { border-color: var(--csf-blue); background: var(--csf-pale); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.country-flag { font-size: 34px; margin-bottom: 8px; }
.country-name { font-size: 13px; font-weight: 600; color: var(--csf-navy); }
.country-region { font-size: 11px; color: var(--gray-400); margin-top: 2px; }

/* ── Formulaire ─────────────────────────────────────────────── */
.form-hero {
  background: linear-gradient(135deg, var(--csf-navy), var(--csf-blue));
  color: white;
  padding: 48px 2rem;
  text-align: center;
}
.form-hero h1 { font-family: var(--font-title); font-size: 2rem; margin-bottom: 8px; }
.form-hero p  { opacity: 0.85; font-size: 15px; }

.form-wrapper { max-width: 860px; margin: 0 auto; padding: 40px 2rem 60px; }

/* Progress steps */
.progress-bar {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 32px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.steps {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
}
.steps::before {
  content: '';
  position: absolute;
  top: 19px;
  left: 24px;
  right: 24px;
  height: 2px;
  background: var(--gray-200);
  z-index: 0;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 1;
}
.step-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  background: var(--gray-200);
  color: var(--gray-600);
  transition: all 0.3s;
  border: 3px solid white;
  box-shadow: var(--shadow-sm);
}
.step.active .step-num  { background: var(--csf-blue); color: white; }
.step.done .step-num    { background: var(--success); color: white; }
.step-label { font-size: 12px; color: var(--gray-400); text-align: center; max-width: 80px; }
.step.active .step-label { color: var(--csf-blue); font-weight: 600; }
.step.done  .step-label  { color: var(--success); }

/* Sections formulaire */
.form-section {
  background: white;
  border-radius: var(--radius-lg);
  padding: 32px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.form-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--csf-pale);
}
.form-section-title h2 { font-size: 1.15rem; color: var(--csf-navy); }
.form-section-icon {
  width: 38px;
  height: 38px;
  background: var(--csf-pale);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* Champs */
.form-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.form-row-3{ display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.form-group{ display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.col-full  { grid-column: 1 / -1; }

label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  letter-spacing: 0.02em;
}
label .required { color: var(--danger); margin-left: 2px; }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 11px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 14px;
  color: var(--gray-800);
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--csf-blue);
  box-shadow: 0 0 0 3px rgba(46,95,163,0.12);
}
input::placeholder, textarea::placeholder { color: var(--gray-400); }
select { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394A3B8' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
textarea { resize: vertical; min-height: 100px; }

.field-hint { font-size: 12px; color: var(--gray-400); margin-top: 4px; }
.field-error{ font-size: 12px; color: var(--danger); margin-top: 4px; }
input.error, select.error, textarea.error { border-color: var(--danger); }

/* Radio options */
.radio-group { display: flex; gap: 12px; flex-wrap: wrap; }
.radio-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  background: white;
  user-select: none;
}
.radio-btn input { display: none; }
.radio-btn:hover { border-color: var(--csf-steel); }
.radio-btn.checked { border-color: var(--csf-blue); background: var(--csf-pale); color: var(--csf-navy); font-weight: 600; }
.radio-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--gray-400); transition: all 0.2s; flex-shrink: 0; }
.radio-btn.checked .radio-dot { border-color: var(--csf-blue); background: var(--csf-blue); box-shadow: inset 0 0 0 3px white; }

/* Upload */
.upload-zone {
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--gray-50);
}
.upload-zone:hover { border-color: var(--csf-blue); background: var(--csf-pale); }
.upload-zone.has-file { border-color: var(--success); background: #F0FFF4; }
.upload-zone input { display: none; }
.upload-icon { font-size: 30px; margin-bottom: 10px; }
.upload-text { font-size: 13px; color: var(--gray-600); }
.upload-hint { font-size: 12px; color: var(--gray-400); margin-top: 4px; }
.upload-name { font-size: 13px; color: var(--success); font-weight: 600; }

/* Budget table */
.budget-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.budget-table thead th { background: var(--csf-pale); padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 700; color: var(--csf-navy); text-transform: uppercase; letter-spacing: 0.05em; }
.budget-table tbody td { padding: 10px 16px; border-bottom: 1px solid var(--gray-100); }
.budget-table tfoot td { padding: 12px 16px; background: var(--csf-pale); font-weight: 700; color: var(--csf-navy); }
.budget-table input { border: none; background: transparent; font-size: 14px; width: 100%; font-family: var(--font-main); }
.budget-table input:focus { outline: none; border-bottom: 1.5px solid var(--csf-blue); }
#budget-total { font-size: 1.1rem; color: var(--csf-blue); }

/* Navigation formulaire */
.form-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--gray-100); }

/* ── Badges statut ──────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

.badge-attente  { background: var(--warning-bg);  color: #92400E; } .badge-attente::before  { background: var(--warning); }
.badge-valide   { background: var(--success-bg);  color: #14532D; } .badge-valide::before   { background: var(--success); }
.badge-refuse   { background: var(--danger-bg);   color: #7F1D1D; } .badge-refuse::before   { background: var(--danger); }
.badge-revision { background: var(--info-bg);     color: #0C4A6E; } .badge-revision::before { background: var(--info); }

/* ── Dashboard admin ────────────────────────────────────────── */
.dashboard-layout { display: flex; min-height: calc(100vh - 68px); }

.sidebar {
  width: 248px;
  background: var(--csf-navy);
  flex-shrink: 0;
  padding: 24px 0;
  position: sticky;
  top: 68px;
  height: calc(100vh - 68px);
  overflow-y: auto;
}

.sidebar-user {
  padding: 16px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 12px;
}
.sidebar-user-name  { font-weight: 600; color: white; font-size: 14px; }
.sidebar-user-role  { font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 2px; }

.sidebar-label {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 12px 20px 4px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}
.sidebar-item:hover  { background: rgba(255,255,255,0.07); color: white; text-decoration: none; }
.sidebar-item.active { background: rgba(46,95,163,0.35); color: white; border-left-color: var(--csf-steel); }
.sidebar-icon        { font-size: 17px; width: 22px; text-align: center; }

.sidebar-badge {
  margin-left: auto;
  background: var(--csf-blue);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
}

.main-content { flex: 1; padding: 32px; background: var(--gray-100); overflow-x: hidden; }

.page-header { margin-bottom: 28px; }
.page-title  { font-family: var(--font-title); font-size: 1.7rem; color: var(--csf-navy); margin-bottom: 4px; }
.page-sub    { font-size: 14px; color: var(--gray-600); }

/* Stats cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 28px; }

.stat-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 22px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}
.stat-top  { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.stat-icon { font-size: 26px; }
.stat-num  { font-family: var(--font-title); font-size: 2.4rem; font-weight: 700; color: var(--csf-navy); line-height: 1; }
.stat-label{ font-size: 13px; color: var(--gray-600); margin-top: 6px; }
.stat-card.blue  { border-top: 3px solid var(--csf-blue); }
.stat-card.green { border-top: 3px solid var(--success); }
.stat-card.orange{ border-top: 3px solid var(--warning); }
.stat-card.red   { border-top: 3px solid var(--danger); }

/* Table admin */
.table-card { background: white; border-radius: var(--radius-lg); border: 1px solid var(--gray-200); box-shadow: var(--shadow-sm); overflow: hidden; }

.table-toolbar {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--gray-100);
  flex-wrap: wrap;
  gap: 12px;
}
.table-toolbar-title { font-weight: 700; color: var(--csf-navy); font-size: 1rem; }
.table-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.search-box {
  padding: 8px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-family: var(--font-main);
  width: 240px;
}
.search-box:focus { outline: none; border-color: var(--csf-blue); }

.filter-select {
  padding: 8px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-family: var(--font-main);
  background: white;
  cursor: pointer;
}
.filter-select:focus { outline: none; border-color: var(--csf-blue); }

.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table thead th {
  background: var(--gray-50);
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.data-table thead th a { color: var(--gray-600); text-decoration: none; }
.data-table thead th a:hover { color: var(--csf-blue); }

.data-table tbody tr { border-bottom: 1px solid var(--gray-100); cursor: pointer; transition: background 0.15s; }
.data-table tbody tr:hover { background: var(--csf-pale); }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table td { padding: 14px 16px; vertical-align: middle; }

.student-cell { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--csf-blue), var(--csf-navy));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.student-name  { font-weight: 600; color: var(--csf-navy); font-size: 14px; }
.student-email { font-size: 12px; color: var(--gray-400); }

.table-pagination {
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--gray-100);
  font-size: 13px;
  color: var(--gray-600);
}
.pagination-links { display: flex; gap: 4px; }
.page-link {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  background: white;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  color: var(--csf-blue);
  transition: all 0.15s;
}
.page-link:hover { background: var(--csf-pale); text-decoration: none; }
.page-link.active { background: var(--csf-blue); color: white; border-color: var(--csf-blue); }
.page-link.disabled { opacity: 0.4; pointer-events: none; }

/* Panneau détail */
.detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(27,42,74,0.55);
  z-index: 2000;
  display: flex;
  justify-content: flex-end;
  backdrop-filter: blur(3px);
}

.detail-panel {
  background: white;
  width: 100%;
  max-width: 580px;
  height: 100vh;
  overflow-y: auto;
  box-shadow: -8px 0 40px rgba(27,42,74,0.2);
  animation: slideIn 0.25s ease;
}

@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

.detail-header {
  position: sticky;
  top: 0;
  background: white;
  padding: 18px 24px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}
.detail-header h3 { font-size: 1rem; color: var(--csf-navy); font-weight: 700; }
.btn-close { background: none; border: none; cursor: pointer; font-size: 20px; color: var(--gray-400); padding: 4px; border-radius: 4px; }
.btn-close:hover { color: var(--gray-800); background: var(--gray-100); }

.detail-body { padding: 24px; }

.student-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--csf-pale);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}
.avatar-lg {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--csf-blue), var(--csf-navy));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
}

.info-group { margin-bottom: 22px; }
.info-group-title { font-size: 11px; font-weight: 700; color: var(--csf-blue); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--gray-100); }
.info-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--gray-50); font-size: 14px; }
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--gray-400); }
.info-value { font-weight: 500; color: var(--csf-navy); text-align: right; max-width: 60%; }

.action-box { background: var(--gray-50); border-radius: var(--radius-md); padding: 18px; margin-bottom: 20px; }
.action-box h4 { font-size: 13px; font-weight: 700; margin-bottom: 12px; color: var(--gray-800); }
.action-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-status { padding: 8px 14px; border-radius: var(--radius-md); border: 1.5px solid; font-size: 13px; font-weight: 600; cursor: pointer; font-family: var(--font-main); transition: all 0.2s; text-decoration: none; }
.btn-status-valide  { border-color: var(--success); color: var(--success); background: transparent; }
.btn-status-valide:hover  { background: var(--success); color: white; }
.btn-status-refuse  { border-color: var(--danger); color: var(--danger); background: transparent; }
.btn-status-refuse:hover  { background: var(--danger); color: white; }
.btn-status-revision{ border-color: var(--info); color: var(--info); background: transparent; }
.btn-status-revision:hover{ background: var(--info); color: white; }

/* Timeline */
.timeline { list-style: none; }
.timeline-item { display: flex; gap: 12px; margin-bottom: 14px; position: relative; }
.timeline-item::before { content: ''; position: absolute; left: 15px; top: 32px; bottom: -4px; width: 1.5px; background: var(--gray-200); }
.timeline-item:last-child::before { display: none; }
.timeline-dot { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; background: var(--csf-pale); }
.timeline-text { font-size: 13px; font-weight: 500; color: var(--csf-navy); padding-top: 5px; }
.timeline-date { font-size: 12px; color: var(--gray-400); }

/* Documents */
.doc-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--gray-200); border-radius: var(--radius-md); margin-bottom: 8px; transition: border-color 0.2s; }
.doc-item:hover { border-color: var(--csf-blue); }
.doc-name { flex: 1; font-size: 13px; font-weight: 500; color: var(--csf-navy); }
.doc-size { font-size: 12px; color: var(--gray-400); }

/* Graphiques */
.bar-chart { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: flex; align-items: center; gap: 12px; }
.bar-label { font-size: 13px; color: var(--gray-600); width: 100px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; height: 8px; background: var(--gray-100); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: var(--csf-blue); transition: width 0.6s ease; }
.bar-count { font-size: 12px; font-weight: 700; color: var(--csf-navy); width: 28px; text-align: right; }

/* Toast notification */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--csf-navy);
  color: white;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
  max-width: 340px;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
@keyframes toastIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes toastOut { to { transform: translateY(20px); opacity: 0; } }

/* Alertes */
.alert { padding: 14px 18px; border-radius: var(--radius-md); font-size: 14px; margin-bottom: 20px; display: flex; align-items: flex-start; gap: 10px; }
.alert-success { background: var(--success-bg); color: #14532D; border: 1px solid #BBF7D0; }
.alert-error   { background: var(--danger-bg);  color: #7F1D1D; border: 1px solid #FECACA; }
.alert-warning { background: var(--warning-bg); color: #78350F; border: 1px solid #FDE68A; }
.alert-info    { background: var(--info-bg);    color: #0C4A6E; border: 1px solid #BAE6FD; }

/* Login */
.login-page { min-height: calc(100vh - 68px); display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--csf-navy) 0%, #243B6E 100%); padding: 2rem; }
.login-card { background: white; border-radius: var(--radius-xl); padding: 48px; width: 100%; max-width: 440px; box-shadow: var(--shadow-lg); }
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo img { height: 60px; margin-bottom: 12px; }
.login-logo h2 { font-family: var(--font-title); font-size: 1.5rem; color: var(--csf-navy); }
.login-logo p  { font-size: 14px; color: var(--gray-400); margin-top: 4px; }

/* Page succès */
.success-page { min-height: calc(100vh - 68px); display: flex; align-items: center; justify-content: center; padding: 2rem; }
.success-card { background: white; border-radius: var(--radius-xl); padding: 56px 48px; max-width: 520px; width: 100%; text-align: center; box-shadow: var(--shadow-lg); border: 1px solid var(--gray-200); }
.success-icon { font-size: 60px; margin-bottom: 20px; }
.success-card h2 { font-family: var(--font-title); font-size: 2rem; color: var(--csf-navy); margin-bottom: 12px; }
.success-card p  { color: var(--gray-600); line-height: 1.7; margin-bottom: 20px; }
.reference-box { background: var(--csf-pale); border-radius: var(--radius-md); padding: 18px; margin: 20px 0; }
.reference-num { font-family: var(--font-title); font-size: 1.6rem; font-weight: 700; color: var(--csf-blue); display: block; margin-top: 6px; }

/* Footer */
footer { background: var(--csf-navy); color: rgba(255,255,255,0.7); padding: 40px 2rem; text-align: center; }
footer strong { color: white; }
footer a { color: var(--csf-light-blue); text-decoration: none; }
footer a:hover { color: white; }
.footer-links { display: flex; justify-content: center; gap: 28px; margin-top: 16px; flex-wrap: wrap; font-size: 14px; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .sidebar { width: 200px; }
}

@media (max-width: 768px) {
  .form-row, .form-row-3, .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .col-full { grid-column: 1; }
  .dashboard-layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; top: 0; display: flex; flex-wrap: wrap; gap: 0; padding: 12px 0; }
  .hero h1 { font-size: 1.9rem; }
  .hero-stats { gap: 24px; }
  .detail-panel { max-width: 100%; }
  .navbar { padding: 0 1rem; }
  .main-content { padding: 16px; }
  .steps::before { display: none; }
  .step-label { font-size: 10px; }
  .table-toolbar { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .btn-lg { padding: 14px 24px; font-size: 15px; }
  .hero { padding: 60px 1rem 50px; }
  .section { padding: 48px 1rem; }
  .login-card { padding: 32px 20px; }
  .success-card { padding: 40px 24px; }
  .form-section { padding: 20px; }
}
