/* ============================================================
   AMI Portal — Feuille de styles principale
   Design inspiré de l'Université Laval : sobre, institutionnel,
   whitespace généreux, typographie forte.
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --ami-rouge:       #c8102e;
  --ami-rouge-dark:  #a00d24;
  --ami-rouge-light: #fde8ec;
  --ami-bleu:        #1e3a8a;
  --ami-bleu-med:    #2563eb;
  --ami-bleu-pale:   #dbeafe;
  --ami-blanc:       #ffffff;
  --ami-fond:        #f7f7f7;
  --ami-gris:        #e8e8e8;
  --ami-gris-md:     #9ca3af;
  --ami-texte:       #111111;
  --ami-texte-sec:   #555555;
  --ami-border:      #d1d5db;
  --ami-vert:        #059669;
  --ami-orange:      #d97706;
  --ami-violet:      #7c3aed;
  --radius-xs:  2px;
  --radius-sm:  4px;
  --radius:     6px;
  --radius-lg: 10px;
  --radius-xl: 16px;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.06);
  --shadow-sm: 0 1px 4px rgba(0,0,0,.08);
  --shadow:    0 2px 10px rgba(0,0,0,.10);
  --shadow-lg: 0 6px 24px rgba(0,0,0,.12);
  --t: .2s ease;
  --font: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Courier New', monospace;
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--ami-texte);
  background: var(--ami-blanc);
  margin: 0;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ami-bleu); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--ami-rouge); }
ul { margin: 0; padding: 0; list-style: none; }
h1,h2,h3,h4,h5,h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--ami-texte);
  margin-top: 0;
}
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }
p  { margin-top: 0; color: var(--ami-texte-sec); }

/* ── Utilitaires ───────────────────────────────────────────── */
.text-ami-rouge { color: var(--ami-rouge) !important; }
.text-ami-bleu  { color: var(--ami-bleu)  !important; }
.bg-ami-rouge   { background: var(--ami-rouge) !important; }
.bg-ami-bleu    { background: var(--ami-bleu)  !important; }
.text-ami-blue  { color: var(--ami-bleu) !important; }

/* ── Boutons ───────────────────────────────────────────────── */
.btn-ami-primary {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--ami-rouge);
  color: var(--ami-blanc);
  border: 2px solid var(--ami-rouge);
  padding: .65rem 1.6rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: .02em;
  cursor: pointer;
  transition: background var(--t), border-color var(--t), transform var(--t);
  text-decoration: none;
}
.btn-ami-primary:hover {
  background: var(--ami-rouge-dark);
  border-color: var(--ami-rouge-dark);
  color: var(--ami-blanc);
  transform: translateY(-1px);
}
.btn-ami-secondary {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: transparent;
  color: var(--ami-bleu);
  border: 2px solid var(--ami-bleu);
  padding: .65rem 1.6rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  transition: all var(--t);
  text-decoration: none;
}
.btn-ami-secondary:hover {
  background: var(--ami-bleu);
  color: var(--ami-blanc);
  transform: translateY(-1px);
}
.btn-ami-ghost {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: transparent;
  color: var(--ami-blanc);
  border: 2px solid rgba(255,255,255,.75);
  padding: .65rem 1.6rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  transition: all var(--t);
  text-decoration: none;
}
.btn-ami-ghost:hover {
  background: rgba(255,255,255,.15);
  border-color: var(--ami-blanc);
  color: var(--ami-blanc);
}
.btn-link-ami {
  color: var(--ami-rouge);
  font-weight: 600;
  font-size: .9rem;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  transition: gap var(--t), color var(--t);
  text-decoration: none;
}
.btn-link-ami:hover { color: var(--ami-rouge-dark); gap: .6rem; }

/* ── NAVBAR PUBLIQUE ───────────────────────────────────────── */
.ami-navbar {
  background: var(--ami-blanc);
  border-bottom: 1px solid var(--ami-gris);
  padding: 0;
  height: 70px;
  position: sticky;
  top: 0;
  z-index: 1050;
  transition: box-shadow var(--t);
}
.ami-navbar.scrolled { box-shadow: var(--shadow); }
.ami-navbar .container { height: 70px; }

/* Logo */
.ami-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
}
.brand-logo-box {
  width: 46px;
  height: 46px;
  background: var(--ami-rouge);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: .05em;
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ami-texte);
  letter-spacing: .02em;
}
.brand-tagline {
  font-size: .65rem;
  color: var(--ami-texte-sec);
  font-weight: 400;
  letter-spacing: .01em;
  white-space: nowrap;
}

