/* ==========================================================================
   IT LAND — Design System (thème CLAIR)
   Centre de formation IT & Digital — Tunisie
   Feuille de style autonome. Dépendance externe: Google Fonts uniquement.
   Palette dérivée du logo (bleu clair, fonds blancs, texte foncé).
   ========================================================================== */

/* ---------------------------------------------------------------- Variables */
:root {
  /* Fonds & surfaces */
  --bg: #f4f8fc;
  --surface: #ffffff;
  --surface-2: #eef4fb;
  --border: #e2e9f2;

  /* Texte */
  --text: #243244;
  --ink: #494644;
  --muted: #6b7a90;

  /* Primaire (bleu logo) */
  --primary: #0d96d2;
  --primary-600: #007daf;
  --primary-050: #e7f5fc;
  --primary-300: #6ec8f2;
  --accent: #37a9e1;

  /* Sémantique */
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --success-050: #eafaf0;
  --warning-050: #fdf3e6;
  --danger-050: #fdeaea;

  /* Ombres douces bleutées */
  --shadow-xs: 0 1px 2px rgba(36, 50, 68, .06);
  --shadow-sm: 0 2px 6px rgba(36, 50, 68, .07);
  --shadow-md: 0 8px 24px rgba(13, 150, 210, .08);
  --shadow-lg: 0 18px 46px rgba(13, 150, 210, .12);
  --shadow-primary: 0 10px 26px rgba(13, 150, 210, .28);

  /* Dégradés */
  --grad-primary: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  --grad-soft: linear-gradient(135deg, #e7f5fc 0%, #f4f8fc 100%);
  --grad-vignette: linear-gradient(135deg, #0d96d2 0%, #37a9e1 55%, #6ec8f2 100%);

  /* Rayons */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --r-pill: 999px;

  /* Typo */
  --font-title: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Layout */
  --container: 1200px;
  --header-h: 74px;
  --sidebar-w: 264px;
  --sidebar-w-collapsed: 76px;

  /* Transitions */
  --t: .22s cubic-bezier(.4, 0, .2, 1);
}

/* --------------------------------------------------------------- Reset base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--primary-600); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--primary); }
button { font-family: inherit; }
h1, h2, h3, h4, h5 {
  font-family: var(--font-title);
  color: var(--text);
  line-height: 1.18;
  margin: 0 0 .5em;
  font-weight: 700;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1rem; }
ul { margin: 0; padding: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
:focus-visible {
  outline: 3px solid var(--primary-300);
  outline-offset: 2px;
  border-radius: 6px;
}
::selection { background: var(--primary-050); color: var(--primary-600); }

/* --------------------------------------------------------- Grilles & layout */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.section { padding: 72px 0; }
.section--tight { padding: 44px 0; }
.section--alt { background: var(--surface-2); }

.section-head { max-width: 720px; margin: 0 auto 44px; text-align: center; }
.section-head.left { margin-left: 0; text-align: left; }
.section-title { margin-bottom: .5rem; }
.eyebrow {
  display: inline-block;
  font-family: var(--font-title);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--primary-600);
  background: var(--primary-050);
  padding: .35rem .85rem;
  border-radius: var(--r-pill);
  margin-bottom: 1rem;
}
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.gradient-text {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.flex { display: flex; }
.items-center { align-items: center; }
.wrap { flex-wrap: wrap; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-sm { gap: 8px; } .gap-md { gap: 16px; } .gap-lg { gap: 24px; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 1rem; } .mb-2 { margin-bottom: 1rem; }
.w-full { width: 100%; }

/* --------------------------------------------------------------- Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  font-family: var(--font-title);
  font-size: .95rem;
  font-weight: 600;
  line-height: 1;
  padding: .82rem 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: transform var(--t), box-shadow var(--t), background var(--t), color var(--t), border-color var(--t);
  white-space: nowrap;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 1.05em; height: 1.05em; }

.btn-primary {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 14px 32px rgba(13, 150, 210, .38); }

.btn-outline {
  background: var(--surface);
  color: var(--primary-600);
  border-color: var(--primary-300);
}
.btn-outline:hover { background: var(--primary-050); color: var(--primary-600); border-color: var(--primary); }

.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); color: var(--primary-600); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { color: #fff; background: #c11f1f; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { color: #fff; background: #128a3f; }

.btn-sm { padding: .55rem 1rem; font-size: .85rem; }
.btn-lg { padding: 1rem 1.9rem; font-size: 1.05rem; }
.btn-block { display: flex; width: 100%; }
.btn-icon { padding: .6rem; border-radius: var(--r-md); }

/* --------------------------------------------------------------- Cartes */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.card-body { padding: 22px; }
.card-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-head h3 { margin: 0; font-size: 1.1rem; }
.card-foot { padding: 16px 22px; border-top: 1px solid var(--border); background: var(--surface-2); }
.card--hover:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--primary-300); }

/* Carte formation */
.formation-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.formation-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--primary-300); }
.formation-card .vignette {
  position: relative;
  height: 150px;
  background: var(--grad-vignette);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  overflow: hidden;
}
.formation-card .vignette::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(120px 120px at 80% 20%, rgba(255,255,255,.35), transparent 70%);
}
.formation-card .vignette .ico { font-size: 2.6rem; position: relative; z-index: 1; }
.formation-card .vignette .cat-tag {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  background: rgba(255,255,255,.92); color: var(--primary-600);
  font-size: .72rem; font-weight: 600; padding: .3rem .7rem; border-radius: var(--r-pill);
}
.formation-card .fc-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.formation-card h3 { font-size: 1.12rem; margin-bottom: .4rem; }
.formation-card .fc-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: .6rem 0 1rem; color: var(--muted); font-size: .82rem; }
.formation-card .fc-meta span { display: inline-flex; align-items: center; gap: .3rem; }
.formation-card .fc-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--border); }
.formation-card .price { font-family: var(--font-title); font-weight: 700; font-size: 1.2rem; color: var(--text); }
.formation-card .price small { font-size: .72rem; color: var(--muted); font-weight: 400; }

