/* ═══════════════════════════════════════════════════════════════
   CNASSi — Nouvelle Charte Graphique 2025
   Remplace les fichiers CSS du thème précédent.
   NE PAS modifier les fichiers _action, formulaires, ni requêtes.
═══════════════════════════════════════════════════════════════ */

/* ─── Google Fonts ────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&family=Sora:wght@300;400;500;600;700&display=swap');

/* ─── Variables ───────────────────────────────────────────── */
:root {
  --purple:        #6b21a8;
  --purple-dark:   #5A1F68;
  --purple-mid:    #7B2D8B;
  --purple-light:  #EDE0F5;
  --purple-xlight: #F8F0FC;
  --orange:        #E8721C;
  --orange-light:  #FEF0E6;
  --orange-mid:    #F08540;
  --gray-bg:       #F5F4F8;
  --gray-border:   #E2DDE8;
  --text-main:     #1A1025;
  --text-sub:      #6B6380;
  --white:         #FFFFFF;
  --shadow-sm:     0 1px 4px rgba(107,33,168,0.08);
  --shadow-md:     0 4px 20px rgba(107,33,168,0.12);
  --shadow-lg:     0 8px 40px rgba(107,33,168,0.18);
  --radius:        12px;
  --radius-sm:     8px;
  --radius-xs:     6px;
  --radius-pill:   9999px;

  /* Sidebar width */
  --sidebar-w:     250px;
  /* Navbar height */
  --navbar-h:      52px;
}

/* ─── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Sora', 'Segoe UI', sans-serif;
  background-color: var(--gray-bg);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
input, select, button, textarea { font-family: inherit; }
.font-arabic, [dir="rtl"] { font-family: 'Cairo', sans-serif; }

/* ═══════════════════════════════════════════════════════════
   NAVBAR (remplace .header-navbar du thème Chameleon)
═══════════════════════════════════════════════════════════ */
.cnass-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--navbar-h);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  background: linear-gradient(90deg, #E8721C 0%, #C96018 10%, #8B3296 50%, #7B2D8B 70%, #5A1F68 100%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

/* Bouton burger (mobile) */
.cnass-topbar .burger-btn {
  background: none; border: none; cursor: pointer;
  color: #fff; font-size: 1.4rem; display: none;
  padding: 4px;
}
@media (max-width: 768px) {
  .cnass-topbar .burger-btn { display: flex; align-items: center; }
}

/* Logo dans la topbar (visible mobile uniquement) */
.cnass-topbar .topbar-logo {
  height: 36px;
  display: none;
}
@media (max-width: 768px) {
  .cnass-topbar .topbar-logo { display: block; }
}

/* Titre centre */
.cnass-topbar .topbar-title {
  font-size: 15px; font-weight: 700; color: #fff;
  letter-spacing: 0.2px;
}
.cnass-topbar .topbar-title span { color: #FDE68A; }

/* Zone droite */
.cnass-topbar .topbar-right {
  display: flex; align-items: center; gap: 10px;
}
.cnass-topbar .topbar-user {
  display: flex; align-items: center; gap: 8px;
  color: #fff; font-size: 13px; font-weight: 500;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-pill);
  padding: 4px 12px 4px 6px;
  cursor: pointer;
  position: relative;
}
.cnass-topbar .topbar-user img {
  width: 28px; height: 28px; border-radius: 50%;
  object-fit: cover; border: 2px solid rgba(255,255,255,0.5);
}
.cnass-topbar .user-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Dropdown utilisateur */
.topbar-dropdown {
  display: none; position: absolute;
  top: calc(100% + 8px); right: 0;
  min-width: 180px;
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-border);
  overflow: hidden;
  z-index: 9999;
}
.topbar-dropdown.open { display: block; }
.topbar-dropdown a {
  display: flex; align-items: center; gap: 8px;
  padding: 0.7rem 1rem;
  font-size: 13px; color: var(--text-main);
  transition: background 0.15s;
}
.topbar-dropdown a:hover { background: var(--purple-xlight); }
.topbar-dropdown a i { font-size: 16px; color: var(--purple); }
.topbar-dropdown .dd-divider { height: 1px; background: var(--gray-border); }

/* Bouton déconnexion topbar (fallback sans dropdown) */
.btn-topbar-logout {
  display: flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,0.15);
  border: none; border-radius: var(--radius-pill);
  color: #fff; font-size: 13px; font-weight: 500;
  padding: 5px 12px; cursor: pointer;
  transition: background 0.15s;
}
.btn-topbar-logout:hover { background: rgba(255,255,255,0.28); }