/* Nav links */
.ami-navbar .navbar-nav .nav-link {
  color: var(--ami-texte) !important;
  font-weight: 500;
  font-size: .9rem;
  padding: .5rem .8rem !important;
  position: relative;
  transition: color var(--t);
}
.ami-navbar .navbar-nav .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: .8rem; right: .8rem;
  height: 2px;
  background: var(--ami-rouge);
  transform: scaleX(0);
  transition: transform var(--t);
  transform-origin: left;
}
.ami-navbar .navbar-nav .nav-link:hover,
.ami-navbar .navbar-nav .nav-link.active {
  color: var(--ami-rouge) !important;
}
.ami-navbar .navbar-nav .nav-link:hover::after,
.ami-navbar .navbar-nav .nav-link.active::after {
  transform: scaleX(1);
}
.ami-navbar .dropdown-menu {
  border: none;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius);
  padding: .5rem 0;
  min-width: 220px;
}
.ami-navbar .dropdown-item {
  padding: .5rem 1.25rem;
  font-size: .88rem;
  color: var(--ami-texte);
  transition: background var(--t), color var(--t), padding-left var(--t);
}
.ami-navbar .dropdown-item:hover {
  background: var(--ami-fond);
  color: var(--ami-rouge);
  padding-left: 1.5rem;
}
.navbar-actions { display: flex; align-items: center; gap: .6rem; }
.ami-navbar .navbar-toggler {
  border: 1px solid var(--ami-border);
  border-radius: var(--radius-sm);
  padding: .35rem .65rem;
}
.ami-navbar .navbar-toggler:focus { box-shadow: none; }

/* ── HERO SECTIONS ─────────────────────────────────────────── */
.hero-public {
  min-height: 560px;
  background: linear-gradient(135deg, #060d1f 0%, #1e3a8a 55%, #3b1a2e 100%);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.hero-public::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(200,16,46,.18) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(37,99,235,.15) 0%, transparent 50%);
}
.hero-public .container { position: relative; z-index: 1; }
.hero-badge {
  display: inline-block;
  background: var(--ami-rouge);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .35rem 1rem;
  border-radius: 20px;
  margin-bottom: 1.25rem;
}
.hero-public h1 {
  color: #fff;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1rem;
}
.hero-public .hero-sub {
  color: rgba(255,255,255,.78);
  font-size: 1.15rem;
  margin-bottom: 2rem;
  max-width: 520px;
}
.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.5);
  font-size: .8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  animation: bounce 2s infinite;
  will-change: transform;
}
@keyframes bounce {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(6px); }
}

/* Hero pages intérieures */
.hero-inner {
  background: var(--ami-bleu);
  padding: 3.5rem 0 3rem;
  position: relative;
  overflow: hidden;
}
.hero-inner::after {
  content: '';
  position: absolute;
  right: -80px; top: -80px;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
}
.hero-inner h1 { color: #fff; font-size: clamp(1.8rem, 3.5vw, 2.6rem); margin-bottom: .5rem; }
.hero-inner p  { color: rgba(255,255,255,.72); margin-bottom: 0; }
.breadcrumb-ami { margin-bottom: 1rem; }
.breadcrumb-ami a, .breadcrumb-ami span {
  color: rgba(255,255,255,.6);
  font-size: .82rem;
}
.breadcrumb-ami a:hover { color: #fff; }
.breadcrumb-ami .sep { margin: 0 .4rem; }

/* ── SECTIONS PUBLIQUES ────────────────────────────────────── */
.section-pub     { padding: 80px 0; }
.section-pub-sm  { padding: 50px 0; }
.section-alt     { background: var(--ami-fond); }
.section-dark    { background: var(--ami-bleu); }
.section-rouge   { background: var(--ami-rouge); }

.section-header  { margin-bottom: 3rem; }
.section-header h2 { margin-bottom: .75rem; }
.section-divider {
  width: 50px;
  height: 3px;
  background: var(--ami-rouge);
  margin: .75rem 0 1rem;
  border-radius: 2px;
}
.section-header.text-center .section-divider { margin: .75rem auto 1rem; }
.section-subtitle {
  font-size: 1.05rem;
  color: var(--ami-texte-sec);
  max-width: 600px;
}
.section-header.text-center .section-subtitle { margin: 0 auto; }

/* ── STATS BAND ────────────────────────────────────────────── */
.stats-band {
  padding: 40px 0;
  border-top: 1px solid var(--ami-gris);
  border-bottom: 1px solid var(--ami-gris);
  background: var(--ami-blanc);
}
.stat-item { text-align: center; padding: 0 1.5rem; }
.stat-item + .stat-item { border-left: 1px solid var(--ami-gris); }
.stat-number {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--ami-rouge);
  line-height: 1;
  display: block;
}
.stat-label {
  font-size: .85rem;
  color: var(--ami-texte-sec);
  font-weight: 500;
  margin-top: .25rem;
}

/* ── CARDS FORMATIONS ──────────────────────────────────────── */
.formation-card {
  border: 1px solid var(--ami-gris);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--ami-blanc);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
  height: 100%;
  display: flex;
  flex-direction: column;
}
.formation-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.formation-card-header {
  height: 150px;
  display: flex;
  align-items: flex-end;
  padding: 1rem;
  position: relative;
}
.formation-type-badge {
  display: inline-block;
  padding: .25rem .75rem;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: rgba(255,255,255,.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,.3);
}
.formation-card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.formation-card-body h5 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .4rem;
  color: var(--ami-texte);
}
.formation-meta {
  font-size: .8rem;
  color: var(--ami-gris-md);
  margin-bottom: .75rem;
}
.formation-card-body p {
  font-size: .88rem;
  color: var(--ami-texte-sec);
  flex: 1;
  margin-bottom: 1rem;
}
.formation-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: .75rem;
  border-top: 1px solid var(--ami-gris);
  margin-top: auto;
}
.prix-formation {
  font-size: .82rem;
  color: var(--ami-texte-sec);
}
.prix-formation strong {
  display: block;
  font-size: .95rem;
  color: var(--ami-texte);
  font-weight: 700;
}