/* Stat / KPI */
.stat-card, .kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-xs);
  display: flex; align-items: center; gap: 16px;
}
.stat-card .stat-ico, .kpi .kpi-ico {
  width: 52px; height: 52px; flex: none;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: #fff;
  background: var(--grad-primary);
  box-shadow: var(--shadow-md);
}
.stat-card .stat-val, .kpi .kpi-val { font-family: var(--font-title); font-size: 1.8rem; font-weight: 700; line-height: 1; color: var(--text); }
.stat-card .stat-lbl, .kpi .kpi-lbl { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.kpi .kpi-trend { font-size: .8rem; font-weight: 600; }
.kpi .kpi-trend.up { color: var(--success); }
.kpi .kpi-trend.down { color: var(--danger); }

/* --------------------------------------------------------- Badges / tags */
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .74rem; font-weight: 600;
  padding: .28rem .7rem; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--border);
}
.badge-primary { background: var(--primary-050); color: var(--primary-600); border-color: var(--primary-300); }
.badge-success { background: var(--success-050); color: var(--success); border-color: #b6e6c6; }
.badge-warning { background: var(--warning-050); color: var(--warning); border-color: #f2d59b; }
.badge-danger  { background: var(--danger-050); color: var(--danger); border-color: #f2b6b6; }
.badge-cert {
  background: linear-gradient(135deg, #fff7e0, #fdefc4);
  color: #a56d00; border-color: #f0d99a;
}
.badge-cert::before { content: "🏅"; }

.tag {
  display: inline-block; font-size: .78rem; color: var(--muted);
  background: var(--surface-2); padding: .3rem .7rem; border-radius: var(--r-sm);
  border: 1px solid var(--border);
}
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .85rem; font-weight: 500; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  padding: .5rem 1rem; border-radius: var(--r-pill); cursor: pointer;
  transition: all var(--t);
}
.chip:hover { border-color: var(--primary-300); color: var(--primary-600); }
.chip.active { background: var(--primary-050); border-color: var(--primary); color: var(--primary-600); font-weight: 600; }
.chip .x { opacity: .6; }

/* ------------------------------------------------------------- Header public */
.site-header {
  position: sticky; top: 0; z-index: 900;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 20px; }
.site-header .brand { display: flex; align-items: center; gap: .6rem; flex: none; }
.site-header .brand img { height: 38px; width: auto; }

.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav a {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .55rem .9rem; border-radius: var(--r-md);
  color: var(--text); font-weight: 500; font-size: .95rem;
  transition: all var(--t);
}
.main-nav a:hover, .main-nav a.active { background: var(--primary-050); color: var(--primary-600); }

.has-dropdown { position: relative; }
.has-dropdown > a::after { content: "▾"; font-size: .7rem; opacity: .7; }
.dropdown {
  position: absolute; top: calc(100% + 10px); left: 0;
  min-width: 240px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); padding: 8px;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: all var(--t); z-index: 950;
}
.has-dropdown:hover .dropdown, .has-dropdown.open .dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.dropdown a { display: block; padding: .6rem .8rem; border-radius: var(--r-sm); font-weight: 500; }
.dropdown a:hover { background: var(--surface-2); }
.dropdown a small { display: block; color: var(--muted); font-weight: 400; font-size: .78rem; }

.header-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.header-actions .admin-link { font-size: .82rem; color: var(--muted); }
.header-actions .admin-link:hover { color: var(--primary-600); }

.nav-toggle {
  display: none; width: 44px; height: 44px;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--r-md); cursor: pointer; padding: 0;
  align-items: center; justify-content: center;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; display: block; width: 20px; height: 2px;
  background: var(--text); border-radius: 2px; position: relative;
  transition: all var(--t);
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }
.site-header.open .nav-toggle span { background: transparent; }
.site-header.open .nav-toggle span::before { transform: rotate(45deg); top: 0; }
.site-header.open .nav-toggle span::after { transform: rotate(-45deg); top: 0; }

/* ------------------------------------------------------------- Footer clair */
.site-footer {
  background: #f0f5fb;
  border-top: 1px solid var(--border);
  color: var(--ink);
  padding: 56px 0 0;
}
.site-footer .footer-grid {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 40px;
  padding-bottom: 40px;
}
.site-footer .brand img { height: 40px; margin-bottom: 1rem; }
.site-footer h4 {
  font-family: var(--font-title); font-size: .95rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text); margin-bottom: 1rem;
}
.site-footer ul li { list-style: none; margin-bottom: .6rem; }
.site-footer ul li a { color: var(--muted); font-size: .92rem; }
.site-footer ul li a:hover { color: var(--primary-600); }
.site-footer .foot-contact li { display: flex; gap: .55rem; color: var(--muted); font-size: .92rem; }
.site-footer .social { display: flex; gap: 10px; margin-top: 1rem; }
.site-footer .social a {
  width: 38px; height: 38px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--primary-600);
  transition: all var(--t);
}
.site-footer .social a:hover { background: var(--primary); color: #fff; transform: translateY(-2px); border-color: var(--primary); }
.site-footer .copyright {
  border-top: 1px solid var(--border);
  padding: 20px 0; text-align: center; color: var(--muted); font-size: .85rem;
}

/* ------------------------------------------------------------- Layout admin */
.admin-layout { display: flex; min-height: 100vh; background: var(--bg); }

.admin-sidebar {
  width: var(--sidebar-w); flex: none;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  transition: width var(--t);
  z-index: 800;
}
.admin-sidebar .sb-brand {
  height: var(--header-h); display: flex; align-items: center; gap: .6rem;
  padding: 0 22px; border-bottom: 1px solid var(--border);
}
.admin-sidebar .sb-brand img { height: 34px; }
.admin-sidebar .sb-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.admin-sidebar .sb-section { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 14px 12px 6px; }
.admin-sidebar .sb-nav a {
  display: flex; align-items: center; gap: .8rem;
  padding: .72rem .85rem; border-radius: var(--r-md);
  color: var(--ink); font-weight: 500; font-size: .93rem;
  margin-bottom: 2px; transition: all var(--t);
}
.admin-sidebar .sb-nav a .ico { width: 20px; text-align: center; flex: none; font-size: 1.05rem; }
.admin-sidebar .sb-nav a:hover { background: var(--surface-2); color: var(--primary-600); }
.admin-sidebar .sb-nav a.active {
  background: var(--primary-050); color: var(--primary-600); font-weight: 600;
  box-shadow: inset 3px 0 0 var(--primary);
}
.admin-sidebar .sb-foot { padding: 14px 12px; border-top: 1px solid var(--border); }
.admin-sidebar .sb-label { transition: opacity var(--t); }

/* Sidebar repliée */
.admin-layout.collapsed .admin-sidebar { width: var(--sidebar-w-collapsed); }
.admin-layout.collapsed .admin-sidebar .sb-label,
.admin-layout.collapsed .admin-sidebar .sb-section,
.admin-layout.collapsed .admin-sidebar .sb-brand img { display: none; }
.admin-layout.collapsed .admin-sidebar .sb-nav a { justify-content: center; }

.admin-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
  height: var(--header-h); flex: none;
  background: rgba(255,255,255,.9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px; position: sticky; top: 0; z-index: 700;
}
.admin-topbar .sb-collapse {
  width: 42px; height: 42px; border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--r-md); cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--text); font-size: 1.1rem;
}
.admin-topbar .sb-collapse:hover { background: var(--surface-2); color: var(--primary-600); }
.admin-topbar .topbar-search { flex: 1; max-width: 420px; position: relative; }
.admin-topbar .topbar-search input {
  width: 100%; padding: .6rem 1rem .6rem 2.5rem;
  border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--text); font-size: .9rem;
}
.admin-topbar .topbar-search input:focus { background: var(--surface); border-color: var(--primary-300); outline: none; }
.admin-topbar .topbar-search .s-ico { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.admin-topbar .spacer { flex: 1; }
.admin-topbar .bell {
  position: relative; width: 42px; height: 42px; border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--surface);
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text);
}
.admin-topbar .bell:hover { background: var(--surface-2); }
.admin-topbar .bell .dot {
  position: absolute; top: 8px; right: 9px; width: 8px; height: 8px;
  background: var(--danger); border-radius: 50%; border: 2px solid var(--surface);
}
.admin-topbar .admin-user { display: flex; align-items: center; gap: .6rem; cursor: pointer; }
.admin-topbar .admin-user .name { font-size: .9rem; font-weight: 600; color: var(--text); }
.admin-topbar .admin-user .role { font-size: .75rem; color: var(--muted); }