/* Logo CNASSi dans topbar (desktop) */
.cnass-topbar .topbar-badge {
  height: 34px;
}

/* ═══════════════════════════════════════════════════════════
   SIDEBAR (remplace .main-menu du thème Chameleon)
═══════════════════════════════════════════════════════════ */
.cnass-sidebar {
  position: fixed;
  top: var(--navbar-h); left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #5A1F68 0%, #7B2D8B 45%, #8B3296 100%);
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
  z-index: 900;
  transition: transform 0.25s ease;
}

/* Sidebar logo */
.sidebar-brand {
  display: flex; align-items: center; justify-content: center;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.sidebar-brand img { height: 52px; object-fit: contain; }

/* Nav items */
.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0;
  list-style: none;
}
.sidebar-nav li a {
  display: flex; align-items: center; gap: 10px;
  padding: 0.7rem 1.1rem;
  color: rgba(255,255,255,0.8);
  font-size: 13.5px; font-weight: 500;
  transition: background 0.15s, color 0.15s;
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
  margin-right: 12px;
  position: relative;
}
.sidebar-nav li a:hover {
  background: rgba(255,255,255,0.13);
  color: #fff;
}
.sidebar-nav li a.active {
  background: rgba(255,255,255,0.22);
  color: #fff; font-weight: 700;
}
.sidebar-nav li a i { font-size: 18px; flex-shrink: 0; }

/* Texte bilingue dans le menu */
.sidebar-nav .menu-ar {
  font-family: 'Cairo', sans-serif;
  font-size: 15px; font-weight: 700;
  line-height: 1.1;
  display: block;
}
.sidebar-nav .menu-fr {
  font-size: 11px;
  opacity: 0.75;
  display: block;
}

/* Badge notification */
.sidebar-badge {
  margin-left: auto;
  background: #ef4444; color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: var(--radius-pill);
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px;
}

/* Bouton déconnexion bas sidebar */
.sidebar-logout {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,0.12);
}
.sidebar-logout a {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: rgba(255,255,255,0.12);
  border-radius: var(--radius-pill);
  padding: 0.65rem 1rem;
  color: #fff; font-size: 13px; font-weight: 600;
  transition: background 0.15s;
}
.sidebar-logout a:hover { background: rgba(255,255,255,0.24); }

/* Mobile: sidebar masquée par défaut */
@media (max-width: 768px) {
  .cnass-sidebar {
    transform: translateX(-100%);
  }
  .cnass-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,0.25);
  }
}

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

/* ═══════════════════════════════════════════════════════════
   LAYOUT PRINCIPAL (zone de contenu)
═══════════════════════════════════════════════════════════ */
.cnass-main {
  margin-left: var(--sidebar-w);
  margin-top: var(--navbar-h);
  padding: 1.5rem;
  min-height: calc(100vh - var(--navbar-h));
}
@media (max-width: 768px) {
  .cnass-main { margin-left: 0; padding: 1rem; }
}

/* En-tête de page */
.page-header {
  margin-bottom: 1.5rem;
}
.page-title {
  font-size: 1.15rem; font-weight: 700; color: var(--purple);
  margin-bottom: 4px;
}
.breadcrumb-cnass {
  font-size: 12px; color: var(--text-sub);
}
.breadcrumb-cnass a { color: var(--purple); }
.breadcrumb-cnass span { margin: 0 5px; opacity: 0.5; }

