*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --teal:        #0d9e93;
  --teal-dark:   #0a8078;
  --teal-light:  #e8f7f6;
  --navy-1:      #0a2540;
  --navy-2:      #0b4f6c;
  --navy-3:      #0d9e93;
  --gold:        #f5a623;
  --green:       #27ae60;
  --red:         #e74c3c;
  --orange:      #e67e22;
  --purple:      #9b59b6;
  --bg:          #f0f2f5;
  --white:       #ffffff;
  --text:        #1a2332;
  --text-2:      #2c3e50;
  --muted:       #7f8c8d;
  --border:      #dde1e7;
  --sidebar-w:   200px;
  --header-h:    60px;
  --radius:      10px;
  --shadow:      0 2px 10px rgba(0,0,0,.07);
}

html, body {
  overflow-x: hidden;
  max-width: 100%;
  font-family: 'Poppins', 'Cairo', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Focus visible global accessible */
:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* Supprime le focus par défaut, garde focus-visible */
:focus:not(:focus-visible) {
  outline: none;
}

.ar {
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
}

/* ══════════════════════════════════════════
   HEADER
══════════════════════════════════════════ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--white);
  display: flex;
  align-items: center;
  padding: 0 16px;
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
  gap: 12px;
}
.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: calc(var(--sidebar-w) - 16px);
}
.header-logo-img {
  height: 46px;
  width: auto;
  object-fit: contain;
}
.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--teal), var(--navy-1));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: #fff;
  flex-shrink: 0;
}
.logo-text .ar {
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--teal);
  line-height: 1.1;
}
.logo-text .en {
  font-size: 11px;
  font-weight: 600;
  color: var(--navy-1);
}

.search-bar {
  flex: 1;
  max-width: 440px;
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 25px;
  padding: 0 14px;
  gap: 8px;
  height: 36px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-bar:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13,158,147,.1);
}
.search-bar input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  width: 100%;
  color: var(--text);
}
.search-bar input::placeholder {
  color: #adb5bd;
}
.search-bar i {
  color: var(--muted);
  font-size: 13px;
}

.filter-btn {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.15s;
}
.filter-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.wallet-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--navy-2), var(--navy-1));
  color: #fff;
  border-radius: 10px;
  padding: 5px 14px;
  box-shadow: 0 2px 8px rgba(10,37,64,.2);
}
.wallet-badge i {
  font-size: 18px;
  color: var(--gold);
}
.wb-label {
  font-size: 10px;
  opacity: .75;
  line-height: 1.2;
}
.wb-amount {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.chat-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 6px 15px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.chat-btn:hover {
  background: var(--teal-dark);
  transform: translateY(-1px);
}
.badge-3d {
  background: #fff;
  color: var(--teal);
  font-size: 9px;
  font-weight: 800;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.notif-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: var(--muted);
  padding: 4px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}
.notif-btn:hover {
  color: var(--teal);
  background: rgba(13,158,147,.08);
}
.notif-btn .dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid var(--white);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--teal);
  cursor: pointer;
  background: linear-gradient(135deg, var(--teal), var(--navy-1));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.user-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(13,158,147,.3);
}

/* ══════════════════════════════════════════
   LAYOUT
══════════════════════════════════════════ */
.layout {
  display: flex;
  padding-top: var(--header-h);
  flex: 1;
  overflow-x: hidden;
}

/* ══════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 12px 0;
  z-index: 90;
  overflow-y: auto;
  transition: transform .25s ease;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  transition: all 0.15s;
  position: relative;
}
.nav-item:hover {
  background: var(--teal-light);
  color: var(--teal);
}
.nav-item.active {
  color: var(--teal);
  font-weight: 600;
  background: var(--teal-light);
  border-right: 3px solid var(--teal);
}
.nav-item i {
  width: 18px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
}
.badge-new {
  background: var(--teal);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  margin-left: auto;
}

/* Bouton hamburger */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: var(--text-2);
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.15s;
}
.menu-toggle:hover {
  background: var(--bg);
}

/* Overlay sidebar mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 85;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(2px);
}
.sidebar-overlay.open {
  display: block;
}

/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 13px 30px;
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}
.logo-footer {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  color: var(--text);
}
.logo-footer .ar {
  font-family: 'Cairo', sans-serif;
  color: var(--teal);
}
footer a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}
footer a:hover {
  color: var(--teal);
}
footer .sep {
  color: var(--border);
}

/* ══════════════════════════════════════════
   MEDIA QUERIES
══════════════════════════════════════════ */

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 95;
    box-shadow: 4px 0 20px rgba(0,0,0,.1);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .wb-label { display: none; }
  .search-bar { max-width: 280px; }
}