.admin-main { flex: 1; padding: 28px; background: var(--bg); }
.admin-main .page-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.admin-main .page-head h1 { font-size: 1.6rem; margin-bottom: .2rem; }
.admin-main .page-head p { color: var(--muted); margin: 0; }

/* --------------------------------------------------------- Formulaires */
.form-group { margin-bottom: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-label { display: block; font-size: .88rem; font-weight: 600; color: var(--text); margin-bottom: .4rem; }
.form-label .req { color: var(--danger); }
.form-control {
  width: 100%; padding: .72rem .95rem;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); color: var(--text); font-size: .95rem;
  font-family: inherit; transition: border-color var(--t), box-shadow var(--t);
}
.form-control::placeholder { color: var(--muted); }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-050); }
textarea.form-control { min-height: 120px; resize: vertical; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7a90' d='M6 8L0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.4rem; }
.form-hint { font-size: .8rem; color: var(--muted); margin-top: .35rem; }

.input-icon { position: relative; }
.input-icon .form-control { padding-left: 2.6rem; }
.input-icon .ic { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--muted); }

.checkbox { display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; font-size: .92rem; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--primary); }

.switch { position: relative; display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; font-size: .92rem; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 44px; height: 24px; background: var(--border); border-radius: var(--r-pill); position: relative; transition: background var(--t); }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; box-shadow: var(--shadow-sm); transition: transform var(--t); }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(20px); }