/* ═══════════════════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════════════════ */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-border);
  overflow: hidden;
}
/* Compatibilité : l'ancien thème utilise .card-header / .card-body */
.card-header {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--gray-border);
  background: var(--purple-xlight);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
}
.card-header h4,
.card-header h5,
.card-header .card-title {
  font-size: 15px; font-weight: 700; color: var(--purple);
  margin: 0;
}
.card-body {
  padding: 1.25rem;
}

/* Card section avec header coloré (style Next) */
.card1 {
  margin-bottom: 1.25rem;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #C084FC;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}
.card1 .section-title1 {
  padding: 0.9rem 1rem;
  background: linear-gradient(90deg, #6B21A8 0%, #9333EA 100%);
}
.card1 .section-title1 span {
  color: #fff; font-size: 14px; font-weight: 600;
}
.card1 > .card1-body {
  padding: 1rem;
  background: #FAF8FF;
}

/* ═══════════════════════════════════════════════════════════
   BOUTONS (remplace Bootstrap .btn-)
═══════════════════════════════════════════════════════════ */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(135deg, #7B2D8B 0%, #5A1F68 100%);
  color: #fff; font-weight: 600; font-size: 0.875rem;
  padding: 0.65rem 1.6rem; border-radius: var(--radius-pill);
  border: none; cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(123,45,139,0.28);
  text-decoration: none;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #8B3296 0%, #6B2479 100%);
  box-shadow: 0 4px 16px rgba(123,45,139,0.38);
  transform: translateY(-1px);
  color: #fff;
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: transparent; color: var(--purple);
  font-weight: 600; font-size: 0.875rem;
  padding: 0.6rem 1.6rem; border-radius: var(--radius-pill);
  border: 2px solid var(--purple); cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}
.btn-secondary:hover { background: var(--purple-xlight); color: var(--purple); }

.btn-orange {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(135deg, #E8721C 0%, #C96018 100%);
  color: #fff; font-weight: 600; font-size: 0.875rem;
  padding: 0.65rem 1.6rem; border-radius: var(--radius-pill);
  border: none; cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(232,114,28,0.28);
  text-decoration: none;
}
.btn-orange:hover { box-shadow: 0 4px 16px rgba(232,114,28,0.38); transform: translateY(-1px); color: #fff; }

/* Compatibilité Bootstrap .btn-block */
.btn-block { display: flex; width: 100%; }

/* Bouton violet plein (action list) */
.btn-violet {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0.5rem 1.1rem; border-radius: 30px;
  border: none; font-size: 13px; font-weight: 500; cursor: pointer;
  background: var(--purple); color: #fff; transition: opacity 0.15s;
}
.btn-violet:hover { opacity: 0.85; }

/* ═══════════════════════════════════════════════════════════
   FORMULAIRES (style uniquement — ne pas modifier les champs)
═══════════════════════════════════════════════════════════ */
.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
  display: block; width: 100%;
  padding: 0.6rem 0.9rem;
  border: 1.5px solid var(--gray-border);
  border-radius: var(--radius-sm);
  background: var(--white); color: var(--text-main);
  font-size: 0.875rem; font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.form-control:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(107,33,168,0.1);
}
.form-control[disabled],
input:disabled,
select:disabled { background: #f3f3f7; opacity: 0.7; }

label {
  display: block; font-size: 0.82rem; font-weight: 600;
  color: var(--text-main); margin-bottom: 0.28rem;
}
.form-label-ar {
  font-family: 'Cairo', sans-serif; font-size: 0.82rem;
  color: var(--purple); font-weight: 600;
}
.form-error, .text-danger { color: #dc2626; font-size: 0.75rem; }

/* Grille de formulaire (remplace .row/.col- Bootstrap) */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.form-group { margin-bottom: 1rem; }

/* ═══════════════════════════════════════════════════════════
   TABLEAUX (liste adhérents, etc.)
═══════════════════════════════════════════════════════════ */
.table-cnass {
  width: 100%; border-collapse: collapse;
  font-size: 13.5px;
}
.table-cnass thead tr {
  background: linear-gradient(90deg, #7B2D8B 0%, #9333EA 100%);
  color: #fff;
}
.table-cnass thead th {
  padding: 0.75rem 1rem; font-weight: 600;
  text-align: left; white-space: nowrap;
}
.table-cnass tbody tr { border-bottom: 1px solid var(--gray-border); }
.table-cnass tbody tr:nth-child(even) { background: #FAF8FF; }
.table-cnass tbody tr:hover { background: var(--purple-xlight); }
.table-cnass tbody td { padding: 0.7rem 1rem; vertical-align: middle; }

/* Wrapper responsive */
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow-sm); }

/* ─── Compatibilité .table Bootstrap ──── */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table thead th {
  background: var(--purple); color: #fff;
  padding: 0.7rem 1rem; font-weight: 600; border: none;
}
.table tbody td { padding: 0.65rem 1rem; border-bottom: 1px solid var(--gray-border); vertical-align: middle; }
.table tbody tr:hover { background: var(--purple-xlight); }
.table-bordered td, .table-bordered th { border: 1px solid var(--gray-border); }

/* ═══════════════════════════════════════════════════════════
   BADGES / STATUTS
═══════════════════════════════════════════════════════════ */
.badge, .badge-cnass {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600;
}
.badge-success, .badge-active   { background: #DCFCE7; color: #166534; }
.badge-warning, .badge-pending  { background: #FEF3C7; color: #92400E; }
.badge-danger,  .badge-error    { background: #FEE2E2; color: #991B1B; }
.badge-info                     { background: #DBEAFE; color: #1E40AF; }
.badge-new                      { background: var(--orange); color: #fff; }

/* Compatibilité Bootstrap pill */
.badge-pill, .rounded-pill { border-radius: var(--radius-pill) !important; }

/* ═══════════════════════════════════════════════════════════
   ALERTES
═══════════════════════════════════════════════════════════ */
.alert {
  padding: 0.85rem 1rem; border-radius: var(--radius-sm);
  font-size: 0.875rem; border-left: 4px solid; margin-bottom: 1rem;
}
.alert-success { background: #f0fdf4; border-color: #22c55e; color: #166534; }
.alert-danger,
.alert-error   { background: #fef2f2; border-color: #ef4444; color: #991b1b; }
.alert-info    { background: #eff6ff; border-color: #3b82f6; color: #1e40af; }
.alert-warning { background: #fffbeb; border-color: #f59e0b; color: #92400e; }

/* ═══════════════════════════════════════════════════════════
   SECTION TITLE (en-têtes de section dans les pages)
═══════════════════════════════════════════════════════════ */
.section-title {
  font-size: 0.95rem; font-weight: 700; color: var(--purple);
  padding-bottom: 0.65rem; margin-bottom: 1rem;
  border-bottom: 2px solid var(--purple-light);
  display: flex; align-items: center; justify-content: space-between;
}
.section-title1 {
  font-size: 14px; font-weight: 600; color: var(--purple);
  margin-bottom: 1rem; padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--purple-light);
}

/* ═══════════════════════════════════════════════════════════
   STAT CARDS (accueil)
═══════════════════════════════════════════════════════════ */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px; margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-num  { font-size: 26px; font-weight: 700; color: var(--purple); }
.stat-label { font-size: 11px; color: var(--text-sub); margin-top: 2px; }

/* ═══════════════════════════════════════════════════════════
   BENEFICIAIRES / FAMILLE BLOCKS
═══════════════════════════════════════════════════════════ */
.benef-section {
  border: 1.5px solid var(--gray-border);
  border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem;
  background: #faf8fc; position: relative;
}
.benef-badge {
  position: absolute; top: -0.75rem; left: 1rem;
  background: var(--purple); color: #fff;
  font-size: 0.72rem; font-weight: 700;
  padding: 0.2rem 1rem; border-radius: var(--radius-pill);
}
.famille-block {
  margin-bottom: 1.25rem; border-radius: 14px; overflow: hidden;
  border: 1px solid #C084FC;
  box-shadow: 0 1px 6px rgba(107,33,168,0.07);
}
.famille-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem;
  background: linear-gradient(90deg, #6B21A8 0%, #9333EA 100%);
  cursor: pointer; user-select: none;
}
.fh-name { font-size: 14px; font-weight: 600; color: #fff; }
.fh-date { font-size: 11px; color: rgba(255,255,255,0.72); }
.fh-badge {
  font-size: 11px; font-weight: 500; padding: 2px 9px;
  border-radius: 20px; background: rgba(255,255,255,0.22); color: #fff;
}
.fh-chevron { font-size: 18px; color: rgba(255,255,255,0.85); transition: transform 0.25s; }
.fh-chevron.open { transform: rotate(180deg); }
.famille-body { background: #FAF8FF; padding: 1rem; display: none; border-top: 1px solid #E9D5FF; }
.famille-body.open { display: block; }

/* Adhérent card */
.adh-card {
  background: #fff; border: 1px solid #E9D5FF;
  border-radius: 12px; padding: 0.85rem;
  transition: border-color 0.15s;
}
.adh-card:hover { border-color: #C084FC; }
.card-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--purple-light); color: var(--purple);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.s-pending  { background: #FEF3C7; color: #92400E; border-radius: var(--radius-pill); padding: 2px 8px; font-size: 10px; font-weight: 500; }
.s-valid    { background: #DCFCE7; color: #166534; border-radius: var(--radius-pill); padding: 2px 8px; font-size: 10px; font-weight: 500; }
.s-rejected { background: #FEE2E2; color: #991B1B; border-radius: var(--radius-pill); padding: 2px 8px; font-size: 10px; font-weight: 500; }

/* ═══════════════════════════════════════════════════════════
   STEP WIZARD
═══════════════════════════════════════════════════════════ */
.step-dot {
  width: 2rem; height: 2rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.8rem;
}
.step-active   { background: #ef4444; color: #fff; }
.step-done     { background: var(--purple); color: #fff; }
.step-inactive { background: #d1d5db; color: #6b7280; }
.step-line     { height: 2px; width: 4rem; }
.step-line-done     { background: var(--purple); }
.step-line-inactive { background: #d1d5db; }

/* ═══════════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════════ */
.cnass-footer {
  margin-left: var(--sidebar-w);
  padding: 1rem 1.5rem;
  font-size: 12px; color: var(--text-sub);
  border-top: 1px solid var(--gray-border);
  background: var(--white);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 6px;
}
.cnass-footer a { color: var(--purple); font-weight: 600; }
@media (max-width: 768px) {
  .cnass-footer { margin-left: 0; flex-direction: column; text-align: center; }
}

/* ─── Compatibilité .footer Bootstrap ─── */
footer.footer {
  margin-left: var(--sidebar-w);
  padding: 0.85rem 1.5rem;
  font-size: 12px; color: var(--text-sub);
  background: var(--white);
  border-top: 1px solid var(--gray-border);
}
@media (max-width: 768px) { footer.footer { margin-left: 0; } }

/* ═══════════════════════════════════════════════════════════
   SPINNER / LOADER
═══════════════════════════════════════════════════════════ */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-border, .spin {
  display: inline-block;
  width: 1.5rem; height: 1.5rem;
  border: 3px solid var(--purple-light);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
.spinner-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 9999; gap: 12px;
}
.spinner-overlay .spin { width: 2.5rem; height: 2.5rem; border-width: 4px; }
.spinner-overlay p { color: #fff; font-size: 14px; }

/* ═══════════════════════════════════════════════════════════
   UTILITAIRES DIVERS
═══════════════════════════════════════════════════════════ */
.text-purple  { color: var(--purple); }
.text-orange  { color: var(--orange); }
.bg-purple    { background-color: var(--purple); }
.bg-purple-light { background-color: var(--purple-light); }
.divider { height: 1px; background: var(--gray-border); margin: 1rem 0; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f0edf5; }
::-webkit-scrollbar-thumb { background: #c4b0d4; border-radius: 10px; }

/* ─── Recherche ─── */
.search-wrap {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--gray-border);
  border-radius: 30px; padding: 0.5rem 1rem; margin-bottom: 1.25rem;
}
.search-wrap i { font-size: 18px; color: #aaa; }
.search-wrap input {
  border: none; background: transparent; flex: 1; outline: none;
  font-size: 14px; color: var(--text-main);
}
.search-wrap input::placeholder { color: #bbb; }

/* ─── RTL ─── */
[dir="rtl"] .cnass-sidebar { left: auto; right: 0; }
[dir="rtl"] .cnass-main    { margin-left: 0; margin-right: var(--sidebar-w); }
[dir="rtl"] .cnass-footer  { margin-left: 0; margin-right: var(--sidebar-w); }
[dir="rtl"] footer.footer  { margin-left: 0; margin-right: var(--sidebar-w); }
[dir="rtl"] .sidebar-nav li a { border-radius: var(--radius-pill) 0 0 var(--radius-pill); margin-right: 0; margin-left: 12px; }
[dir="rtl"] .benef-badge   { left: auto; right: 1rem; }
[dir="rtl"] .alert         { border-left: none; border-right: 4px solid; }
[dir="rtl"] .table-cnass thead th,
[dir="rtl"] .table thead th { text-align: right; }

/* ─── Font switch ─── */
[lang="ar"] body,
[lang="ar"] input,
[lang="ar"] select,
[lang="ar"] button,
[lang="ar"] textarea { font-family: 'Cairo', sans-serif; }

/* ═══════════════════════════════════════════════════════════
   COMPATIBILITÉ CHAMELEON / BOOTSTRAP RÉDUITE
   (pour ne pas casser les pages existantes)
═══════════════════════════════════════════════════════════ */

/* Layout général Chameleon → on adapte */
.vertical-layout .app-content { padding-top: var(--navbar-h); }
.app-content.content { margin-left: var(--sidebar-w); padding: 1.5rem; }
@media (max-width: 768px) { .app-content.content { margin-left: 0; } }
.content-wrapper { max-width: 1200px; }
.content-wrapper-before { display: none; } /* ancienne barre dégradée */

/* En-têtes de contenu */
.content-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; flex-wrap: wrap; gap: 8px; }
.content-header-title { font-size: 1.1rem; font-weight: 700; color: var(--purple); margin: 0; }
.breadcrumb { display: flex; align-items: center; gap: 4px; list-style: none; font-size: 12px; color: var(--text-sub); }
.breadcrumb-item a { color: var(--purple); }
.breadcrumb-item + .breadcrumb-item::before { content: "/"; margin: 0 4px; opacity: 0.4; }

/* Rows Bootstrap compatibles */
.row { display: flex; flex-wrap: wrap; margin: -0.5rem; }
.row > [class*="col-"] { padding: 0.5rem; }
.col-12  { width: 100%; }
.col-lg-6, .col-md-6 { width: 50%; }
.col-lg-4, .col-md-4 { width: 33.333%; }
.col-lg-3, .col-md-3 { width: 25%; }
@media (max-width: 768px) {
  .col-lg-6, .col-md-6,
  .col-lg-4, .col-md-4,
  .col-lg-3, .col-md-3 { width: 100%; }
}
.match-height > [class*="col-"] .card { height: 100%; }

/* Heading elements */
.heading-elements { display: flex; gap: 8px; align-items: center; }

/* Input group */
.input-group { display: flex; }
.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group-append .btn-primary { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