/* Gradients par type de formation */
.grad-licence    { background: linear-gradient(135deg, #1e3a8a, #2563eb); }
.grad-master     { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.grad-certificat { background: linear-gradient(135deg, #059669, #10b981); }
.grad-courte     { background: linear-gradient(135deg, #d97706, #f59e0b); }
.grad-default    { background: linear-gradient(135deg, #374151, #6b7280); }

/* ── CARDS ACTUALITÉS ──────────────────────────────────────── */
.actu-card {
  border: 1px solid var(--ami-gris);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--ami-blanc);
  transition: transform var(--t), box-shadow var(--t);
  height: 100%;
  display: flex;
  flex-direction: column;
}
.actu-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.actu-card-img {
  height: 180px;
  display: flex;
  align-items: flex-end;
  padding: 1rem;
  position: relative;
}
.actu-date-badge {
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: .75rem;
  padding: .25rem .65rem;
  border-radius: 3px;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.actu-card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.actu-card-body h5 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .5rem;
  color: var(--ami-texte);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.actu-card-body p { font-size: .87rem; flex: 1; margin-bottom: 1rem; }

/* ── FEATURES SECTION ──────────────────────────────────────── */
.feature-item { display: flex; flex-direction: column; align-items: flex-start; }
.feature-icon {
  width: 56px; height: 56px;
  background: var(--ami-rouge-light);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--ami-rouge);
  font-size: 1.3rem;
  transition: background var(--t), transform var(--t);
}
.feature-item:hover .feature-icon {
  background: var(--ami-rouge);
  color: #fff;
  transform: scale(1.05);
}
.feature-item h4 { font-size: 1.05rem; margin-bottom: .4rem; }
.feature-item p  { font-size: .9rem; }

/* Features liste (section e-learning) */
.elearning-feature {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 0;
  border-bottom: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.88);
  font-size: .95rem;
}
.elearning-feature:last-child { border-bottom: none; }
.elearning-feature i { color: var(--ami-rouge); font-size: .9rem; flex-shrink: 0; width: 20px; }

/* ── FOOTER ────────────────────────────────────────────────── */
.ami-footer { background: #111; color: rgba(255,255,255,.75); }
.footer-main { padding: 60px 0 40px; }
.footer-logo-box {
  width: 48px; height: 48px;
  background: var(--ami-rouge);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 900; font-size: 1.1rem;
  margin-bottom: 1rem;
}
.footer-desc {
  font-size: .88rem;
  color: rgba(255,255,255,.6);
  line-height: 1.7;
  margin-bottom: 1.25rem;
  max-width: 260px;
}
.footer-social { display: flex; gap: .6rem; }
.social-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.6);
  font-size: .85rem;
  transition: background var(--t), color var(--t);
  text-decoration: none;
}
.social-btn:hover { background: var(--ami-rouge); color: #fff; }
.footer-col-title {
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.footer-col-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,.1);
}
.footer-links li { margin-bottom: .45rem; }
.footer-links a {
  color: rgba(255,255,255,.6);
  font-size: .88rem;
  text-decoration: none;
  transition: color var(--t), padding-left var(--t);
  display: inline-block;
}
.footer-links a:hover { color: #fff; padding-left: 4px; }
.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: .75rem;
  font-size: .88rem;
  color: rgba(255,255,255,.6);
}
.footer-contact-item i {
  width: 16px; color: var(--ami-rouge); margin-top: .2rem; flex-shrink: 0;
}
.footer-bottom {
  background: #070707;
  padding: 1rem 0;
  font-size: .8rem;
  color: rgba(255,255,255,.4);
  border-top: 1px solid rgba(255,255,255,.06);
}
.footer-bottom a { color: rgba(255,255,255,.45); text-decoration: none; }
.footer-bottom a:hover { color: rgba(255,255,255,.75); }

/* ── FORMULAIRES ───────────────────────────────────────────── */
.form-label { font-weight: 600; font-size: .875rem; color: var(--ami-texte); margin-bottom: .4rem; }
.form-control, .form-select {
  border: 1px solid var(--ami-border);
  border-radius: var(--radius-sm);
  padding: .65rem .9rem;
  font-size: .9rem;
  color: var(--ami-texte);
  transition: border-color var(--t), box-shadow var(--t);
}
.form-control:focus, .form-select:focus {
  border-color: var(--ami-bleu);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
  outline: none;
}
.form-control::placeholder { color: var(--ami-gris-md); }

/* ── PAGE CONNEXION ────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #060d1f 0%, var(--ami-bleu) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.login-card {
  background: var(--ami-blanc);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.ami-logo-icon {
  width: 60px; height: 60px;
  background: var(--ami-rouge);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 900; font-size: 1.2rem;
  margin: 0 auto .75rem;
}
.logo-ami { font-weight: 900; letter-spacing: .05em; }
.login-title { font-size: 1.35rem; font-weight: 700; margin-bottom: .25rem; }
.login-subtitle { color: var(--ami-texte-sec); font-size: .88rem; }

/* ── DASHBOARD ─────────────────────────────────────────────── */
.dashboard-body {
  background: var(--ami-fond);
  min-height: 100vh;
}
.dashboard-wrapper { display: flex; min-height: 100vh; }

/* Sidebar */
.ami-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--ami-bleu);
  min-height: 100vh;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 900;
  transition: transform var(--t);
}
.sidebar-brand {
  padding: 1.25rem 1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-logo-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  text-decoration: none;
}
.sidebar-logo-icon {
  width: 38px; height: 38px;
  background: var(--ami-rouge);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-ami { color: #fff; font-weight: 900; font-size: .95rem; }
.brand-name { color: #fff; font-weight: 700; font-size: .95rem; display: block; }
.brand-sub  { color: rgba(255,255,255,.55); font-size: .68rem; display: block; }
.sidebar-close-btn {
  background: none; border: none; color: rgba(255,255,255,.5);
  font-size: 1rem; cursor: pointer; padding: .25rem;
}

/* Profil sidebar */
.sidebar-profile {
  padding: 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: .75rem;
}
.profile-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar-initials {
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
}
.avatar-initials--sm { font-size: .7rem; }
.online-dot {
  width: 10px; height: 10px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid var(--ami-bleu);
  position: absolute;
  bottom: 0; right: 0;
}
.profile-name { color: #fff; font-size: .85rem; font-weight: 600; display: block; }
.profile-role-badge {
  font-size: .68rem;
  padding: .15rem .45rem;
  border-radius: 10px;
  font-weight: 600;
  display: inline-block;
  margin-top: .15rem;
}
.role-super_admin    { background: rgba(200,16,46,.25); color: #fca5a5; }
.role-administration { background: rgba(6,182,212,.2);  color: #67e8f9; }
.role-professeur     { background: rgba(5,150,105,.2);  color: #6ee7b7; }
.role-etudiant       { background: rgba(234,179,8,.2);  color: #fde68a; }

/* Navigation sidebar */
.sidebar-nav { flex: 1; overflow-y: auto; padding: .75rem 0; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }
.sidebar-nav-list { list-style: none; margin: 0; padding: 0; }
.nav-section-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  padding: .9rem 1rem .3rem;
}
.sidebar-nav-item { margin: .1rem .5rem; }
.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .6rem .9rem;
  color: rgba(255,255,255,.72);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--t), color var(--t), padding-left var(--t);
  position: relative;
}
.sidebar-nav-link i { width: 18px; text-align: center; font-size: .9rem; flex-shrink: 0; }
.sidebar-nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-nav-item.active > .sidebar-nav-link {
  background: var(--ami-rouge);
  color: #fff;
}
.badge-count {
  background: var(--ami-rouge);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: .15rem .45rem;
  border-radius: 10px;
  margin-left: auto;
}

/* Footer sidebar */
.sidebar-footer {
  padding: .75rem 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: .65rem;
}
.sidebar-footer-link {
  flex: 1;
  display: flex;
  align-items: center;
  gap: .65rem;
  text-decoration: none;
  min-width: 0;
}
.footer-avatar {
  width: 34px; height: 34px;
  background: rgba(255,255,255,.12);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.footer-user-name  { color: #fff; font-size: .8rem; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.footer-user-email { color: rgba(255,255,255,.45); font-size: .68rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-logout-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.55);
  font-size: .85rem;
  flex-shrink: 0;
  text-decoration: none;
  transition: background var(--t), color var(--t);
}
.sidebar-logout-btn:hover { background: var(--ami-rouge); color: #fff; }

/* Overlay mobile */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 850;
}
.sidebar-overlay.show { display: block; }

/* ── DASHBOARD MAIN ────────────────────────────────────────── */
.dashboard-main {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.dashboard-header {
  height: 64px;
  background: var(--ami-blanc);
  border-bottom: 1px solid var(--ami-gris);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-xs);
}
.dashboard-content { padding: 1.75rem; flex: 1; }
.btn-sidebar-toggle {
  background: none; border: none;
  color: var(--ami-texte-sec);
  font-size: 1.1rem;
  cursor: pointer;
  padding: .25rem .5rem;
  border-radius: var(--radius-sm);
  transition: background var(--t);
  display: none;
}
.btn-sidebar-toggle:hover { background: var(--ami-fond); }
.header-breadcrumb {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
}
.header-breadcrumb a { color: var(--ami-texte-sec); }
.header-breadcrumb a:hover { color: var(--ami-rouge); }
.header-breadcrumb .breadcrumb-sep { color: var(--ami-gris-md); font-size: .7rem; }
.header-breadcrumb .active { color: var(--ami-texte); font-weight: 600; }
.page-title { font-size: 1.45rem; font-weight: 700; color: var(--ami-texte); }

/* ── STAT CARDS ────────────────────────────────────────────── */
.stat-card {
  background: var(--ami-blanc);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--ami-gris);
  border-left: 4px solid;
  transition: box-shadow var(--t), transform var(--t);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-card--blue   { border-left-color: var(--ami-bleu-med); }
.stat-card--red    { border-left-color: var(--ami-rouge); }
.stat-card--green  { border-left-color: var(--ami-vert); }
.stat-card--orange { border-left-color: var(--ami-orange); }
.stat-card--purple { border-left-color: var(--ami-violet); }
.stat-card--teal   { border-left-color: #0e7490; }
.stat-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.stat-card--blue   .stat-icon { background: var(--ami-bleu-pale); color: var(--ami-bleu-med); }
.stat-card--red    .stat-icon { background: var(--ami-rouge-light); color: var(--ami-rouge); }
.stat-card--green  .stat-icon { background: #d1fae5; color: var(--ami-vert); }
.stat-card--orange .stat-icon { background: #fef3c7; color: var(--ami-orange); }
.stat-card--purple .stat-icon { background: #ede9fe; color: var(--ami-violet); }
.stat-card--teal   .stat-icon { background: #cffafe; color: #0e7490; }
.stat-value { font-size: 1.7rem; font-weight: 800; color: var(--ami-texte); line-height: 1; }
.stat-label { font-size: .78rem; color: var(--ami-texte-sec); margin-top: .2rem; font-weight: 500; }

/* ── AMI CARD ──────────────────────────────────────────────── */
.ami-card {
  background: var(--ami-blanc);
  border-radius: var(--radius-lg);
  border: 1px solid var(--ami-gris);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.ami-card-header {
  padding: .9rem 1.25rem;
  border-bottom: 1px solid var(--ami-gris);
  font-weight: 700;
  font-size: .9rem;
  color: var(--ami-texte);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.ami-card-body { padding: 1.25rem; }

/* ── TABLES ────────────────────────────────────────────────── */
.table { font-size: .875rem; }
.table thead th {
  background: var(--ami-fond);
  color: var(--ami-texte-sec);
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 2px solid var(--ami-gris);
  padding: .75rem 1rem;
  white-space: nowrap;
}
.table tbody td { padding: .75rem 1rem; vertical-align: middle; border-color: var(--ami-gris); }
.table-hover tbody tr:hover { background: #fafafa; }

/* ── BADGES STATUT ─────────────────────────────────────────── */
.status-badge {
  display: inline-block;
  padding: .22rem .7rem;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
}
.badge-paye     { background: #d1fae5; color: #065f46; }
.badge-partiel  { background: #fef3c7; color: #92400e; }
.badge-impaye   { background: #fee2e2; color: #991b1b; }
.badge-actif    { background: #d1fae5; color: #065f46; }
.badge-inactif  { background: #f1f5f9; color: #475569; }
.badge-publie   { background: #d1fae5; color: #065f46; }
.badge-brouillon{ background: #f1f5f9; color: #475569; }
.badge-en-attente { background: #fef3c7; color: #92400e; }
.badge-accepte  { background: #d1fae5; color: #065f46; }
.badge-archive  { background: #e5e7eb; color: #374151; }

/* Avatar cercle */
.avatar-circle {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--ami-bleu);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .78rem;
  flex-shrink: 0;
}

/* ── PAGINATION ────────────────────────────────────────────── */
.page-link {
  color: var(--ami-bleu);
  border-color: var(--ami-gris);
  font-size: .85rem;
}
.page-item.active .page-link {
  background: var(--ami-bleu);
  border-color: var(--ami-bleu);
}
.page-link:hover { color: var(--ami-rouge); background: var(--ami-fond); }

/* ── ALERTS ────────────────────────────────────────────────── */
.alert { border-radius: var(--radius); border: none; font-size: .9rem; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-danger   { background: #fee2e2; color: #991b1b; }
.alert-warning  { background: #fef3c7; color: #92400e; }
.alert-info     { background: var(--ami-bleu-pale); color: var(--ami-bleu); }

/* ── FLASH MESSAGE ─────────────────────────────────────────── */
.flash-wrap { margin-bottom: 1.25rem; }

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 991px) {
  .ami-sidebar {
    transform: translateX(-100%);
  }
  .ami-sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .dashboard-main { margin-left: 0; }
  .btn-sidebar-toggle { display: flex !important; }
}
@media (max-width: 768px) {
  .section-pub    { padding: 55px 0; }
  .section-pub-sm { padding: 35px 0; }
  .stat-item + .stat-item { border-left: none; border-top: 1px solid var(--ami-gris); }
  .hero-public    { min-height: 420px; }
  .dashboard-content { padding: 1rem; }
}
@media (max-width: 575px) {
  .brand-tagline { display: none; }
  .navbar-actions .btn-ami-secondary { display: none; }
}

/* ── ANIMATIONS ────────────────────────────────────────────── */
.fade-in-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .55s ease, transform .55s ease;
}
.fade-in-up.visible { opacity: 1; transform: translateY(0); }

/* ── SPINNER ───────────────────────────────────────────────── */
.ami-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--ami-gris);
  border-top-color: var(--ami-rouge);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  will-change: transform;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── CHAT / MESSAGERIE ─────────────────────────────────────── */
.msg-me    { background: var(--ami-bleu); color: #fff; border-radius: 12px 12px 2px 12px; }
.msg-other { background: var(--ami-fond); color: var(--ami-texte); border-radius: 12px 12px 12px 2px; }

/* ── FILTRES TABS FORMATIONS ───────────────────────────────── */
.filter-tabs-bar {
  background: var(--ami-blanc);
  border-bottom: 1px solid var(--ami-gris);
  padding: .75rem 0;
  position: sticky;
  top: 70px;
  z-index: 100;
}
.filter-tab {
  display: inline-block;
  padding: .45rem 1rem;
  border-radius: 20px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--ami-texte-sec);
  cursor: pointer;
  transition: all var(--t);
  border: 1px solid transparent;
  text-decoration: none;
}
.filter-tab:hover { color: var(--ami-rouge); background: var(--ami-rouge-light); }
.filter-tab.active { background: var(--ami-rouge); color: #fff; border-color: var(--ami-rouge); }