/* --------------------------------------------------------------- Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-xs); }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th {
  text-align: left; font-family: var(--font-title); font-weight: 600;
  color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em;
  padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--surface-2);
  white-space: nowrap;
}
.table td { padding: 14px 18px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.table tbody tr:nth-child(even) { background: #fafcff; }
.table tbody tr:hover { background: var(--primary-050); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .cell-main { font-weight: 600; }
.table .cell-sub { color: var(--muted); font-size: .82rem; }
.table td.actions { text-align: right; white-space: nowrap; }

.pill { display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 600; padding: .28rem .7rem; border-radius: var(--r-pill); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-paid { background: var(--success-050); color: var(--success); }
.pill-pending { background: var(--warning-050); color: var(--warning); }
.pill-unpaid { background: var(--danger-050); color: var(--danger); }

/* --------------------------------------------------------------- Hero clair */
.hero {
  position: relative; overflow: hidden;
  background: var(--grad-soft);
  padding: 90px 0;
}
.hero .glow {
  position: absolute; border-radius: 50%; filter: blur(70px); z-index: 0; pointer-events: none;
}
.hero .glow.g1 { width: 420px; height: 420px; background: rgba(13,150,210,.18); top: -120px; right: -80px; }
.hero .glow.g2 { width: 340px; height: 340px; background: rgba(110,200,242,.22); bottom: -140px; left: -60px; }
.hero .container { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero h1 { margin-bottom: 1rem; }
.hero p.lead { font-size: 1.15rem; color: var(--ink); max-width: 560px; }
.hero .hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 1.8rem; }
.hero .hero-stats { display: flex; gap: 28px; margin-top: 2.4rem; flex-wrap: wrap; }
.hero .hero-stats .hs strong { font-family: var(--font-title); font-size: 1.7rem; color: var(--primary-600); display: block; }
.hero .hero-stats .hs span { color: var(--muted); font-size: .85rem; }
.hero .hero-visual {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--shadow-lg); padding: 24px;
}

