/* =========================================
   AFMEC LMS – Design global
========================================= */
:root {
  --afmec-blue: #0A2472;
  --afmec-coral: #E84B3C;
  --afmec-bg: #F6F8FA;
  --afmec-white: #F6F8FA;
  --afmec-black: #0E0F12;
  --afmec-border: #E0E4EC;
  --afmec-muted: #6C7383;
  --afmec-card-bg: #FFFFFF;
  --afmec-radius-lg: 18px;
  --afmec-radius-md: 12px;
  --afmec-radius-sm: 999px;
  --afmec-shadow-soft: 0 14px 35px rgba(10, 36, 114, 0.08);
  --afmec-shadow-light: 0 4px 12px rgba(10, 36, 114, 0.06);
}

/* Fonts (Plus Jakarta Sans + Inter) */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap');

.afmec-lms-root,
.afmec-lms-root * {
  box-sizing: border-box;
}

.afmec-lms-root {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--afmec-black);
  background: var(--afmec-bg);
}

/* Empêcher le scroll global sur la page LMS uniquement */
body.afmec-lms-page {
  margin: 0;
  overflow: hidden;
  background: var(--afmec-bg);
}

/* HEADER */
.afmec-lms-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 22px;
  background: var(--afmec-blue);
  color: var(--afmec-white);
  box-shadow: var(--afmec-shadow-soft);
  position: relative;
  z-index: 20;
  min-height: 60px;
}

.afmec-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.afmec-logo img {
  height: 38px;
  width: auto;
  display: block;
}

.afmec-header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.afmec-header-meta {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.afmec-header-label {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: 0.9;
}

.afmec-header-sub {
  font-size: 12px;
  opacity: 0.8;
}

.afmec-header-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.afmec-user-initials {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(246, 248, 250, 0.14);
  border: 1px solid rgba(246, 248, 250, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-weight: 600;
  font-size: 13px;
}

.afmec-user-info {
  display: flex;
  flex-direction: column;
}

.afmec-user-name {
  font-size: 13px;
  font-weight: 600;
}

.afmec-user-role {
  font-size: 11px;
  opacity: 0.8;
}

/* Burger */
.afmec-burger {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(246, 248, 250, 0.35);
  background: transparent;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}
.afmec-burger span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--afmec-white);
}

/* LAYOUT PRINCIPAL */
.afmec-lms-main {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  height: calc(100vh - 60px); /* header ~60px */
  max-height: calc(100vh - 60px);
}

/* SIDEBAR */
.afmec-sidebar {
  background: #0B1840;
  color: var(--afmec-white);
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,255,255,0.08);
}

.afmec-nav {
  flex: 1;
}

.afmec-nav-title {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 10px;
}

.afmec-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.afmec-nav-item {
  padding: 9px 11px;
  border-radius: 11px;
  font-size: 13px;
  color: rgba(246, 248, 250, 0.78);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background .18s ease, color .18s ease, transform .08s ease, box-shadow .18s ease;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-weight: 500;
}
.afmec-nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
}
.afmec-nav-item.is-active {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  backdrop-filter: blur(4px);
  color: #fff;
}

.afmec-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.afmec-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.afmec-nav-label {
  flex: 1;
}

/* Sidebar footer */
.afmec-sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 10px;
  margin-top: 14px;
}

.afmec-btn.afmec-btn-logout {
  background: rgba(246,248,250,0.06) !important;
  border: 1px solid rgba(246,248,250,0.26) !important;
  color: var(--afmec-white) !important;
  padding-inline: 10px;
  justify-content: flex-start;
  width: 100%;
}

.afmec-btn.afmec-btn-logout:hover {
  background: rgba(246,248,250,0.12) !important;
}
/* CONTENT */
.afmec-content {
  background: radial-gradient(circle at top left, rgba(232,75,60,0.06), transparent 58%),
              radial-gradient(circle at bottom right, rgba(10,36,114,0.11), transparent 65%),
              var(--afmec-bg);
  padding: 18px 22px 22px;
  overflow-y: auto;
}

