/* ============================================================
   BOUTON CRAYON
   ============================================================ */
.kampouss-editable-block {
  position: relative;
}

.kampouss-edit-btn {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: #bbb;
  font-size: 15px;
  cursor: pointer;
  transition:
    color 0.2s,
    background 0.2s;
  z-index: 1;
}

.kampouss-edit-btn:hover,
.kampouss-edit-btn:focus-visible {
  color: #ff9800;
  background: rgba(255, 152, 0, 0.1);
  outline: none;
}

/* ============================================================
   OVERLAY / BACKDROP
   ============================================================ */

.kampouss-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
}

/* ============================================================
   BOÎTE MODALE
   ============================================================ */
.kampouss-modal__box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  max-height: 90dvh;
  overflow-y: auto;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 24px 20px 32px;
  box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.15);
  animation: slideUp 0.25s ease;
}

/* Sur desktop : centré, coins arrondis partout */
@media (min-width: 640px) {
  .kampouss-modal-profil {
    align-items: center;
  }

  .kampouss-modal__box {
    border-radius: 16px;
    max-width: 480px;
    animation: fadeInScale 0.2s ease;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeInScale {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ============================================================
   HEADER MODALE
   ============================================================ */
.kampouss-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.kampouss-modal__header h4 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #222;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kampouss-modal__header h4 i {
  color: #ff9800;
}

.kampouss-modal__close {
  background: none;
  border: none;
  font-size: 18px;
  color: #888;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition:
    color 0.2s,
    background 0.2s;
}

.kampouss-modal__close:hover {
  color: #333;
  background: #f0f0f0;
}

/* ============================================================
   BODY MODALE
   ============================================================ */
.kampouss-modal__body {
  margin-bottom: 20px;
}

.kampouss-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 8px;
}

/* Textarea bio */
.kampouss-textarea {
  width: 100%;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.2s;
  box-sizing: border-box;
  font-family: inherit;
}

.kampouss-textarea:focus {
  border-color: #ff9800;
  outline: none;
}

.kampouss-char-counter {
  display: block;
  text-align: right;
  font-size: 12px;
  color: #aaa;
  margin-top: 4px;
}

/* ============================================================
   CHIPS MATIÈRES
   ============================================================ */
.kampouss-subjects-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kampouss-subject-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1.5px solid #e0e0e0;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  transition:
    border-color 0.2s,
    background 0.2s,
    color 0.2s;
  color: #555;
}

.kampouss-subject-chip input[type="checkbox"] {
  /* Caché visuellement mais accessible */
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.kampouss-subject-chip.is-selected,
.kampouss-subject-chip:has(input:checked) {
  border-color: #ff9800;
  background: rgba(255, 152, 0, 0.12);
  color: #e65100;
  font-weight: 600;
}

.kampouss-subject-chip:hover {
  border-color: #ff9800;
}

/* ============================================================
   FOOTER MODALE
   ============================================================ */
.kampouss-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Boutons */
.kampouss-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition:
    opacity 0.2s,
    transform 0.1s;
}

.kampouss-btn:active {
  transform: scale(0.97);
}

.kampouss-btn--primary {
  background: #ff9800;
  color: #fff;
}

.kampouss-btn--primary:hover {
  opacity: 0.9;
}

.kampouss-btn--primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.kampouss-btn--ghost {
  background: #f0f0f0;
  color: #555;
}

.kampouss-btn--ghost:hover {
  background: #e5e5e5;
}

/* ============================================================
   FEEDBACK (succès / erreur)
   ============================================================ */
.kampouss-modal__feedback {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}

.kampouss-modal__feedback.is-success {
  background: #e8f5e9;
  color: #2e7d32;
}

.kampouss-modal__feedback.is-error {
  background: #ffebee;
  color: #c62828;
}

/* Spinner animation */
.bb-icon-spinner {
  display: inline-block;
  animation: spin 0.8s linear infinite;
}

.bb-icon-spinner.animate-spin {
  font-size: 14px !important;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ═══════════════════════════════════════════════════════
   BOUTONS CRAYON
═══════════════════════════════════════════════════════ */
.kmp-edit-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  padding: 2px 6px;
  transition:
    color 0.2s,
    border-color 0.2s,
    background 0.2s;
  vertical-align: middle;
}