/* ------------------------------------------------------ Steps / Timeline */
.steps { display: grid; gap: 22px; grid-template-columns: repeat(4, 1fr); }
.steps .step { position: relative; text-align: center; }
.steps .step .num {
  width: 54px; height: 54px; margin: 0 auto 14px;
  border-radius: 50%; background: var(--grad-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-title); font-weight: 700; font-size: 1.2rem;
  box-shadow: var(--shadow-md);
}
.steps .step h4 { margin-bottom: .3rem; font-size: 1.05rem; }
.steps .step p { color: var(--muted); font-size: .9rem; margin: 0; }
.timeline { border-left: 2px solid var(--border); padding-left: 24px; margin-left: 8px; }
.timeline .tl-item { position: relative; padding-bottom: 26px; }
.timeline .tl-item::before {
  content: ""; position: absolute; left: -32px; top: 3px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--primary); border: 3px solid var(--surface); box-shadow: 0 0 0 2px var(--primary-300);
}
.timeline .tl-item .tl-date { font-size: .8rem; color: var(--primary-600); font-weight: 600; }

/* --------------------------------------------------------------- Accordéon */
.accordion { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.accordion .acc-item { border-bottom: 1px solid var(--border); }
.accordion .acc-item:last-child { border-bottom: 0; }
.accordion .acc-head {
  width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  padding: 18px 22px; font-family: var(--font-title); font-weight: 600; font-size: 1.02rem;
  color: var(--text); display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.accordion .acc-head:hover { color: var(--primary-600); }
.accordion .acc-head .chev { transition: transform var(--t); color: var(--muted); flex: none; }
.accordion .acc-item.open .acc-head .chev { transform: rotate(180deg); color: var(--primary); }
.accordion .acc-body { max-height: 0; overflow: hidden; transition: max-height var(--t); }
.accordion .acc-item.open .acc-body { max-height: 600px; }
.accordion .acc-body .inner { padding: 0 22px 20px; color: var(--ink); }

/* --------------------------------------------------------------- Onglets */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 24px; flex-wrap: wrap; }
.tabs [data-tab] {
  background: none; border: 0; border-bottom: 2px solid transparent;
  padding: .8rem 1.1rem; cursor: pointer; font-family: var(--font-title);
  font-weight: 600; font-size: .95rem; color: var(--muted); transition: all var(--t);
  margin-bottom: -1px;
}
.tabs [data-tab]:hover { color: var(--primary-600); }
.tabs [data-tab].active { color: var(--primary-600); border-bottom-color: var(--primary); }
[data-pane] { display: none; }
[data-pane].active { display: block; animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------- Progression */
.progress { height: 10px; background: var(--surface-2); border-radius: var(--r-pill); overflow: hidden; }
.progress-bar { height: 100%; background: var(--grad-primary); border-radius: var(--r-pill); transition: width .5s ease; }
.progress-lbl { display: flex; justify-content: space-between; font-size: .82rem; color: var(--muted); margin-bottom: .35rem; }

/* --------------------------------------------------------------- Avatars */
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-title); font-weight: 700; font-size: .9rem; color: #fff;
  background: var(--grad-primary); overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 30px; height: 30px; font-size: .75rem; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.3rem; }
