/* ==========================================================================
   ESKN — École de Santé Koro de Niamana
   Système de design (Bootstrap 5.3 + surcouche maison)
   ========================================================================== */

:root {
  --eskn-primary: #0b4f9c;
  --eskn-primary-600: #0a4589;
  --eskn-primary-700: #083a73;
  --eskn-primary-900: #06284f;
  --eskn-primary-50: #eaf2fc;
  --eskn-primary-100: #d3e4f8;
  --eskn-accent: #f2a007;
  --eskn-accent-600: #d98c00;
  --eskn-accent-50: #fff6e3;
  --eskn-green: #11845b;
  --eskn-green-50: #e6f5ee;
  --eskn-red: #d63a3a;
  --eskn-red-50: #fdecec;
  --eskn-ink: #0f1b2d;
  --eskn-body: #334155;
  --eskn-muted: #64748b;
  --eskn-line: #e3e8ef;
  --eskn-soft: #f4f7fb;
  --eskn-white: #ffffff;
  --eskn-radius: 14px;
  --eskn-radius-sm: 10px;
  --eskn-shadow-sm: 0 1px 2px rgba(15, 27, 45, .06), 0 1px 3px rgba(15, 27, 45, .06);
  --eskn-shadow: 0 10px 30px -12px rgba(15, 27, 45, .18);
  --eskn-shadow-lg: 0 24px 60px -20px rgba(6, 40, 79, .35);
  --eskn-gradient: linear-gradient(135deg, #06284f 0%, #0b4f9c 60%, #1a6fc4 100%);
  --eskn-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --bs-primary: var(--eskn-primary);
  --bs-primary-rgb: 11, 79, 156;
  --bs-link-color: var(--eskn-primary);
  --bs-link-color-rgb: 11, 79, 156;
  --bs-link-hover-color: var(--eskn-primary-700);
  --bs-body-font-family: var(--eskn-font);
  --bs-body-color: var(--eskn-body);
  --bs-border-color: var(--eskn-line);
  --bs-border-radius: var(--eskn-radius-sm);
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--eskn-font);
  color: var(--eskn-body);
  background: var(--eskn-white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  color: var(--eskn-ink);
  font-weight: 700;
  letter-spacing: -.01em;
}
a { text-decoration: none; }
img { max-width: 100%; }
::selection { background: var(--eskn-primary-100); }

/* ---------- Boutons ---------- */
.btn {
  --bs-btn-font-weight: 600;
  --bs-btn-border-radius: 10px;
  --bs-btn-padding-x: 1.1rem;
  --bs-btn-padding-y: .6rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-lg { --bs-btn-padding-x: 1.5rem; --bs-btn-padding-y: .85rem; --bs-btn-font-size: 1rem; }
.btn-sm { --bs-btn-padding-x: .75rem; --bs-btn-padding-y: .4rem; --bs-btn-border-radius: 8px; }
.btn-primary {
  --bs-btn-bg: var(--eskn-primary); --bs-btn-border-color: var(--eskn-primary);
  --bs-btn-hover-bg: var(--eskn-primary-700); --bs-btn-hover-border-color: var(--eskn-primary-700);
  --bs-btn-active-bg: var(--eskn-primary-900); --bs-btn-active-border-color: var(--eskn-primary-900);
  --bs-btn-disabled-bg: var(--eskn-primary); --bs-btn-disabled-border-color: var(--eskn-primary);
}
.btn-accent {
  --bs-btn-color: #1d1300; --bs-btn-bg: var(--eskn-accent); --bs-btn-border-color: var(--eskn-accent);
  --bs-btn-hover-color: #1d1300; --bs-btn-hover-bg: #ffb42a; --bs-btn-hover-border-color: #ffb42a;
  --bs-btn-active-color: #1d1300; --bs-btn-active-bg: var(--eskn-accent-600); --bs-btn-active-border-color: var(--eskn-accent-600);
  box-shadow: 0 8px 20px -10px rgba(242, 160, 7, .9);
}
.btn-outline-primary {
  --bs-btn-color: var(--eskn-primary); --bs-btn-border-color: var(--eskn-primary-100);
  --bs-btn-hover-bg: var(--eskn-primary-50); --bs-btn-hover-color: var(--eskn-primary-700); --bs-btn-hover-border-color: var(--eskn-primary-100);
  --bs-btn-active-bg: var(--eskn-primary-100); --bs-btn-active-color: var(--eskn-primary-700); --bs-btn-active-border-color: var(--eskn-primary-100);
}
.btn-success { --bs-btn-bg: var(--eskn-green); --bs-btn-border-color: var(--eskn-green); --bs-btn-hover-bg: #0c6b49; --bs-btn-hover-border-color: #0c6b49; }
.btn-danger { --bs-btn-bg: var(--eskn-red); --bs-btn-border-color: var(--eskn-red); }
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--eskn-line); --bs-btn-hover-bg: var(--eskn-soft); --bs-btn-hover-border-color: var(--eskn-line); }
.btn-ghost-light { color: #fff; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.06); }
.btn-ghost-light:hover { color: #fff; background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.6); }

/* ---------- Formulaires ---------- */
.form-label { font-weight: 600; color: var(--eskn-ink); font-size: .9rem; margin-bottom: .35rem; }
.form-control, .form-select {
  border-radius: 10px; border-color: var(--eskn-line); padding: .65rem .9rem; font-size: .95rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--eskn-primary); box-shadow: 0 0 0 .22rem rgba(11, 79, 156, .14);
}
.form-text { color: var(--eskn-muted); }
.form-check-input:checked { background-color: var(--eskn-primary); border-color: var(--eskn-primary); }
.invalid-feedback, .form-error-message { display: block; color: var(--eskn-red); font-size: .85rem; margin-top: .3rem; }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--eskn-red); }