/* Sections */
.afmec-section {
  display: none;
}
.afmec-section.is-active {
  display: block;
}

/* Section header */
.afmec-section-header {
  margin-bottom: 18px;
}
.afmec-section-header h1 {
  margin: 0 0 4px;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--afmec-blue);
}
.afmec-section-header p {
  margin: 0;
  font-size: 13px;
  color: var(--afmec-muted);
}

/* Grid utils */
.afmec-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}
.afmec-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.afmec-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.afm-grid-row-2 {
  display: grid;
  grid-template-columns: 2fr 1.6fr;
  gap: 16px;
}

/* Cards */
.afmec-card {
  background: var(--afmec-card-bg);
  border-radius: var(--afmec-radius-lg);
  box-shadow: var(--afmec-shadow-soft);
  border: 1px solid rgba(255,255,255,0.9);
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
}
.afmec-card-header {
  margin-bottom: 10px;
}
.afmec-card-header h2,
.afmec-card-header h3 {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--afmec-blue);
}
.afmec-card-body {
  font-size: 13px;
  color: var(--afmec-black);
}
.afmec-card-body-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.afmec-card-list {
  padding-top: 12px;
}

/* Labels & values */
.afmec-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--afmec-muted);
  margin: 0 0 4px;
}
.afmec-value {
  margin: 0 0 8px;
  font-weight: 500;
}
.afmec-value-large {
  font-size: 15px;
}

.afmec-muted {
  color: var(--afmec-muted);
  margin: 0;
}

/* Progress bars */
.afmec-progress-wrapper {
  margin: 4px 0 8px;
}
.afmec-progress-wrapper-sm {
  margin-top: 0;
}
.afmec-progress-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--afmec-muted);
  margin-bottom: 4px;
}
.afmec-progress-value {
  font-weight: 600;
  color: var(--afmec-blue);
}
.afmec-progress-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #E6E9F2;
  overflow: hidden;
}
.afmec-progress-bar-sm {
  height: 5px;
}
.afmec-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--afmec-coral), #FF9A75);
  transition: width .25s ease;
}

/* =========================================
   AFMEC — Boutons Premium (version BLEUE)
========================================= */

.afmec-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;

  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid transparent;

  cursor: pointer;
  transition: all .18s ease;
  white-space: nowrap;

  background: #E9ECF4; /* gris clair par défaut */
  color: var(--afmec-blue);
}

.afmec-btn:hover {
  background: #DDE3F0;
}

/* ===== BOUTON PRINCIPAL (BLEU AFMEC) ===== */
.afmec-btn-primary {
  background: #152f82;
  color: #fff;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.08);
}
.afmec-btn-primary:hover {
  background: #1C3FA8;
}

/* ===== BOUTON SECONDAIRE (blanc + bleu) ===== */
.afmec-btn-secondary {
  background: #fff;
  color: var(--afmec-blue);
  border: 1px solid rgba(10,36,114,0.25);
  border-radius: 10px;
}
.afmec-btn-secondary:hover {
  background: #f0f3fa;
}

/* ===== BOUTON OUTLINE GÉNÉRIQUE ===== */
.afmec-btn-outline {
  background: transparent;
  border-color: rgba(10,36,114,0.28);
  color: var(--afmec-blue);
}

.afmec-btn-outline:hover {
  background: rgba(10,36,114,0.06);
}

/* ===== BOUTON GHOST ===== */
.afmec-btn-ghost {
  border: 1px solid rgba(10,36,114,0.18);
  color: var(--afmec-blue);
}
.afmec-btn-ghost:hover {
  background: rgba(10,36,114,0.06);
}


/* ===== Tailles ===== */
.afmec-btn-sm {
  padding: 7px 14px;
  font-size: 12px;
}

.afmec-btn-full {
  width: 100%;
}

/* Quick links */
.afmec-quick-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

/* Map placeholder */
.afmec-map-placeholder {
  border-radius: 16px;
  border: 1px dashed rgba(10,36,114,0.22);
  background: #F2F4FB;
  padding: 22px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--afmec-muted);
}