@media (max-width: 768px) {
  .search-bar { max-width: 200px; }
  .chat-btn span,
  .chat-btn .chat-label { display: none; }
  .wallet-badge { padding: 5px 10px; }
  .wb-amount { font-size: 12px; }
  footer { padding: 10px 16px; gap: 10px; font-size: 11px; }
}

@media (max-width: 480px) {
  :root { --header-h: 54px; }
  .header { padding: 0 10px; gap: 8px; }
  .search-bar { display: none; }
  .filter-btn { display: none; }
  .wallet-badge { padding: 4px 8px; gap: 5px; }
  .wb-amount { font-size: 11px; }
  .header-right { gap: 8px; }
  .user-avatar { width: 32px; height: 32px; font-size: 12px; }
  footer { flex-direction: column; gap: 6px; text-align: center; padding: 10px; }
  footer .sep { display: none; }
}

@media (max-width: 360px) {
  .header { padding: 0 8px; gap: 6px; }
  .chat-btn { padding: 5px 9px; font-size: 11px; }
  .notif-btn { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
/* ════════════════════════════════════════════════════════
   AJOUTS HEADER — Dropdown, Notifications, Filtres
   ════════════════════════════════════════════════════════ */

/* ── Bouton effacer recherche ── */
.search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  font-size: 12px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  transition: all 0.15s;
}
.search-clear:hover {
  background: var(--border);
  color: var(--text);
}

/* ── Wrap dropdown utilisateur ── */
.user-dropdown-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

/* ── Dropdown utilisateur ── */
.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: -6px;
  width: 260px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0,0,0,.15);
  border: 1px solid var(--border);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all .25s cubic-bezier(.4,0,.2,1);
  z-index: 1000;
  padding: 8px 0;
  overflow: hidden;
}
.user-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.ud-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--teal-light), #fff);
}

.ud-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--navy-1));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  flex-shrink: 0;
}

.ud-info { min-width: 0; }
.ud-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ud-email {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.ud-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 12px;
}

.ud-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  font-size: 13px;
  color: var(--text-2);
  text-decoration: none;
  transition: all .15s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  font-family: inherit;
  text-align: left;
}
.ud-item:hover {
  background: var(--teal-light);
  color: var(--teal);
}
.ud-item i {
  font-size: 14px;
  width: 18px;
  text-align: center;
  color: var(--muted);
  transition: color .15s;
}
.ud-item:hover i { color: var(--teal); }

.ud-logout { color: var(--red); }
.ud-logout:hover { background: #fef2f2; color: var(--red); }
.ud-logout i { color: var(--red); }
.ud-logout:hover i { color: var(--red); }

/* ── Badge compteur notifications ── */
.notif-count {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
  border: 2px solid var(--white);
  display: none;
}

/* ── Panel notifications ── */
.notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: -6px;
  width: 340px;
  max-height: 420px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0,0,0,.15);
  border: 1px solid var(--border);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all .25s cubic-bezier(.4,0,.2,1);
  z-index: 1000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.notif-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.np-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
}

.np-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.np-mark-read {
  font-size: 11px;
  color: var(--teal);
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all .15s;
}
.np-mark-read:hover {
  background: var(--teal-light);
}

.np-list {
  overflow-y: auto;
  flex: 1;
  max-height: 320px;
}

.np-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
  font-size: 13px;
}
.np-empty i {
  font-size: 36px;
  display: block;
  margin-bottom: 10px;
  opacity: .25;
  color: var(--muted);
}

.np-item {
  display: flex;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all .15s;
}
.np-item:hover { background: var(--bg); }
.np-item.unread { background: var(--teal-light); border-left: 3px solid var(--teal); padding-left: 15px; }