.kmp-edit-trigger:hover,
.kmp-edit-trigger:focus-visible {
  background: #fff7ed !important;
  color: #ff9800 !important;
  outline: none !important;
  border-bottom: 1px solid var(--kmp-primary) !important;
}

/* Crayon inline (à côté du texte) */
.kmp-edit-inline {
  font-size: 14px;
  padding: 1px 4px;
}

/* Bouton avatar */
.member-avatar-wrap {
  position: relative;
  display: inline-block;
}

.kmp-avatar-edit-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #ff9800;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  text-decoration: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  transition:
    background 0.2s,
    transform 0.15s;
}

.kmp-avatar-edit-btn i {
  font-size: 20px;
}

.kmp-avatar-edit-btn:hover {
  background: #e68900;
  transform: scale(1.1);
  color: #fff;
}

.kampouss-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9998;
  animation: kmpFadeIn 0.18s ease;
}

.kampouss-modal-profil {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  width: min(720px, 94vw);
  max-height: 90vh;
  height: fit-content;
  overflow-x: hidden;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22);
  animation: kmpSlideIn 0.2s ease;
}

.kampouss-modal-inner {
  padding: 28px 32px 24px;
}

.kampouss-modal-inner h3 {
  margin: 0 0 4px;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1a1a2e;
}

.kampouss-modal-inner hr {
  border: none;
  border-top: 1px solid #f0f0f0;
  margin: 10px 0 20px;
}

/* Bouton fermer */
.kampouss-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: transparent !important;
  border: none !important;
  font-size: 22px !important;
  cursor: pointer !important;
  color: #888 !important;
  line-height: 1 !important;
  padding: 0 4px !important;
  transition: color 0.15s !important;
}

.kampouss-modal-close:hover {
  color: #ff9800 !important;
}

/* ═══════════════════════════════════════════════════════
   FORMULAIRE
═══════════════════════════════════════════════════════ */
.kmp-field-group {
  margin-bottom: 18px;
}

.kmp-field-group label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: #444;
  margin-bottom: 6px;
}

.kmp-field-group label .required {
  color: #e53935;
}

.kmp-field-group select,
.kmp-field-group textarea,
.kmp-field-group input[type="text"] {
  width: 100%;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  color: #333;
  background: #fafafa;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  box-sizing: border-box;
}

.kmp-field-group select:focus,
.kmp-field-group textarea:focus {
  border-color: #ff9800;
  box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.15);
  outline: none;
  background: #fff;
}

.kmp-field-group textarea {
  resize: vertical;
  min-height: 120px;
}

.kmp-field-hint {
  font-size: 12px;
  color: #888;
  margin-top: 5px;
}

.kmp-field-hint a {
  color: #ff9800;
}

/* Compteur de caractères */
.kmp-char-count {
  font-weight: 400;
  font-size: 12px;
  color: #aaa;
}

/* ═══════════════════════════════════════════════════════
   ACTIONS
═══════════════════════════════════════════════════════ */
.kmp-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.kmp-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  border: none !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  padding: 9px 20px !important;
  transition:
    background 0.2s,
    transform 0.1s !important;
}

.kmp-btn:active {
  transform: scale(0.97) !important;
}

.kmp-btn-primary {
  background: #ff9800 !important;
  color: #fff !important;
}

.kmp-btn-primary:hover {
  background: #e68900 !important;
}
.kmp-btn-primary:disabled {
  background: #ffcc80 !important;
  cursor: not-allowed !important;
}

.kmp-btn-secondary {
  background: #f4f4f4 !important;
  color: #555 !important;
}

.kmp-btn-secondary:hover {
  background: #e8e8e8 !important;
}

.kmp-btn-ghost {
  border: 1px solid var(--kmp-primary) !important;
  background: transparent !important;
  color: var(--kmp-primary) !important;
}

.kmp-btn-ghost i {
  color: var(--kmp-primary) !important;
  font-size: 14px !important;
}