/* Divider */
.afmec-divider {
  height: 1px;
  background: var(--afmec-border);
  margin: 10px 0;
}

/* Two columns inside card */
.afmec-two-columns {
  display: grid;
  grid-template-columns: 1.3fr 1.2fr;
  gap: 12px;
}

/* Training list */
.afmec-training-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid rgba(10,36,114,0.08);
  background: #FBFCFF;
  transition: border .18s ease, box-shadow .18s ease, transform .08s ease;
  cursor: pointer;
}
.afmec-training-card:hover {
  border-color: rgba(10,36,114,0.35);
  box-shadow: var(--afmec-shadow-light);
  transform: translateY(-1px);
}
.afmec-training-main {
  flex: 1;
}
.afmec-training-title {
  margin: 0 0 3px;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
}
.afmec-training-meta {
  margin: 0 0 2px;
  font-size: 12px;
  color: var(--afmec-muted);
}
.afmec-training-next {
  margin: 0;
  font-size: 12px;
}
.afmec-training-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.afmec-btn-open-training {
  margin-top: 2px;
}
.afmec-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(10,36,114,0.06);
  font-size: 11px;
}
.afmec-separator {
  margin: 0 4px;
  opacity: 0.5;
}

/* Detail view */
.afmec-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}

.afmec-detail-header > div {
  display: flex;
  flex-direction: column;
}
.afmec-detail-header h2 {
  margin: 0;
  font-family: "Plus Jakarta Sans";
  font-size: 18px;
  font-weight: 600;
}
.afmec-detail-header .afmec-muted {
  font-size: 12px;
}

/* Lists */
.afmec-list {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 13px;
}

/* Utils */
.afmec-hidden {
  display: none !important;
}

/* Overlay mobile */
.afmec-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 30, 0.48);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  z-index: 9;
}

.afmec-overlay.is-visible {
  opacity: 1;
  pointer-events: all;
}

/* Gap global entre les cartes dans les sections verticales */
#afmec-section-emargements .afmec-card,
#afmec-section-documents .afmec-card,
#afmec-section-evaluations .afmec-card,
#afmec-section-profil .afmec-card {
  margin-bottom: 16px;
}

/* TITRE DU DETAIL FORMATION */
#afmec-detail-title {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif !important;
  font-size: 20px !important;
  font-weight: 600 !important;
  color: var(--afmec-blue) !important;
  margin-bottom: 4px !important;
  line-height: 1.3;
}

/* Sous-titre */
#afmec-detail-subtitle {
  font-size: 13px !important;
  color: var(--afmec-muted) !important;
  margin: 0 !important;
}

.afmec-profile-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.afmec-edit-field {
  margin-bottom: 12px;
  display: flex;
  gap: 8px;
}

.afmec-input {
  flex: 1;
  border: 1px solid var(--afmec-border);
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
}



/* RESPONSIVE */
@media (max-width: 960px) {
  .afmec-lms-main {
    grid-template-columns: 1fr;
  }

  .afmec-burger {
    display: inline-flex;
  }

  .afmec-sidebar {
    position: fixed;
    inset: 60px auto 0 0;
    width: 260px;
    transform: translateX(-100%);
    transition: transform .2s ease;
    z-index: 10;
  }
  .afmec-sidebar.is-open {
    transform: translateX(0);
  }

  .afmec-content {
    height: calc(100vh - 60px);
  }

  .afmec-grid-3 {
    grid-template-columns: 1fr;
  }
  .afmec-grid-2,
  .afm-grid-row-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .afmec-header-right {
    display: none;
  }

  .afmec-content {
    padding: 14px 14px 16px;
  }

  .afmec-section-header h1 {
    font-size: 19px;
  }

  .afmec-card {
    padding: 12px 12px 14px;
  }

  .afmec-training-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .afmec-training-actions {
    width: 100%;
    align-items: stretch;
  }
  .afmec-btn-full,
  .afmec-btn.afmec-btn-secondary,
  .afmec-btn.afmec-btn-primary {
    width: 100%;
  }
}