.avatar-group { display: flex; }
.avatar-group .avatar { border: 2px solid var(--surface); margin-left: -10px; }
.avatar-group .avatar:first-child { margin-left: 0; }

/* --------------------------------------------------------------- Breadcrumb */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary-600); }
.breadcrumb .sep { opacity: .5; }
.breadcrumb .current { color: var(--text); font-weight: 600; }

/* --------------------------------------------------------------- Pagination */
.pagination { display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 28px; }
.pagination a, .pagination span {
  min-width: 40px; height: 40px; padding: 0 .6rem;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: var(--r-md);
  color: var(--text); font-weight: 500; background: var(--surface); transition: all var(--t);
}
.pagination a:hover { border-color: var(--primary-300); color: var(--primary-600); background: var(--primary-050); }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .disabled { opacity: .45; pointer-events: none; }

/* --------------------------------------------------------------- Alertes */
.alert { display: flex; gap: .8rem; padding: 14px 18px; border-radius: var(--r-md); border: 1px solid; font-size: .92rem; align-items: flex-start; }
.alert .a-ico { flex: none; font-size: 1.1rem; }
.alert-info { background: var(--primary-050); border-color: var(--primary-300); color: var(--primary-600); }
.alert-success { background: var(--success-050); border-color: #b6e6c6; color: var(--success); }
.alert-warning { background: var(--warning-050); border-color: #f2d59b; color: var(--warning); }
.alert-danger { background: var(--danger-050); border-color: #f2b6b6; color: var(--danger); }

/* --------------------------------------------------------------- Calendrier */
.calendar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); overflow: hidden; }
.calendar .cal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.calendar .cal-head h3 { margin: 0; text-transform: capitalize; }
.calendar .cal-nav { display: flex; gap: 8px; }
.calendar .cal-nav button { width: 38px; height: 38px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-md); cursor: pointer; color: var(--text); }
.calendar .cal-nav button:hover { background: var(--surface-2); color: var(--primary-600); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.calendar-grid .cal-dow { text-align: center; padding: 12px 4px; font-size: .78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.cal-day {
  min-height: 108px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 8px; position: relative; background: var(--surface);
}
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.other { background: #fafcff; color: var(--muted); }
.cal-day.today { background: var(--primary-050); }
.cal-day .d-num { font-size: .82rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.cal-day.today .d-num { color: var(--primary-600); }
.cal-event {
  display: block; font-size: .74rem; padding: .28rem .5rem; border-radius: 6px;
  margin-bottom: 4px; color: #fff; font-weight: 600; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--primary); transition: filter var(--t);
}
.cal-event:hover { filter: brightness(1.06); }
.cal-event.cat-dev { background: #0d96d2; }
.cal-event.cat-cyber { background: #dc2626; }
.cal-event.cat-data { background: #7c3aed; }
.cal-event.cat-reseau { background: #0891b2; }
.cal-event.cat-design { background: #d97706; }
.cal-event.cat-office { background: #16a34a; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 16px 22px; border-top: 1px solid var(--border); }
.cal-legend .lg { display: inline-flex; align-items: center; gap: .45rem; font-size: .82rem; color: var(--muted); }
.cal-legend .lg .sw { width: 12px; height: 12px; border-radius: 4px; }

/* ------------------------------------------------- Graphiques CSS purs */
.bar-chart { display: flex; align-items: flex-end; gap: 14px; height: 220px; padding: 16px 0; }
.bar-chart .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar-chart .bar {
  width: 100%; max-width: 46px; border-radius: 8px 8px 0 0;
  background: var(--grad-primary); position: relative; transition: height .6s ease;
}
.bar-chart .bar .val { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: .78rem; font-weight: 700; color: var(--text); }
.bar-chart .bar-lbl { font-size: .78rem; color: var(--muted); }

.donut {
  --p: 68; --c: var(--primary);
  width: 150px; height: 150px; border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-2) 0);
  display: flex; align-items: center; justify-content: center; position: relative;
}
.donut::before { content: ""; position: absolute; width: 104px; height: 104px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.donut .donut-lbl { position: relative; text-align: center; font-family: var(--font-title); font-weight: 700; font-size: 1.5rem; color: var(--text); }
.donut-wrap { position: relative; display: inline-flex; }

.line-chart { position: relative; height: 200px; padding: 12px; }
.line-chart svg { width: 100%; height: 100%; overflow: visible; }
.line-chart .lc-line { fill: none; stroke: var(--primary); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.line-chart .lc-area { fill: url(#lcgrad); opacity: .5; }
.line-chart .lc-dot { fill: var(--surface); stroke: var(--primary); stroke-width: 3; }

/* --------------------------------------------------------- Drawer / Modal */
.overlay {
  position: fixed; inset: 0; background: rgba(36,50,68,.35);
  backdrop-filter: blur(2px); opacity: 0; visibility: hidden; transition: all var(--t); z-index: 1000;
}
.overlay.open { opacity: 1; visibility: visible; }

.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: 440px; max-width: 92vw;
  background: var(--surface); box-shadow: var(--shadow-lg); z-index: 1010;
  transform: translateX(100%); transition: transform var(--t); display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer .drawer-head { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.drawer .drawer-head h3 { margin: 0; }
.drawer .drawer-body { padding: 24px; overflow-y: auto; flex: 1; }
.drawer .drawer-foot { padding: 18px 24px; border-top: 1px solid var(--border); display: flex; gap: 12px; justify-content: flex-end; }

.modal {
  position: fixed; inset: 0; z-index: 1010; display: none;
  align-items: center; justify-content: center; padding: 20px;
}
.modal.open { display: flex; }
.modal .modal-card {
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 520px; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column;
  animation: modalIn .25s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.modal .modal-head { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal .modal-head h3 { margin: 0; }
.modal .modal-body { padding: 24px; overflow-y: auto; }
.modal .modal-foot { padding: 18px 24px; border-top: 1px solid var(--border); display: flex; gap: 12px; justify-content: flex-end; }
.modal-close, .drawer-close { background: none; border: 0; font-size: 1.4rem; line-height: 1; color: var(--muted); cursor: pointer; }
.modal-close:hover, .drawer-close:hover { color: var(--danger); }

/* --------------------------------------------------------- Témoignages */
.testimonial {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 26px; box-shadow: var(--shadow-xs); position: relative;
}
.testimonial::before { content: "\201C"; position: absolute; top: 10px; right: 22px; font-size: 4rem; color: var(--primary-050); font-family: var(--font-title); line-height: 1; }
.testimonial .quote { font-size: 1rem; color: var(--ink); position: relative; z-index: 1; }
.testimonial .who { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.testimonial .who .name { font-weight: 700; font-family: var(--font-title); font-size: .95rem; }
.testimonial .who .role { color: var(--muted); font-size: .82rem; }
.testimonial .stars { color: #f5b301; margin-bottom: 10px; letter-spacing: 2px; }

/* --------------------------------------------------------- Logos / certifs */
.logo-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 40px; opacity: .8; }
.logo-row .logo-item { height: 40px; display: flex; align-items: center; color: var(--muted); font-family: var(--font-title); font-weight: 700; font-size: 1.1rem; filter: grayscale(1); transition: all var(--t); }
.logo-row .logo-item:hover { filter: none; color: var(--primary-600); opacity: 1; }

/* --------------------------------------------------- Certificat imprimable */
.certificate {
  background: var(--surface);
  border: 2px solid var(--primary-300);
  border-radius: var(--r-lg);
  padding: 54px 60px; text-align: center; position: relative; overflow: hidden;
  box-shadow: var(--shadow-lg); max-width: 860px; margin: 0 auto;
}
.certificate::before {
  content: ""; position: absolute; inset: 12px; border: 1px solid var(--primary-050);
  border-radius: var(--r-md); pointer-events: none;
}
.certificate .cert-glow { position: absolute; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, rgba(13,150,210,.1), transparent 70%); top: -100px; right: -80px; }
.certificate .cert-logo { height: 46px; margin: 0 auto 18px; position: relative; }
.certificate .cert-eyebrow { font-family: var(--font-title); letter-spacing: .3em; text-transform: uppercase; color: var(--primary-600); font-size: .82rem; font-weight: 600; }
.certificate .cert-title { font-family: var(--font-title); font-size: 2.2rem; margin: 10px 0 6px; color: var(--text); }
.certificate .cert-sub { color: var(--muted); }
.certificate .cert-name { font-family: var(--font-title); font-size: 2rem; color: var(--primary-600); margin: 22px 0 6px; border-bottom: 2px solid var(--primary-050); display: inline-block; padding: 0 24px 8px; }
.certificate .cert-course { font-size: 1.15rem; font-weight: 600; margin-top: 14px; }
.certificate .cert-foot { display: flex; justify-content: space-between; margin-top: 44px; align-items: flex-end; }
.certificate .cert-sign { text-align: center; }
.certificate .cert-sign .line { width: 180px; border-top: 1px solid var(--ink); margin-bottom: 6px; }
.certificate .cert-sign small { color: var(--muted); }
.certificate .cert-seal {
  width: 92px; height: 92px; border-radius: 50%; background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 2rem;
  box-shadow: var(--shadow-primary);
}
.certificate .cert-id { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); font-size: .74rem; color: var(--muted); }

/* --------------------------------------------------------------- Login */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-visual { position: relative; overflow: hidden; background: var(--grad-vignette); color: #fff; padding: 60px; display: flex; flex-direction: column; justify-content: center; }
.auth-visual .glow { position: absolute; width: 380px; height: 380px; border-radius: 50%; background: rgba(255,255,255,.14); filter: blur(60px); top: -80px; right: -80px; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--bg); }
.auth-form .auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 36px; box-shadow: var(--shadow-md); }
.auth-form .auth-card img.logo { height: 40px; margin-bottom: 20px; }

/* --------------------------------------------------------------- Utilities */
.empty-state { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty-state .es-ico { font-size: 3rem; margin-bottom: 12px; opacity: .5; }
.divider-text { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: .85rem; margin: 18px 0; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.list-check { list-style: none; }
.list-check li { display: flex; gap: .6rem; padding: .35rem 0; color: var(--ink); }
.list-check li::before { content: "✓"; color: var(--success); font-weight: 700; flex: none; }

/* --------------------------------------------------------------- Responsive */
@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg); padding: 12px;
    transform: translateY(-120%); opacity: 0; visibility: hidden;
    transition: all var(--t); max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  }
  .site-header.open .main-nav { transform: translateY(0); opacity: 1; visibility: visible; }
  .main-nav a { padding: .9rem 1rem; }
  .dropdown { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding-left: 12px; display: none; }
  .has-dropdown.open .dropdown { display: block; }
  .header-actions .admin-link { display: none; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .site-footer .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-visual { display: none; }

  /* Sidebar admin repliable en overlay */
  .admin-sidebar {
    position: fixed; top: 0; left: 0; transform: translateX(-100%);
    transition: transform var(--t); box-shadow: var(--shadow-lg);
  }
  .admin-layout.sb-open .admin-sidebar { transform: translateX(0); }
  .admin-layout.collapsed .admin-sidebar { width: var(--sidebar-w); }
  .certificate { padding: 32px 24px; }
  .certificate .cert-foot { flex-direction: column; gap: 24px; align-items: center; }
}

@media (max-width: 560px) {
  .section { padding: 48px 0; }
  .steps { grid-template-columns: 1fr; }
  .site-footer .footer-grid { grid-template-columns: 1fr; }
  .hero { padding: 60px 0; }
  .admin-main { padding: 18px; }
  .cal-day { min-height: 72px; }
}

/* --------------------------------------------------------------- Print */
@media print {
  .site-header, .site-footer, .admin-sidebar, .admin-topbar, .no-print { display: none !important; }
  body { background: #fff; }
  .certificate { box-shadow: none; border-color: var(--primary); }
}