.np-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--teal-light);
  color: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.np-icon.warning { background: #fef5e7; color: var(--orange); }
.np-icon.error { background: #fadbd8; color: var(--red); }
.np-icon.success { background: #eafaf1; color: var(--green); }

.np-content { flex: 1; min-width: 0; }
.np-text {
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.np-time {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

/* ── Panel filtres avancés ── */
.filter-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: -6px;
  width: 280px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0,0,0,.15);
  border: 1px solid var(--border);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all .25s cubic-bezier(.4,0,.2,1);
  z-index: 1000;
  padding: 18px;
}
.filter-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.filter-panel h4 {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.fp-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}
.fp-group label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.fp-group input,
.fp-group select {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .15s;
  width: 100%;
}
.fp-group input:focus,
.fp-group select:focus {
  border-color: var(--teal);
}

.fp-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.fp-btn {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.fp-btn-primary {
  background: var(--teal);
  color: #fff;
}
.fp-btn-primary:hover { background: var(--teal-dark); }
.fp-btn-secondary {
  background: var(--bg);
  color: var(--text-2);
  border: 1.5px solid var(--border);
}
.fp-btn-secondary:hover { border-color: var(--teal); color: var(--teal); }

/* ════════════════════════════════════════════════════════
   RESPONSIVE MOBILE — Bottom sheets
   ════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .header-logo {
    min-width: auto;
  }
  .user-dropdown,
  .notif-panel,
  .filter-panel {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: var(--radius) var(--radius) 0 0;
    transform: translateY(100%);
    max-height: 80vh;
    box-shadow: 0 -4px 30px rgba(0,0,0,.2);
  }
  .user-dropdown.open,
  .notif-panel.open,
  .filter-panel.open {
    transform: translateY(0);
  }
  .notif-panel { max-height: 70vh; }
  .np-list { max-height: calc(70vh - 60px); }
}
@media (max-width: 767px) {
  .layout {

  }
  .user-dropdown {
    top: 55px;
    bottom: auto;
    width: auto;
  }
}
@media (max-width: 480px) {
  .search-bar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    max-width: 100%;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
    height: 44px;
    z-index: 99;
    display: none;
  }
  .search-bar.active {
    display: flex;
  }
  .search-toggle-mobile {
    display: flex !important;
  }
}
/* ══════════════════════════════════════════
   SÉLECTEUR DE LANGUE
══════════════════════════════════════════ */
.nav-lang-switcher { position: relative; }

.nav-lang-btn {
  display: flex !important;
  align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer;
  font-size: 15px; color: var(--muted);
  padding: 6px 8px; border-radius: 8px;
  transition: color .15s, background .15s;
}
.nav-lang-btn:hover,
.nav-lang-btn[aria-expanded="true"] { color: var(--teal); background: var(--teal-light); }
.nav-lang-btn i { font-size: 15px; }
.nav-lang-code {
  font-size: 12px; font-weight: 700; letter-spacing: .03em;
  color: inherit; text-transform: uppercase;
}

.nav-lang-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: #fff; border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12);
  list-style: none; margin: 0; padding: 6px;
  min-width: 150px; z-index: 200;
}
.nav-lang-menu[hidden] { display: none; }
.nav-lang-menu li { margin: 0; }
.nav-lang-menu a {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--text-2);
  text-decoration: none; transition: background .15s, color .15s;
}
.nav-lang-menu a:hover { background: var(--bg); color: var(--text); }
.nav-lang-menu a.active {
  background: var(--teal-light); color: var(--teal-dark); font-weight: 700;
}
.nav-lang-menu a.active::after {
  content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
  margin-left: auto; font-size: 11px; color: var(--teal);
}

/* Bloc langue dans le menu mobile */
.nav-mobile-langs {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding-top: 12px; margin-top: 4px;
}
.nav-mobile-langs a {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 20px;
  border: 1.5px solid var(--border);
  font-size: 12px; font-weight: 600; color: var(--text-2);
  text-decoration: none; font-family: 'Cairo', sans-serif;
  transition: border-color .15s, color .15s, background .15s;
}
.nav-mobile-langs a i { font-size: 12px; }
.nav-mobile-langs a:hover { border-color: var(--teal); color: var(--teal); }
.nav-mobile-langs a.active {
  background: var(--teal); border-color: var(--teal); color: #fff;
}

@media (max-width: 480px) {
  .nav-lang-code { display: none; }
  .nav-lang-menu { right: -8px; }
}

/* ══════════════════════════════════════════
   SUPPORT RTL (arabe) — <html dir="rtl">
══════════════════════════════════════════ */
html[dir="rtl"] .nav-lang-menu { right: auto; left: 0; }
html[dir="rtl"] .nav-lang-menu a.active::after { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .nav-mobile-langs a { font-family: 'Cairo', sans-serif; }
html[dir="rtl"] .hero-features li { flex-direction: row-reverse; }
html[dir="rtl"] .section-header { flex-direction: row-reverse; }
html[dir="rtl"] .nav-links,
html[dir="rtl"] .nav-right {  }
html[dir="rtl"] .nav-compte,
html[dir="rtl"] .feat-item,
html[dir="rtl"] .hstat-item { text-align: right; }
.lang_fr {
  text-align: left !important;
}