.kmp-step-next i,
.kmp-btn-submit i,
.kmp-btn-add-resource i {
  color: #fff !important;
  font-size: 14px !important;
}

/* Bouton badge ajouter */
.kmp-badge-add-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  margin-right: 10px;
  padding: 4px 12px !important;
  border-radius: 20px !important;
  border: 1px solid var(--kmp-primary, #ff9800) !important;
  background: transparent !important;
  color: var(--kmp-primary, #ff9800) !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition:
    background 0.2s,
    color 0.2s !important;
}
.kmp-badge-add-btn:hover {
  background: var(--kmp-primary, #ff9800) !important;
  color: #fff !important;
}

/* Limiter à 2 lignes */
.kmp-subjects-display {
  overflow: hidden !important;
  max-height: calc(2 * (2.8rem + 2px));
  transition: max-height 0.4s ease;
}
.kmp-subjects-display.is-expanded {
  max-height: 1000px;
}

/* Bouton voir plus / voir moins */
.kmp-toggle-subjects {
  background: transparent !important;
  border: none !important;
  color: var(--kmp-primary, #ff9800) !important;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 0;
  margin-top: 4px;
  text-decoration: none;
}

.kmp-toggle-subjects:focus,
.kmp-toggle-subjects:active {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.kmp-toggle-subjects .kmp-toggle-icon {
  margin-left: 4px;
  font-size: 16px;
  vertical-align: middle;
  font-weight: 400;
  color: var(--kmp-primary) !important;
  transition: transform 0.5s ease;
}

/* ═══════════════════════════════════════════════════════
   FEEDBACK
═══════════════════════════════════════════════════════ */
.kmp-feedback {
  border-radius: 7px;
  font-size: 13px;
  margin-top: 10px;
  padding: 9px 14px;
}

.kmp-feedback.is-success {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

.kmp-feedback.is-error {
  background: #fdecea;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

/* ═══════════════════════════════════════════════════════
   SPINNER
═══════════════════════════════════════════════════════ */
@keyframes kmp-spin {
  to {
    transform: rotate(360deg);
  }
}
.animate-spin {
  animation: kmp-spin 0.7s linear infinite;
}

/* ═══════════════════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════════════════ */
@keyframes kmpFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes kmpSlideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -48%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .kampouss-modal-inner {
    padding: 20px 18px 18px;
  }
  .kmp-btn {
    width: 100%;
    justify-content: center;
  }

  .kmp-modal-actions {
    flex-wrap: wrap;
    margin-top: 5px;
  }

  .kmp-subjects-picker {
    margin-bottom: 5px;
  }

  /* Retour prend toute la largeur en haut */
  .kmp-step-prev {
    width: 100% !important;
    justify-content: center !important;
    order: -1;
  }

  /* Annuler et Enregistrer côte à côte */
  .kampouss-modal-close-btn,
  .kmp-btn-primary {
    flex: 1 !important;
    justify-content: center !important;
  }
}

.kmp-field-inline-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  position: relative;
}

.kmp-edit-icon {
  position: absolute;
  right: -25px;
  top: -15px;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  /*  width: 32px !important;
  height: 32px;*/
  border-radius: 0 !important;
  color: var(--kmp-primary) !important;
  border: none !important;
  border-bottom: 1px dashed #ff9800 !important;
  background: transparent !important;
  cursor: pointer;
  padding: 0 !important;
  flex-shrink: 0;
  transition:
    background 0.2s,
    color 0.2s !important;
}
/* ─── MODIFICATEUR POUR LES TEXTES LONGS (Bio, Objectif, etc.) ─── */
.kmp-long-text-wrap {
  display: block;
  position: static;
}

.kmp-long-text-wrap .kmp-edit-icon {
  display: inline-flex !important;
  position: static !important;
  top: unset !important;
  right: unset !important;
  bottom: unset !important;
  vertical-align: middle;
  margin-left: 6px;
}

.kmp-edit-icon i {
  font-weight: 400;
  font-size: 20px;
  color: #ff9800;
  line-height: 1;
}

.kmp-subjects-toggle-wrap {
  text-align: center;
}

/* ═══════════════════════════════════
   MODAL SUJETS
═══════════════════════════════════ */
.kmp-modal-large {
  max-width: 680px;
}

/* ── Étapes ── */
.kmp-step-label {
  margin-bottom: 4px !important;
  color: #444 !important;
  font-size: 0.95rem !important;
}

/* ── Bulles familles ── */
.kmp-bubbles-wrap {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  margin-bottom: 20px !important;
  margin-top: 20px !important;
}
.kmp-bubble {
  color: #222 !important;
  padding: 10px 20px !important;
  border-radius: 30px !important;
  border: 2px solid #ddd !important;
  background: #fff !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
}
.kmp-bubble.is-active {
  /*  border-color: var(--kmp-primary, #ff9800) !important;
  background: var(--kmp-primary, #ff9800) !important;
  color: #fff !important; */
  border-color: var(--kmp-primary, #ff9800) !important;
  background: #fff8f0 !important;
  color: #222 !important;
}

/* ── Liste matières ── */
.kmp-subjects-picker {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  max-height: 380px !important;
  overflow-y: auto !important;
  padding-right: 4px !important;
  margin-bottom: 16px !important;
}
.kmp-subject-row {
  border: 1px solid #eee !important;
  border-radius: 10px !important;
  padding: 10px 12px !important;
  background: #fafafa !important;
  border-left: 4px solid transparent;
  transition: border-left-color 0.2s;
}

.kmp-subject-row.is-selected-row {
  border-left: 4px solid var(--kmp-primary, #ff9800) !important;
  border-radius: 4px 10px 10px 4px;
}

.kmp-subject-main {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

/* ── Bouton matière ── */
.kmp-subject-toggle {
  color: #222 !important;
  flex: 1 !important;
  text-align: left !important;
  padding: 8px 14px !important;
  border-radius: 20px !important;
  border: 2px solid #ddd !important;
  background: #fff !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
}
.kmp-subject-toggle.is-selected {
  /*  border-color: var(--kmp-primary, #ff9800) !important;
  background: var(--kmp-primary, #ff9800) !important;
  color: #fff !important; */
}

/* ── Bouton + familles ── */
.kmp-families-toggle {
  color: #222 !important;
  width: 24px !important;
  height: 24px !important;
  border-radius: 50% !important;
  border: 1px solid var(--kmp-primary, #ff9800) !important;
  background: #fff !important;
  color: var(--kmp-primary, #ff9800) !important;
  font-size: 1rem !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s !important;
  flex-shrink: 0 !important;
  padding: 0 !important;
}

.kmp-families-toggle i {
  font-size: 22px !important;
}
.kmp-families-toggle.is-hidden {
  opacity: 0.3 !important;
  pointer-events: none !important;
}
.kmp-families-toggle:hover {
  background: var(--kmp-primary, #ff9800) !important;
  color: #fff !important;
}
.kmp-families-toggle:hover i {
  color: #fff !important;
}

/* ── Panel familles ── */
.kmp-families-panel {
  margin-top: 10px !important;
  padding-top: 10px !important;
  border-top: 1px dashed #e0e0e0 !important;
}
.kmp-families-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding-top: 8px;
}

/* ── Coche sur les bulles (domaines) ── */
.kmp-bubble.is-active::before {
  content: "✓ ";
  font-weight: 700;
}

/* ── Coche sur les matières ── */
.kmp-subject-toggle.is-selected {
  border-color: var(--kmp-primary, #ff9800) !important;
  background: #fff8f0 !important;
  color: #222 !important;
}
.kmp-subject-toggle.is-selected::before {
  content: "✓ ";
  color: var(--kmp-primary, #ff9800);
  font-weight: 700;
}

/* ── Coche sur les familles ── */
.kmp-family-btn.is-active::before {
  content: "✓ ";
  font-weight: 700;
}

@media (max-width: 600px) {
  .kmp-families-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.kmp-family-btn {
  color: var(--kmp-text) !important;
  padding: 4px 12px !important;
  border-radius: 14px !important;
  border: 1px solid #ccc !important;
  background: #fff !important;
  font-size: 0.8rem !important;
  cursor: pointer !important;
  transition: all 0.18s !important;
}
.kmp-family-btn.is-active {
  border-color: var(--kmp-accent, #ff9800) !important;
  background: var(--kmp-accent, #ff9800) !important;
  color: #fff !important;
}

.kampouss-modal-profil i {
  font-weight: 400;
  font-size: 30px;
  color: var(--kmp-primary);
}
/* ═══════════════════════════════════
   TOOLTIP FAMILLES (affichage profil)
═══════════════════════════════════ */
.subject-badge {
  position: relative;
}
.kmp-badge-info {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  color: inherit;
  opacity: 0.75;
}
/* .kmp-tooltip {
  position: fixed;
  background: #333;
  color: #fff;
  font-size: 0.78rem;
  padding: 8px 12px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 99999;
}
.kmp-tooltip ul {
  margin: 0;
  padding: 0 0 0 16px;
  list-style: disc;
}
.kmp-tooltip ul li {
  margin: 2px 0;
  font-size: 0.78rem;
  color: #fff;
}
.kmp-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #333;
}
 */

.kmp-tooltip {
  position: fixed;
  background: #fff;
  color: #333;
  font-size: 0.9rem;
  padding: 14px 16px;
  border-radius: 12px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 99999;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  min-width: 180px;
}
.kmp-tooltip::before {
  content: "";
  position: absolute;
  top: var(--arrow-top, 20px);
  transform: translateY(-50%);
  left: -8px;
  border: 8px solid transparent;
  border-right-color: #fff;
  border-left: none;
  filter: drop-shadow(-2px 0px 2px rgba(0, 0, 0, 0.08));
}

.kmp-tooltip.kmp-tooltip-left::before {
  left: auto;
  right: -8px;
  border-right-color: transparent;
  border-left: 8px solid #fff;
}
.kmp-tooltip-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.95rem;
  color: #1a1a1a;
  margin-bottom: 2px;
}
.kmp-tooltip-header .kmp-tt-icon {
  color: #6ab0d4;
  font-size: 1rem;
}
.kmp-tooltip-matiere {
  font-size: 0.82rem;
  color: #888;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}
.kmp-tooltip ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.kmp-tooltip ul li {
  margin: 5px 0;
  font-size: 0.88rem;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}
.kmp-tooltip ul li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6ab0d4;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════
   AUTOCOMPLETE — wrap
═══════════════════════════════════════════════ */
.kmp-autocomplete-wrap {
  position: relative;
}

/* ── Liste de suggestions commune ── */
.kmp-suggestions-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  list-style: none;
  margin: 0;
  padding: 6px 0;
  z-index: 9999;
  max-height: 260px;
  overflow-y: auto;
}

/* ── Item ── */
.kmp-suggestion-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.15s;
  border-radius: 6px;
  margin: 0 4px;
  flex-wrap: wrap;
}

.kmp-suggestion-item:hover,
.kmp-suggestion-item.is-active {
  background: #f0eeff;
  color: var(--kmp-primary, #6c63ff);
}

/* ── Nom principal ── */
.kmp-sug-nom {
  font-weight: 600;
  flex: 1 0 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── CP / commune ── */
.kmp-sug-cp,
.kmp-sug-meta {
  font-size: 0.78rem;
  color: #888;
  background: #f5f5f5;
  padding: 1px 7px;
  border-radius: 20px;
}

/* ── Type d'établissement ── */
.kmp-sug-type {
  font-size: 0.72rem;
  color: var(--kmp-primary, #6c63ff);
  background: #f0eeff;
  padding: 1px 8px;
  border-radius: 20px;
  margin-left: auto;
}

/* ── Aucun résultat ── */
.kmp-suggestion-empty {
  padding: 10px 14px;
  color: #aaa;
  font-size: 0.85rem;
  font-style: italic;
}

/* ── Hint sous le champ ── */
.kmp-field-hint {
  font-size: 0.78rem;
  color: #999;
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.kmp-subjects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 8px;
}

.kmp-subjects-grid .kmp-subject-toggle {
  width: 100%;
  text-align: center;
}

/* ── Upload zone ─────────────────────────────── */
.kmp-upload-zone {
  border: 2px dashed #ccc;
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s;
  position: relative;
}
.kmp-upload-zone:hover,
.kmp-upload-zone.kmp-drag-over {
  border-color: var(--bb-primary, #ff9800);
  background: #fff8f0;
}
.kmp-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.kmp-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #888;
  pointer-events: none;
}
.kmp-upload-placeholder i {
  font-size: 36px;
  color: #bbb;
}
.kmp-upload-hint {
  font-size: 12px;
  color: #aaa;
}

/* ── Preview ─────────────────────────────────── */
.kmp-upload-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #f5f5f5;
  border-radius: 8px;
}
.kmp-upload-preview img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
}
.kmp-remove-file {
  background: none;
  border: none;
  cursor: pointer;
  color: #e53935;
  font-size: 18px;
  margin-left: auto;
}

/* ── Feedback ─────────────────────────────────── */
.kmp-feedback {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-top: 10px;
}
.kmp-feedback--error {
  background: #fdecea;
  color: #c62828;
}
.kmp-feedback--success {
  background: #e8f5e9;
  color: #2e7d32;
}

/* ── Footer modale ───────────────────────────── */
.kmp-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.kmp-btn-cancel {
  padding: 10px 20px;
  background: #f0f0f0;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
}
.kmp-btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  background: var(--bb-primary, #ff9800);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.kmp-btn-submit:hover {
  background: #e68900;
}
.kmp-btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.kmp-resource-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s;
}
/* .kmp-resource-card:hover {
  transform: translateY(-3px);
} */
.kmp-resource-thumb img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}
.kmp-resource-info {
  padding: 10px 12px;
  text-align: center;
}
.kmp-resource-title {
  font-weight: 600;
  font-size: 14px;
  margin: 0 0 8px;
  color: #333;
}
.kmp-resource-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.kmp-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.kmp-tag-classe {
  background: #e8f4ff;
  color: #2271b1;
}
.kmp-tag-subject {
  background: #fff0e0;
  color: #d46b08;
}

.kmp-card-actions {
  margin-top: 10px;
  text-align: center;
}

.kmp-filters {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.kmp-filter-select,
.kmp-filter-input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
}

/* État actif (valeur sélectionnée / texte saisi) */
.kmp-filter-select.is-active {
  border-color: #ff99008c;
  border-width: 1px;
  outline: none;
  font-size: 1rem;
}

/* État focus */
.kmp-filter-select:focus {
  border-color: #ff99008c;
  color: var(--kmp-primary);
  border-width: 1px;
  outline: none;
  font-size: 1rem;
}

.kmp-filter-input:focus {
  border-color: #ff99008c;
  border-width: 1px;
  outline: none;
}

.kmp-filter-select:focus option,
.kmp-filter-select:focus optgroup {
  color: var(--kmp-text);
}

#kmp-confirm-modal {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.5);
}

#kmp-confirm-modal[hidden] {
  display: none;
}

.kmp-confirm-box {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  text-align: center;
}

#kmp-confirm-message {
  font-size: 1rem;
  margin-bottom: 20px;
  color: #333;
}

.kmp-confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

@media (max-width: 600px) {
  .kmp-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 5px;
  }

  .kmp-filter-select,
  .kmp-filter-input {
    flex: 1;
    min-width: 80px;
    font-size: 0.8rem;
  }

  .kmp-filters label {
    display: none;
  }

  .kampouss-section-header {
    flex-wrap: nowrap;
  }

  .kmp-btn-add-resource {
    flex-shrink: 0;
    margin-left: auto;
  }

  .kampouss-documents-section .kampouss-section-header {
    flex-direction: row;
    gap: 35px;
  }
}

@media (max-width: 600px) {
  .kmp-subjects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1000px) {
  .kmp-edit-icon {
    right: -30px;
    top: -5px;
  }

  .kmp-bubbles-wrap {
    flex-direction: column;
  }

  .kmp-tag {
    display: inline-block;
    padding: 0px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 400;
  }
}