/* ---------- Badges ---------- */
.badge { font-weight: 600; letter-spacing: .01em; border-radius: 999px; padding: .4em .75em; }
.badge-soft-primary { background: var(--eskn-primary-50); color: var(--eskn-primary-700); }
.badge-soft-success { background: var(--eskn-green-50); color: var(--eskn-green); }
.badge-soft-warning { background: var(--eskn-accent-50); color: #8a5a00; }
.badge-soft-danger { background: var(--eskn-red-50); color: var(--eskn-red); }
.badge-soft-secondary { background: #eef1f5; color: var(--eskn-muted); }
.badge-live { background: var(--eskn-red); color: #fff; }
.badge-live::before {
  content: ""; display: inline-block; width: .5em; height: .5em; border-radius: 50%;
  background: #fff; margin-right: .4em; vertical-align: .05em; animation: eskn-pulse 1.4s infinite;
}
@keyframes eskn-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* ---------- Cartes ---------- */
.card { border: 1px solid var(--eskn-line); border-radius: var(--eskn-radius); box-shadow: var(--eskn-shadow-sm); }
.card-header { background: transparent; border-bottom: 1px solid var(--eskn-line); padding: 1rem 1.25rem; font-weight: 700; color: var(--eskn-ink); }
.card-body { padding: 1.25rem; }
.card-hover { transition: transform .2s ease, box-shadow .2s ease; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--eskn-shadow); }

/* ==========================================================================
   SITE PUBLIC
   ========================================================================== */

.topbar { background: var(--eskn-primary-900); color: rgba(255,255,255,.78); font-size: .82rem; }
.topbar a { color: rgba(255,255,255,.85); }
.topbar a:hover { color: #fff; }
.topbar .container { display: flex; justify-content: space-between; align-items: center; min-height: 38px; gap: 1rem; }
.topbar i { color: var(--eskn-accent); margin-right: .35rem; }

.site-header { position: sticky; top: 0; z-index: 1030; background: rgba(255,255,255,.96); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--eskn-line); }
.site-header .navbar { padding: .55rem 0; }
.brand { display: flex; align-items: center; gap: .7rem; color: var(--eskn-ink); }
.brand img { height: 48px; width: auto; }
.brand-text { line-height: 1.1; }
.brand-text strong { display: block; font-size: 1.05rem; font-weight: 800; color: var(--eskn-primary); letter-spacing: .02em; }
.brand-text small { display: block; font-size: .72rem; color: var(--eskn-muted); font-weight: 600; }
.site-header .nav-link { font-weight: 600; color: var(--eskn-ink); padding: .6rem .85rem !important; border-radius: 8px; font-size: .95rem; }
.site-header .nav-link:hover, .site-header .nav-link.active { color: var(--eskn-primary); background: var(--eskn-primary-50); }
.site-header .dropdown-menu { border: 1px solid var(--eskn-line); border-radius: var(--eskn-radius); box-shadow: var(--eskn-shadow); padding: .5rem; }
.site-header .dropdown-item { border-radius: 8px; padding: .5rem .75rem; font-size: .92rem; }
.site-header .dropdown-item:active { background: var(--eskn-primary); }

/* Méga-menu formations */
.mega-menu { width: min(980px, 96vw); padding: 1.25rem !important; }
.mega-domain-title { display: flex; align-items: center; gap: .5rem; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--eskn-primary); margin-bottom: .6rem; }
.mega-domain-title i { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--eskn-primary-50); }
.mega-group { margin-bottom: .9rem; }
.mega-group-title { font-weight: 700; font-size: .85rem; color: var(--eskn-ink); margin-bottom: .2rem; }
.mega-group-title span { font-weight: 500; color: var(--eskn-muted); }
.mega-group a { display: block; font-size: .85rem; color: var(--eskn-body); padding: .18rem 0; }
.mega-group a:hover { color: var(--eskn-primary); }
@media (min-width: 992px) {
  .mega-menu { position: absolute; left: 50% !important; transform: translateX(-50%); }
  .mega-scroll { max-height: 70vh; overflow-y: auto; }
}
@media (max-width: 991.98px) {
  .mega-menu { width: 100%; box-shadow: none !important; border: 0 !important; padding: .25rem .5rem !important; }
  .site-header .navbar-collapse { padding: .75rem 0 1rem; max-height: 80vh; overflow-y: auto; }
}

/* Héros */
.hero { position: relative; color: #fff; overflow: hidden; background: var(--eskn-primary-900); }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .35; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(6,40,79,.96) 0%, rgba(6,40,79,.85) 45%, rgba(11,79,156,.35) 100%); }
.hero .container { position: relative; z-index: 2; }
.hero-inner { padding: 6.5rem 0 7rem; max-width: 680px; }
.hero h1 { color: #fff; font-size: clamp(2.1rem, 4.5vw, 3.5rem); font-weight: 800; line-height: 1.08; margin-bottom: 1.25rem; }
.hero h1 span { color: var(--eskn-accent); }
.hero p.lead { color: rgba(255,255,255,.85); font-size: 1.15rem; max-width: 560px; margin-bottom: 2rem; }
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--eskn-accent); margin-bottom: 1rem; }
.eyebrow::before { content: ""; width: 28px; height: 2px; background: currentColor; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 2.5rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid rgba(255,255,255,.15); }
.hero-stats strong { display: block; font-size: 1.9rem; color: #fff; font-weight: 800; }
.hero-stats span { font-size: .85rem; color: rgba(255,255,255,.7); }

/* Bloc code d'accès (héros) */
.join-card { background: #fff; color: var(--eskn-body); border-radius: 18px; box-shadow: var(--eskn-shadow-lg); padding: 1.75rem; }
.join-card h3 { font-size: 1.2rem; }
.code-input { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 1.4rem !important; letter-spacing: .3em; text-transform: uppercase; text-align: center; font-weight: 700; }

/* Sections */
.section { padding: 5.5rem 0; }
.section-sm { padding: 3.5rem 0; }
.section-soft { background: var(--eskn-soft); }
.section-dark { background: var(--eskn-primary-900); color: rgba(255,255,255,.8); }
.section-dark h2, .section-dark h3, .section-dark h4 { color: #fff; }
.section-head { max-width: 680px; margin-bottom: 3rem; }
.section-head.text-center { margin-left: auto; margin-right: auto; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 800; margin-bottom: .75rem; }
.section-head p { color: var(--eskn-muted); font-size: 1.05rem; }

.feature-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.3rem; background: var(--eskn-primary-50); color: var(--eskn-primary); flex-shrink: 0; }
.feature-icon.accent { background: var(--eskn-accent-50); color: var(--eskn-accent-600); }
.feature-icon.green { background: var(--eskn-green-50); color: var(--eskn-green); }

.domain-card { position: relative; border-radius: 20px; overflow: hidden; min-height: 380px; color: #fff; display: flex; align-items: flex-end; }
.domain-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.domain-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6,40,79,0) 20%, rgba(6,40,79,.92) 100%); }
.domain-card:hover img { transform: scale(1.05); }
.domain-card .content { position: relative; z-index: 2; padding: 2rem; }
.domain-card h3 { color: #fff; font-size: 1.6rem; font-weight: 800; }
.domain-card .levels { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0 1.25rem; }
.domain-card .levels span { font-size: .78rem; font-weight: 600; padding: .3rem .7rem; border-radius: 999px; background: rgba(255,255,255,.15); backdrop-filter: blur(4px); }

.steps { counter-reset: step; }
.step { position: relative; padding-left: 4rem; margin-bottom: 2rem; }
.step::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; background: var(--eskn-accent); color: #1d1300; }
.step h4 { font-size: 1.1rem; margin-bottom: .3rem; }
.section-dark .step p { color: rgba(255,255,255,.72); }

.cta-band { background: var(--eskn-gradient); border-radius: 24px; padding: 3rem; color: #fff; position: relative; overflow: hidden; }
.cta-band h2 { color: #fff; }
.cta-band::after { content: ""; position: absolute; right: -80px; top: -80px; width: 300px; height: 300px; border-radius: 50%; background: rgba(242,160,7,.16); }

/* Bannière des pages intérieures */
.page-hero { background: var(--eskn-gradient); color: #fff; padding: 3.5rem 0 3rem; }
.page-hero h1 { color: #fff; font-size: clamp(1.7rem, 3.5vw, 2.6rem); font-weight: 800; margin: 0; }
.page-hero p { color: rgba(255,255,255,.82); margin: .5rem 0 0; font-size: 1.05rem; }
.page-hero .breadcrumb { margin-bottom: .75rem; --bs-breadcrumb-divider-color: rgba(255,255,255,.5); --bs-breadcrumb-item-active-color: rgba(255,255,255,.75); }
.page-hero .breadcrumb a { color: #fff; }

/* Pied de page */
.site-footer { background: #041b36; color: rgba(255,255,255,.68); padding: 4.5rem 0 0; font-size: .93rem; }
.site-footer h5 { color: #fff; font-size: .95rem; font-weight: 700; margin-bottom: 1.1rem; }
.site-footer a { color: rgba(255,255,255,.72); }
.site-footer a:hover { color: var(--eskn-accent); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .55rem; }
.site-footer .brand-text strong { color: #fff; }
.site-footer .brand-text small { color: rgba(255,255,255,.6); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 3rem; padding: 1.25rem 0; font-size: .82rem; }
.footer-contact i { color: var(--eskn-accent); width: 20px; }

/* Messages flash */
.flash-stack { position: fixed; top: 90px; right: 16px; z-index: 1090; width: min(420px, calc(100vw - 32px)); }
.flash-stack .alert { box-shadow: var(--eskn-shadow); border: 0; border-radius: 12px; }
.alert { border-radius: 12px; }

/* ==========================================================================
   ESPACES CONNECTÉS (admin / professeur / étudiant)
   ========================================================================== */
.app-body { background: var(--eskn-soft); min-height: 100vh; }
.app-shell { display: flex; min-height: 100vh; }
.app-sidebar {
  width: 264px; flex-shrink: 0; background: var(--eskn-primary-900); color: rgba(255,255,255,.75);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.app-sidebar .brand { padding: 1.1rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.app-sidebar .brand img { height: 40px; background: #fff; border-radius: 10px; padding: 2px; }
.app-sidebar .brand-text strong { color: #fff; }
.app-sidebar .brand-text small { color: rgba(255,255,255,.55); }
.side-label { font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.4); padding: 1.25rem 1.5rem .5rem; }
.side-nav { list-style: none; padding: 0 .75rem; margin: 0; }
.side-nav a { display: flex; align-items: center; gap: .75rem; color: rgba(255,255,255,.78); padding: .62rem .8rem; border-radius: 10px; font-weight: 600; font-size: .92rem; margin-bottom: 2px; }
.side-nav a i { width: 20px; text-align: center; opacity: .85; }
.side-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-nav a.active { background: var(--eskn-primary); color: #fff; box-shadow: 0 6px 16px -8px rgba(0,0,0,.5); }
.side-nav .count { margin-left: auto; background: var(--eskn-accent); color: #1d1300; font-size: .72rem; font-weight: 800; border-radius: 999px; padding: .1rem .5rem; }
.side-footer { margin-top: auto; padding: 1rem; border-top: 1px solid rgba(255,255,255,.08); }
.side-user { display: flex; align-items: center; gap: .7rem; color: #fff; }
.side-user small { color: rgba(255,255,255,.55); display: block; font-size: .75rem; }

.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; background: var(--eskn-accent); color: #1d1300; flex-shrink: 0; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.1rem; }
.avatar-primary { background: var(--eskn-primary-50); color: var(--eskn-primary); }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-topbar { background: #fff; border-bottom: 1px solid var(--eskn-line); padding: .85rem 1.75rem; display: flex; align-items: center; gap: 1rem; position: sticky; top: 0; z-index: 1020; }
.app-topbar h1 { font-size: 1.2rem; margin: 0; font-weight: 800; }
.app-topbar .crumb { font-size: .8rem; color: var(--eskn-muted); }
.app-content { padding: 1.75rem; flex: 1; }
.app-content > .container-fluid { max-width: 1280px; }

@media (max-width: 991.98px) {
  .app-sidebar { position: fixed; left: 0; top: 0; z-index: 1045; transform: translateX(-100%); transition: transform .25s ease; }
  .app-sidebar.open { transform: none; box-shadow: var(--eskn-shadow-lg); }
  .app-backdrop { position: fixed; inset: 0; background: rgba(6,40,79,.45); z-index: 1040; display: none; }
  .app-backdrop.show { display: block; }
  .app-content { padding: 1rem; }
  .app-topbar { padding: .75rem 1rem; }
}

.stat-card { background: #fff; border: 1px solid var(--eskn-line); border-radius: var(--eskn-radius); padding: 1.25rem; display: flex; gap: 1rem; align-items: center; height: 100%; }
.stat-card .value { font-size: 1.75rem; font-weight: 800; color: var(--eskn-ink); line-height: 1; }
.stat-card .label { font-size: .85rem; color: var(--eskn-muted); margin-top: .3rem; }

.table { --bs-table-hover-bg: var(--eskn-soft); margin: 0; }
.table > thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--eskn-muted); font-weight: 700; background: var(--eskn-soft); border-bottom: 1px solid var(--eskn-line); padding: .75rem 1rem; white-space: nowrap; }
.table > tbody td { padding: .85rem 1rem; vertical-align: middle; border-color: var(--eskn-line); }
.table-card { background: #fff; border: 1px solid var(--eskn-line); border-radius: var(--eskn-radius); overflow: hidden; }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--eskn-muted); }
.empty-state i { font-size: 2.4rem; color: var(--eskn-primary-100); margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.1rem; color: var(--eskn-ink); }

.access-code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-weight: 800; letter-spacing: .12em; color: var(--eskn-primary-700); background: var(--eskn-primary-50); border: 1px dashed var(--eskn-primary-100); border-radius: 10px; padding: .35rem .7rem; display: inline-flex; align-items: center; gap: .5rem; white-space: nowrap; }
.access-code.big { font-size: 2.2rem; padding: .6rem 1.2rem; letter-spacing: .2em; }

.filter-pills .btn { border-radius: 999px; }
.dl-grid { display: grid; grid-template-columns: 170px 1fr; gap: .55rem 1rem; margin: 0; }
.dl-grid dt { color: var(--eskn-muted); font-weight: 600; font-size: .88rem; }
.dl-grid dd { margin: 0; color: var(--eskn-ink); }
@media (max-width: 575.98px) { .dl-grid { grid-template-columns: 1fr; } .dl-grid dd { margin-bottom: .5rem; } }

.status-hero { border-radius: 18px; padding: 2rem; color: #fff; background: var(--eskn-gradient); }
.status-hero.pending { background: linear-gradient(135deg, #7a4b00, #d98c00); }
.status-hero.rejected { background: linear-gradient(135deg, #7d1d1d, #d63a3a); }
.status-hero h2 { color: #fff; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 1.25rem 2.25rem; }
.timeline li::before { content: ""; position: absolute; left: 11px; top: 26px; bottom: 0; width: 2px; background: var(--eskn-line); }
.timeline li:last-child::before { display: none; }
.timeline .dot { position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .7rem; background: var(--eskn-line); color: var(--eskn-muted); }
.timeline .done .dot { background: var(--eskn-green); color: #fff; }
.timeline .current .dot { background: var(--eskn-accent); color: #1d1300; }

/* ==========================================================================
   Compatibilité avec les anciennes pages (thème précédent / Bootstrap 4)
   ========================================================================== */
.auto-container { max-width: 1200px; margin: 0 auto; padding: 0 15px; position: relative; }
.page-banner, .student-header, .admin-header { background: var(--eskn-gradient) !important; padding: 3.5rem 0 3rem !important; color: #fff; }
.page-banner h1, .student-header h1, .admin-header h1 { color: #fff; font-size: clamp(1.7rem, 3.5vw, 2.5rem) !important; font-weight: 800; text-shadow: none !important; }
.page-banner .breadcrumb { padding: .5rem 1rem !important; }
.page-title { background: var(--eskn-gradient) !important; padding: 3.5rem 0 3rem; color: #fff; }
.page-title h1 { color: #fff; font-weight: 800; }
.bread-crumb { list-style: none; padding: 0; margin: .5rem 0 0; display: flex; gap: .5rem; }
.bread-crumb li + li::before { content: "/"; margin-right: .5rem; opacity: .6; }
.bread-crumb a { color: #fff; }
.formation-details, .courses-section { padding: 4rem 0 !important; }
.sec-title { margin-bottom: 2rem; }
.sec-title h2 { font-weight: 800; }
.theme-btn { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; padding: .65rem 1.2rem; border-radius: 10px; background: var(--eskn-primary); color: #fff; border: 0; }
.theme-btn:hover { background: var(--eskn-primary-700); color: #fff; }
.clearfix::after { content: ""; display: table; clear: both; }
.float-right { float: right !important; } .float-left { float: left !important; }
.text-right { text-align: right !important; } .text-left { text-align: left !important; }
.font-weight-bold { font-weight: 700 !important; } .font-weight-normal { font-weight: 400 !important; }
.ml-1 { margin-left: .25rem !important; } .ml-2 { margin-left: .5rem !important; } .ml-3 { margin-left: 1rem !important; } .ml-auto { margin-left: auto !important; }
.mr-1 { margin-right: .25rem !important; } .mr-2 { margin-right: .5rem !important; } .mr-3 { margin-right: 1rem !important; } .mr-auto { margin-right: auto !important; }
.pl-3 { padding-left: 1rem !important; } .pr-3 { padding-right: 1rem !important; }
.badge-primary { background: var(--eskn-primary); color: #fff; } .badge-success { background: var(--eskn-green); color: #fff; }
.badge-warning { background: var(--eskn-accent); color: #1d1300; } .badge-danger { background: var(--eskn-red); color: #fff; }
.badge-info { background: #0ea5e9; color: #fff; } .badge-secondary { background: #94a3b8; color: #fff; }
.form-group { margin-bottom: 1rem; }
.btn-block { display: flex; width: 100%; }
.fw-800 { font-weight: 800 !important; }
.site-header .nav-link, .site-header .btn, .brand-text small { white-space: nowrap; }
@media (min-width: 1200px) {
  .mega-menu { position: absolute; left: 50% !important; transform: translateX(-50%); }
  .mega-scroll { max-height: 70vh; overflow-y: auto; }
}
@media (max-width: 1199.98px) {
  .mega-menu { width: 100%; box-shadow: none !important; border: 0 !important; padding: .25rem .5rem !important; position: static !important; transform: none !important; }
  .site-header .navbar-collapse { padding: .75rem 0 1rem; max-height: 80vh; overflow-y: auto; }
}
@media (max-width: 400px) { .brand-text small { display: none; } }
@media (min-width: 1200px) and (max-width: 1399.98px) { .site-header .brand-text small { display: none; } }
@media (max-width: 575.98px) {
  .stat-card { flex-direction: column; align-items: flex-start; gap: .6rem; padding: 1rem; }
  .stat-card .value { font-size: 1.4rem; }
  .app-topbar h1 { font-size: 1.05rem; }
  .app-topbar .btn { --bs-btn-padding-x: .6rem; font-size: .8rem; white-space: nowrap; }
  .access-code.big { font-size: 1.6rem; }
}

/* ==========================================================================
   Back-office v2
   ========================================================================== */
.app-sidebar { transition: width .2s ease; }
.side-scroll { flex: 1; overflow-y: auto; padding-bottom: 1rem; }
.side-label { padding: 1.1rem 1.5rem .4rem; }
.side-nav a { position: relative; white-space: nowrap; }
.side-nav .count { min-width: 22px; text-align: center; }
.side-link { display: flex; align-items: center; gap: .75rem; color: rgba(255,255,255,.7); padding: .55rem .8rem; border-radius: 10px; font-size: .88rem; font-weight: 600; white-space: nowrap; }
.side-link:hover { color: #fff; background: rgba(255,255,255,.07); }
@media (min-width: 992px) {
  .sidebar-collapsed .app-sidebar { width: 76px; }
  .sidebar-collapsed .app-sidebar .brand-text,
  .sidebar-collapsed .app-sidebar .label,
  .sidebar-collapsed .app-sidebar .side-label { display: none; }
  .sidebar-collapsed .app-sidebar .brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .sidebar-collapsed .side-nav a, .sidebar-collapsed .side-link { justify-content: center; }
  .sidebar-collapsed .side-nav .count { position: absolute; top: 2px; right: 6px; font-size: .6rem; padding: 0 .3rem; }
  .sidebar-collapsed .side-nav { padding-top: .5rem; }
}

.app-topbar { gap: .75rem; padding: .65rem 1.5rem; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 10px; color: var(--eskn-body); background: transparent; border: 1px solid transparent; }
.btn-icon:hover { background: var(--eskn-soft); border-color: var(--eskn-line); }
.dot-badge { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; border-radius: 999px; background: var(--eskn-red); color: #fff; font-size: .65rem; font-weight: 800; display: grid; place-items: center; padding: 0 4px; border: 2px solid #fff; }
.topbar-search { position: relative; align-items: center; flex: 1; max-width: 460px; }
.topbar-search i { position: absolute; left: .9rem; color: var(--eskn-muted); font-size: .85rem; }
.topbar-search input { width: 100%; border: 1px solid var(--eskn-line); background: var(--eskn-soft); border-radius: 10px; padding: .55rem 2.5rem .55rem 2.3rem; font-size: .9rem; }
.topbar-search input:focus { outline: none; background: #fff; border-color: var(--eskn-primary); box-shadow: 0 0 0 .2rem rgba(11,79,156,.12); }
.topbar-search kbd { position: absolute; right: .6rem; background: #fff; color: var(--eskn-muted); border: 1px solid var(--eskn-line); font-size: .7rem; padding: .05rem .4rem; box-shadow: none; }
.user-chip { display: flex; align-items: center; gap: .6rem; padding: .3rem .6rem .3rem .3rem; border-radius: 999px; border: 1px solid var(--eskn-line); background: #fff; }
.user-chip:hover { background: var(--eskn-soft); }
.user-chip .avatar { width: 32px; height: 32px; font-size: .75rem; }
.notif-menu { width: 320px; padding: .5rem; border-radius: 14px; border: 1px solid var(--eskn-line); box-shadow: var(--eskn-shadow); }
.notif-head { font-weight: 700; color: var(--eskn-ink); padding: .4rem .6rem .6rem; }
.notif-item { display: flex; gap: .75rem; align-items: center; padding: .6rem; border-radius: 10px; color: var(--eskn-body); font-size: .88rem; }
.notif-item:hover { background: var(--eskn-soft); }
.notif-item .feature-icon { width: 36px; height: 36px; font-size: .9rem; border-radius: 10px; }
.notif-empty { padding: .8rem .6rem; color: var(--eskn-muted); font-size: .88rem; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem; margin-bottom: 1.5rem; }
.page-head h1 { font-size: 1.55rem; font-weight: 800; margin: 0; }
.page-head .crumb { font-size: .8rem; color: var(--eskn-muted); margin-bottom: .2rem; }
.page-head .crumb a { color: var(--eskn-muted); }
.page-head .crumb a:hover { color: var(--eskn-primary); }
.page-head .subtitle { color: var(--eskn-muted); margin: .25rem 0 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.page-actions:empty { display: none; }

/* Indicateurs */
.kpi { background: #fff; border: 1px solid var(--eskn-line); border-radius: var(--eskn-radius); padding: 1.15rem 1.25rem; height: 100%; display: flex; flex-direction: column; gap: .35rem; color: inherit; transition: box-shadow .2s, transform .2s; }
a.kpi:hover { box-shadow: var(--eskn-shadow); transform: translateY(-2px); color: inherit; }
.kpi-top { display: flex; justify-content: space-between; align-items: center; }
.kpi-label { font-size: .82rem; color: var(--eskn-muted); font-weight: 600; }
.kpi-value { font-size: 1.9rem; font-weight: 800; color: var(--eskn-ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-foot { font-size: .8rem; color: var(--eskn-muted); }
.kpi .feature-icon { width: 38px; height: 38px; font-size: .95rem; border-radius: 10px; }
.kpi.attention { border-color: #f6d48a; background: linear-gradient(180deg, #fffaf0, #fff); }

/* Graphiques */
.chart-card .card-body { padding-top: .5rem; }
.chart-wrap { position: relative; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-svg .grid line { stroke: var(--eskn-line); stroke-width: 1; }
.chart-svg .axis text { fill: var(--eskn-muted); font-size: 11px; font-family: var(--eskn-font); }
.chart-svg .bar { fill: var(--eskn-primary); transition: opacity .15s; }
.chart-svg .bar-hit { fill: transparent; cursor: default; }
.chart-svg .bar-hit:hover + .bar, .chart-svg g.col:hover .bar { fill: var(--eskn-primary-700); }
.chart-tip { position: absolute; pointer-events: none; background: var(--eskn-ink); color: #fff; font-size: .8rem; padding: .4rem .6rem; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity .1s; z-index: 5; }
.chart-tip.show { opacity: 1; }
.chart-tip strong { font-variant-numeric: tabular-nums; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .75rem; align-items: center; margin-bottom: .9rem; }
.hbar-name { font-size: .86rem; color: var(--eskn-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-val { font-size: .86rem; font-weight: 700; color: var(--eskn-ink); font-variant-numeric: tabular-nums; }
.hbar-track { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--eskn-soft); overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 4px; background: var(--eskn-primary); }

/* Fil d'activité */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--eskn-line); }
.feed li:last-child { border-bottom: 0; }
.feed .feature-icon { width: 32px; height: 32px; font-size: .8rem; border-radius: 9px; }
.feed .feature-icon.red { background: var(--eskn-red-50); color: var(--eskn-red); }
.feed .text { font-size: .88rem; color: var(--eskn-body); }
.feed .text a { color: var(--eskn-ink); }
.feed time { display: block; font-size: .76rem; color: var(--eskn-muted); }

/* Barres d'outils des listes */
.list-toolbar { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between; align-items: center; padding: .9rem 1rem; border-bottom: 1px solid var(--eskn-line); }
.seg { display: inline-flex; background: var(--eskn-soft); border: 1px solid var(--eskn-line); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg a { padding: .35rem .75rem; border-radius: 8px; font-size: .85rem; font-weight: 600; color: var(--eskn-muted); white-space: nowrap; }
.seg a:hover { color: var(--eskn-ink); }
.seg a.active { background: #fff; color: var(--eskn-ink); box-shadow: var(--eskn-shadow-sm); }
.seg a .n { font-weight: 700; color: var(--eskn-muted); margin-left: .25rem; font-variant-numeric: tabular-nums; }
.search-inline { position: relative; }
.search-inline i { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--eskn-muted); font-size: .8rem; }
.search-inline input { padding-left: 2.1rem; min-width: 240px; }
.list-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; padding: .75rem 1rem; border-top: 1px solid var(--eskn-line); font-size: .85rem; color: var(--eskn-muted); }
.pagination { --bs-pagination-color: var(--eskn-body); --bs-pagination-active-bg: var(--eskn-primary); --bs-pagination-active-border-color: var(--eskn-primary); --bs-pagination-border-color: var(--eskn-line); --bs-pagination-font-size: .85rem; margin: 0; }
.person { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.person .avatar { width: 36px; height: 36px; font-size: .78rem; }
.person a, .person strong { color: var(--eskn-ink); font-weight: 600; }
.person small { display: block; color: var(--eskn-muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; gap: .35rem; justify-content: flex-end; }
.row-actions .btn { --bs-btn-padding-x: .55rem; --bs-btn-padding-y: .3rem; }
.status-dot { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; white-space: nowrap; }
.status-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--eskn-muted); }
.status-dot.ok::before { background: var(--eskn-green); }
.status-dot.warn::before { background: var(--eskn-accent); }
.status-dot.off::before { background: #cbd5e1; }
.role-pill { font-size: .75rem; font-weight: 700; border-radius: 6px; padding: .2rem .5rem; white-space: nowrap; }
.role-pill.admin { background: #f1e8ff; color: #6b21a8; }
.role-pill.prof { background: var(--eskn-green-50); color: var(--eskn-green); }
.role-pill.etudiant { background: var(--eskn-primary-50); color: var(--eskn-primary-700); }
.danger-zone { border: 1px solid #f3c4c4; border-radius: var(--eskn-radius); padding: 1rem 1.25rem; background: #fffafa; }
.thumb-16x9 { aspect-ratio: 16/9; object-fit: cover; width: 100%; border-radius: 10px; background: var(--eskn-soft); }
@media (max-width: 575.98px) {
  .page-head h1 { font-size: 1.25rem; }
  .search-inline input { min-width: 0; width: 100%; }
  .search-inline { flex: 1; }
  .kpi-value { font-size: 1.5rem; }
}

/* ==========================================================================
   Espace étudiant
   ========================================================================== */
.live-banner { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-radius: var(--eskn-radius); background: linear-gradient(120deg, #5e1414, #b42b2b 55%, #d63a3a); box-shadow: var(--eskn-shadow); }
.live-pulse { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: rgba(255,255,255,.15); color: #fff; font-size: 1.2rem; flex-shrink: 0; position: relative; }
.live-pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 16px; border: 2px solid rgba(255,255,255,.5); animation: eskn-ring 1.6s ease-out infinite; }
@keyframes eskn-ring { 0% { opacity: .9; transform: scale(.9); } 100% { opacity: 0; transform: scale(1.25); } }
@media (prefers-reduced-motion: reduce) { .live-pulse::after, .badge-live::before { animation: none; } }
.date-chip { width: 52px; flex-shrink: 0; text-align: center; border-radius: 12px; background: var(--eskn-primary-50); color: var(--eskn-primary-700); padding: .35rem 0; line-height: 1.1; }
.date-chip span { display: block; font-size: 1.25rem; font-weight: 800; }
.date-chip small { font-size: .7rem; font-weight: 700; text-transform: uppercase; }
.date-chip.past { background: var(--eskn-soft); color: var(--eskn-muted); }
.min-w-0 { min-width: 0; }

/* Barre d'onglets mobile (étudiants) */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1035; display: flex; justify-content: space-around; align-items: flex-end; background: #fff; border-top: 1px solid var(--eskn-line); padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px -12px rgba(15,27,45,.25); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .15rem; font-size: .68rem; font-weight: 600; color: var(--eskn-muted); padding: .25rem 0; }
.tabbar a i { font-size: 1.1rem; }
.tabbar a.active { color: var(--eskn-primary); }
.tabbar .tab-main { flex: 0 0 auto; width: 54px; height: 54px; margin: -22px .5rem 0; border-radius: 50%; justify-content: center; background: var(--eskn-accent); color: #1d1300; box-shadow: 0 8px 20px -8px rgba(242,160,7,.9); border: 4px solid #fff; }
.tabbar .tab-main i { font-size: 1.2rem; }
.tabbar .tab-main.active { color: #1d1300; }
@media (max-width: 991.98px) { .app-main:has(.tabbar) .app-content { padding-bottom: 6rem; } }

/* Téléversement des pièces de pré-inscription */
.upload-box { border: 1px dashed var(--eskn-line); border-radius: 12px; padding: .85rem; background: var(--eskn-soft); height: 100%; }
.upload-box.is-invalid { border-color: var(--eskn-red); background: var(--eskn-red-50); }
.upload-box .form-text { font-size: .78rem; }
