#sidebar {
  width: 250px;
  transition: all 0.3s;
}

.nav-link.active {
  font-weight: bold;
  background-color: var(--app-blue);
  color: white !important;
  border-radius: 0.375rem;
}

/* ==========================================================================
   Mobile App Design (Accueil / Contacts / Paramètres / Transfert)
   ========================================================================== */

:root {
  --app-dark: #191927;

  /* Couleur primaire (marque / actions) — alignée sur l'illustration de login */
  --app-blue: #407bff;
  --app-blue-dark: #2b5fd9;
  --app-blue-light: #eaf1ff;

  /* Couleurs identitaires du logo Emadex.
     Le rouge et le vert authentiques ne sont lisibles que sur fond clair
     (ratios WCAG sur #191927 : rouge 3.39, vert 2.55 → sous le seuil AA).
     Les variantes «-on-dark» sont donc utilisées dans les bandeaux sombres
     (ratios 6.26 et 9.32 → conformes AA). */
  --brand-red: #d6202a;
  --brand-red-on-dark: #ff6b6b;
  --brand-green: #00693c;
  --brand-green-on-dark: #5fd39b;

  /* Couleurs sémantiques : réservées au sens (statut), jamais à la marque.
     Le vert reste dédié aux états "succès / livré" pour rester lisible
     à côté de l'orange (en attente) et du rouge (annulé). */
  --app-success: #1ba672;
  --app-success-dark: #128a5c;
  --app-success-light: #e6f6ee;

  --app-orange: #f5a623;
  --app-orange-light: #fdf1dc;
  --app-red: #e0554f;
  --app-red-light: #fbe4e2;
  --app-grey-bg: #f4f5f8;
  --app-text-muted: #8a8d99;
}

body.app-body {
  background-color: var(--app-grey-bg);
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background-color: var(--app-grey-bg);
  position: relative;
  padding-bottom: 96px;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.06);
}

/* ---- Bandeau mobile (header) ---- */

.mobile-header {
  background-color: var(--app-dark);
  color: #fff;
  padding: 1.25rem 1.25rem 1.5rem 1.25rem;
  border-bottom-left-radius: 1.25rem;
  border-bottom-right-radius: 1.25rem;
}

.mobile-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

/* La marque occupe l'espace libre : la flèche reste collée à gauche et
   l'avatar à droite, quelle que soit la présence du bouton retour. */
.mobile-header-top .brand,
.mobile-header-top > .logo-emadex {
  flex: 1;
  min-width: 0;
}

/* ---- Bouton retour du bandeau ----
   Auparavant la flèche remplaçait l'avatar (structure if/else) : on ne pouvait
   jamais avoir à la fois le repère d'identité et la sortie de secours. */
.header-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.12);
  color: #fff;
  text-decoration: none;
  font-size: 1.05rem;
}

.header-back:hover {
  background-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.header-back:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 2px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   Logo Emadex — reproduit en HTML/CSS (aucun fichier image)
   ==========================================================================
   Les fichiers fournis étaient inutilisables en l'état : les deux « PNG »
   récents étaient en réalité des JPEG 600x600 à fond blanc opaque (doublons
   exacts, même MD5 — conservés sous assets/logos/emadex-logo-source.jpg comme
   référence visuelle), et emadex_logo(old).png a son texte en contour noir —
   donc invisible sur le bandeau sombre — avec une mention « 15 ans » périmée.

   Deux déclinaisons :
   - .logo-emadex--compact : flèche + wordmark, pour les bandeaux (~26px de haut)
   - .logo-emadex--full    : lockup 3 lignes aux couleurs de marque, réservé aux
                             surfaces claires où le rouge/vert passent le seuil AA
   ========================================================================== */

.logo-emadex {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: inherit;
  line-height: 1;
}

.logo-emadex:hover {
  text-decoration: none;
  color: inherit;
}

.logo-emadex:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 3px;
  border-radius: 0.35rem;
}

/* ---- La flèche / curseur du logo ----
   Reproduite en clip-path : c'est la forme d'un curseur de navigation, penchée
   vers la droite, telle qu'elle apparaît entre VOLA et ENTANA. */

.logo-arrow {
  display: inline-block;
  width: 0.72em;
  height: 0.95em;
  flex-shrink: 0;
  background-color: currentColor;
  clip-path: polygon(4% 0%, 100% 42%, 52% 55%, 74% 100%, 46% 74%, 24% 96%);
}

/* ---- Wordmark « EMADEX » ---- */

.logo-word {
  font-weight: 800;
  letter-spacing: 0.01em;
  font-size: 1.05em;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Variante COMPACTE — bandeaux mobile & public
   Les lignes « VOLA ENTANA » et la tagline sont volontairement omises : à 26px
   de hauteur elles seraient illisibles.
   -------------------------------------------------------------------------- */

.logo-emadex--compact {
  font-size: 1.05rem;
  color: #fff;
}

.logo-emadex--compact .logo-arrow {
  color: #fff;
}

.logo-emadex--compact .logo-word {
  color: #fff;
}

/* Le point « .com » reste évoqué par une pastille colorée discrète */
.logo-emadex--compact .logo-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--brand-red-on-dark);
  margin-left: 0.15rem;
  vertical-align: 0.1em;
}

/* --------------------------------------------------------------------------
   Variante COMPLÈTE — lockup 3 lignes, surfaces claires uniquement
   -------------------------------------------------------------------------- */

.logo-emadex--full {
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}

/* Ligne 1 : « VOLA ⌃ ENTANA » en lettres creuses (contour) */
.logo-emadex-top {
  display: inline-flex;
  align-items: center;
  gap: 0.12em;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--app-dark);
}

/* Lettres creuses : le remplissage est transparent, seul le contour subsiste.
   Fallback : si text-stroke n'est pas supporté, le texte reste plein et lisible. */
@supports (-webkit-text-stroke: 1px black) {
  .logo-emadex-top .logo-outline {
    -webkit-text-stroke: 1px var(--app-dark);
    -webkit-text-fill-color: transparent;
  }
}

.logo-emadex-top .logo-arrow {
  width: 0.6em;
  height: 0.85em;
  color: var(--app-dark);
}

/* Ligne 2 : « EMADEX.COM » — l'élément dominant du lockup */
.logo-emadex-main {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.005em;
  color: var(--brand-red);
  line-height: 1;
}

/* Ligne 3 : tagline manuscrite verte, soulignée d'un trait courbe */
.logo-emadex-tag {
  position: relative;
  font-family: "Segoe Script", "Bradley Hand", "Brush Script MT", cursive;
  font-style: italic;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--brand-green);
  padding-bottom: 0.3rem;
}

/* Le trait courbe sous la tagline : un quart d'ellipse en bordure basse */
.logo-emadex-tag::after {
  content: "";
  position: absolute;
  left: 2%;
  right: 2%;
  bottom: 0;
  height: 0.45rem;
  border-bottom: 1.5px solid var(--brand-green);
  border-radius: 0 0 50% 50%;
}

/* Sur fond sombre, le lockup complet bascule sur les variantes éclaircies */
.logo-emadex--full.logo-emadex--on-dark .logo-emadex-top {
  color: #fff;
}

@supports (-webkit-text-stroke: 1px black) {
  .logo-emadex--full.logo-emadex--on-dark .logo-emadex-top .logo-outline {
    -webkit-text-stroke: 1px #fff;
  }
}

.logo-emadex--full.logo-emadex--on-dark .logo-emadex-top .logo-arrow {
  color: #fff;
}

.logo-emadex--full.logo-emadex--on-dark .logo-emadex-main {
  color: #fff;
}

.logo-emadex--full.logo-emadex--on-dark .logo-emadex-tag,
.logo-emadex--full.logo-emadex--on-dark .logo-emadex-tag::after {
  color: var(--brand-green-on-dark);
  border-color: var(--brand-green-on-dark);
}

/* Bloc de marque centré en tête d'une carte (page de connexion) */
.logo-brand-block {
  display: flex;
  margin: 0 auto 1rem auto;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f0f0f2;
  width: 100%;
}

/* ---- Anciennes classes de marque ----
   Conservées pour rétro-compatibilité si un template les réutilise. */

.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background-color: var(--app-blue);
  color: #fff;
  font-weight: 700;
  border-radius: 0.5rem;
  font-size: 0.95rem;
}

.brand-name {
  font-weight: 700;
  letter-spacing: 0.03em;
}

.avatar-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: var(--app-blue-light);
  color: var(--app-blue-dark);
  font-weight: 700;
}

.avatar-header {
  width: 40px;
  height: 40px;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

/* ---- Tailles d'avatar tokenisées ----
   Remplace les style="width:38px;height:48px..." répétés dans les templates. */

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 0.8rem;
}

.avatar-md {
  width: 38px;
  height: 38px;
  font-size: 0.9rem;
}

.avatar-lg {
  width: 48px;
  height: 48px;
  font-size: 1.1rem;
}

.mobile-header-subtitle {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.mobile-header-title {
  margin: 0.15rem 0 0 0;
  font-size: 1.35rem;
  font-weight: 700;
}

/* ---- Contenu ---- */
.app-content {
  padding: 1rem 1rem 0 1rem;
}

.app-card {
  background-color: #fff;
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  margin-bottom: 1rem;
}

/* ---- Boutons d'action (Envoyer / Mes contacts) ---- */
.action-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.action-card {
  flex: 1;
  border-radius: 1rem;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  display: block;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.action-card-primary {
  background-color: var(--app-blue);
  color: #fff;
}

.action-card-secondary {
  background-color: #fff;
  color: var(--app-dark);
}

.action-icon-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  margin-bottom: 0.6rem;
  font-size: 1.1rem;
}

.action-card-primary .action-icon-circle {
  background-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.action-card-secondary .action-icon-circle {
  background-color: var(--app-blue-light);
  color: var(--app-blue-dark);
}

.action-title {
  font-weight: 700;
  margin-bottom: 0.1rem;
  font-size: 0.95rem;
}

.action-subtitle {
  font-size: 0.78rem;
  opacity: 0.85;
}

.action-card-secondary .action-subtitle {
  color: var(--app-text-muted);
}

/* ---- Taux de change ---- */
.rate-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--app-text-muted);
}

.rate-value {
  color: var(--app-blue-dark);
  font-weight: 700;
}

.rate-pill {
  display: inline-block;
  background-color: var(--app-blue-light);
  color: var(--app-blue-dark);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  margin: 0.5rem 0;
}

/* ---- Statistiques ---- */
.stats-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.stat-card {
  flex: 1;
  background-color: #fff;
  border-radius: 1rem;
  padding: 0.9rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.stat-label {
  font-size: 0.7rem;
  color: var(--app-text-muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.1rem;
}

.stat-value-orange {
  color: var(--app-orange);
}

.stat-value-success {
  color: var(--app-success-dark);
}

.stat-sub {
  font-size: 0.78rem;
  color: var(--app-text-muted);
}

/* ---- Liste des derniers transferts ---- */
.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.section-title {
  font-weight: 700;
  font-size: 1rem;
  margin: 0;
}

.section-link {
  color: var(--app-blue-dark);
  font-size: 0.85rem;
  text-decoration: none;
  font-weight: 600;
}

.transfer-item {
  display: flex;
  align-items: center;
  background-color: #fff;
  border-radius: 1rem;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.65rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  text-decoration: none;
  color: inherit;
}

.transfer-item-avatar {
  width: 38px;
  height: 38px;
  font-size: 0.9rem;
  margin-right: 0.75rem;
  flex-shrink: 0;
}

.transfer-item-body {
  flex: 1;
  min-width: 0;
}

.transfer-item-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transfer-item-date {
  font-size: 0.75rem;
  color: var(--app-text-muted);
  margin: 0;
}

.transfer-item-right {
  text-align: right;
  margin-left: 0.5rem;
  flex-shrink: 0;
}

.transfer-item-amount {
  font-weight: 700;
  font-size: 0.9rem;
  display: block;
  margin-bottom: 0.25rem;
}

/* Badges de statut */
.status-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.status-badge-warning {
  background-color: var(--app-orange-light);
  color: var(--app-orange);
}

.status-badge-info {
  background-color: #e3f1fd;
  color: #1a7dc4;
}

.status-badge-primary {
  background-color: #e7e6fb;
  color: #5b52d6;
}

.status-badge-danger {
  background-color: var(--app-red-light);
  color: var(--app-red);
}

.status-badge-success {
  background-color: var(--app-success-light);
  color: var(--app-success-dark);
}

.status-badge-secondary {
  background-color: #ececef;
  color: #6b6d76;
}

/* ---- Bottom navigation ---- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background-color: #fff;
  border-top: 1px solid #ececef;
  display: flex;
  justify-content: space-around;
  padding: 0.5rem 0 0.65rem 0;
  z-index: 1000;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  color: var(--app-text-muted);
  text-decoration: none;
  font-size: 0.7rem;
  flex: 1;
}

.bottom-nav-item i {
  font-size: 1.2rem;
}

.bottom-nav-item.active {
  color: var(--app-blue-dark);
  font-weight: 700;
}

/* ==========================================================================
   Page Contacts (liste des bénéficiaires)
   ========================================================================== */

.btn-pill-primary {
  background-color: var(--app-blue);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.btn-pill-primary:hover {
  background-color: var(--app-blue-dark);
  color: #fff;
}

.contact-card {
  background-color: #fff;
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.contact-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.contact-card-identity {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.contact-card-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0;
}

/* Variante agrandie pour la fiche détaillée d'un bénéficiaire */
.contact-card-name-lg {
  font-size: 1.05rem;
}

/* Astérisque des champs obligatoires */
.required-mark {
  color: var(--app-red);
}

.contact-card-email {
  font-size: 0.75rem;
  color: var(--app-text-muted);
  margin: 0;
}

.contact-card-delete {
  background-color: var(--app-red-light);
  color: var(--app-red);
  border: none;
  border-radius: 0.6rem;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.contact-card-delete:hover {
  background-color: var(--app-red);
  color: #fff;
}

.contact-card-info {
  border-top: 1px solid #f0f0f2;
  padding-top: 0.5rem;
  font-size: 0.82rem;
  color: #4a4c55;
}

.contact-card-info p {
  margin: 0.15rem 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.contact-card-info i {
  color: var(--app-text-muted);
}

/* ---- Lien vers la fiche détaillée d'un bénéficiaire ----
   La page /details n'était atteignable depuis aucun écran : la liste ne
   proposait que la suppression. */

.contact-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--app-blue-dark);
  text-decoration: none;
}

.contact-card-link:hover {
  text-decoration: underline;
}

/* Les cartes en grille s'étirent pour aligner leurs pieds */
.contact-grid .contact-card {
  display: flex;
  flex-direction: column;
}

.contact-grid .contact-card .contact-card-link {
  margin-top: auto;
  padding-top: 0.6rem;
}

/* ==========================================================================
   Page Paramètres
   ========================================================================== */

.settings-card {
  background-color: #fff;
  border-radius: 1rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.settings-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  color: inherit;
  text-decoration: none;
}

.settings-link:hover {
  background-color: #f7f8fa;
}

.settings-link + .settings-link {
  border-top: 1px solid #f0f0f2;
}

.settings-icon {
  width: 36px;
  height: 36px;
  border-radius: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.settings-icon-neutral {
  background-color: #eef0ff;
  color: #5b52d6;
}

.settings-icon-danger {
  background-color: var(--app-red-light);
  color: var(--app-red);
}

.settings-label {
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0;
}

.settings-chevron {
  margin-left: auto;
  color: var(--app-text-muted);
}

/* ==========================================================================
   Page Transfert (Nouveau transfert)
   ========================================================================== */

.form-label-sm {
  font-size: 0.8rem;
  color: var(--app-text-muted);
  margin-bottom: 0.4rem;
  display: block;
}

.app-select {
  width: 100%;
  border: 1px solid #e5e6eb;
  background-color: #f7f8fa;
  border-radius: 0.75rem;
  padding: 0.65rem 0.9rem;
  font-size: 0.92rem;
  color: var(--app-dark);
}

.amount-input-group {
  position: relative;
}

.amount-input-group input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e5e6eb;
  background-color: #fff;
  border-radius: 0.75rem;
  padding: 0.75rem 3.5rem 0.75rem 0.9rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--app-dark);
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Masque les flèches natives du spinner sur les champs number (Chrome/Safari/Edge) */
.amount-input-group input::-webkit-outer-spin-button,
.amount-input-group input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.amount-input-group .amount-suffix {
  position: absolute;
  right: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--app-text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  min-width: 2.4rem;
  text-align: right;
  pointer-events: none;
}


.currency-pills {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.currency-pill {
  flex: 1;
  text-align: center;
  padding: 0.45rem 0;
  border-radius: 999px;
  border: 1px solid #e5e6eb;
  background-color: #fff;
  color: var(--app-text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

.currency-pill.active {
  background-color: var(--app-dark);
  color: #fff;
  border-color: var(--app-dark);
}

.rate-divider {
  text-align: center;
  margin: 0.75rem 0;
}

.receive-card {
  background-color: var(--app-blue-light);
  border-radius: 0.75rem;
  padding: 0.75rem 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.9rem;
}

.receive-card .receive-value {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--app-blue-dark);
}

/* ---- Actions de l'écran de confirmation ----
   Les trois boutons avaient auparavant le même poids visuel (flex:1 chacun) :
   rien ne distinguait l'action primaire « Envoyer » d'« Annuler ». */

.confirmation-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.reception-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.reception-pill {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid #e5e6eb;
  background-color: #fff;
  color: var(--app-dark);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.reception-pill.active {
  background-color: var(--app-blue);
  border-color: var(--app-blue);
  color: #fff;
}

.btn-submit-primary {
  display: block;
  width: 100%;
  background-color: var(--app-blue);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.85rem;
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  text-decoration: none;
}

.btn-submit-primary:hover {
  background-color: var(--app-blue-dark);
  color: #fff;
}

.last-transfer-card {
  display: flex;
  align-items: center;
  background-color: #fff;
  border-radius: 1rem;
  padding: 0.75rem 0.9rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  margin-bottom: 0.65rem;
}

.last-transfer-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: var(--app-blue-light);
  color: var(--app-blue-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.75rem;
  flex-shrink: 0;
}

.last-transfer-body {
  flex: 1;
  min-width: 0;
}

.last-transfer-title {
  font-weight: 600;
  font-size: 0.88rem;
  margin: 0;
}

.last-transfer-date {
  font-size: 0.75rem;
  color: var(--app-text-muted);
  margin: 0;
}

.last-transfer-amount {
  font-weight: 700;
  font-size: 0.88rem;
  flex-shrink: 0;
}

/* ==========================================================================
   Pagination (historique des transferts)
   ========================================================================== */

.pagination-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 1rem 0 1.5rem 0;
  flex-wrap: wrap;
}

.pagination-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 0.5rem;
  border-radius: 0.6rem;
  border: 1px solid #e5e6eb;
  background-color: #fff;
  color: var(--app-dark);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.pagination-item.active {
  background-color: var(--app-blue);
  border-color: var(--app-blue);
  color: #fff;
}

.pagination-item.disabled {
  color: var(--app-text-muted);
  pointer-events: none;
  opacity: 0.5;
}

.pagination-item.pagination-text {
  min-width: auto;
  padding: 0 0.75rem;
  border: none;
  background: none;
  color: var(--app-blue-dark);
  font-weight: 700;
}

.pagination-item.pagination-text.disabled {
  color: var(--app-text-muted);
}

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  color: var(--app-text-muted);
  font-weight: 600;
}

/* ==========================================================================
   Page Historique (barre de recherche, stats, cartes de transfert)
   ========================================================================== */

.history-search-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.history-search-bar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #fff;
  border: 1px solid #e5e6eb;
  border-radius: 0.75rem;
  padding: 0.6rem 0.9rem;
}

.history-search-bar i {
  color: var(--app-text-muted);
}

.history-search-bar input {
  border: none;
  outline: none;
  flex: 1;
  font-size: 0.9rem;
  background: transparent;
  color: var(--app-dark);
}

.history-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 0.75rem;
  background-color: #fff;
  border: 1px solid #e5e6eb;
  color: var(--app-dark);
  flex-shrink: 0;
}

.history-stats-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.history-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background-color: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--app-dark);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.history-stat-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.history-stat-dot-warning {
  background-color: var(--app-orange);
}

.history-stat-dot-success {
  background-color: var(--app-success);
}




/* ==========================================================================
   Composants génériques réutilisables (formulaires, alertes, pages publiques)
   ========================================================================== */

.app-input,
input.app-input,
textarea.app-input {
  width: 100%;
  border: 1px solid #e5e6eb;
  background-color: #fff;
  border-radius: 0.75rem;
  padding: 0.65rem 0.9rem;
  font-size: 0.92rem;
  color: var(--app-dark);
}

.app-input:focus,
.app-select:focus {
  outline: none;
  border-color: var(--app-blue);
  box-shadow: 0 0 0 3px rgba(64, 123, 255, 0.12);
}

.app-form-group {
  margin-bottom: 1rem;
}

.app-alert {
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.app-alert-danger {
  background-color: var(--app-red-light);
  color: var(--app-red);
}

.app-alert-warning {
  background-color: var(--app-orange-light);
  color: #a9720c;
}

.app-alert-success {
  background-color: var(--app-success-light);
  color: var(--app-success-dark);
}

.btn-outline-app {
  display: block;
  width: 100%;
  background-color: #fff;
  color: var(--app-dark);
  border: 1px solid #e5e6eb;
  border-radius: 999px;
  padding: 0.8rem;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
  text-decoration: none;
}

.btn-outline-app:hover {
  background-color: #f7f8fa;
  color: var(--app-dark);
}

.btn-submit-red {
  display: block;
  width: 100%;
  background-color: var(--app-red);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.85rem;
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  text-decoration: none;
}

.btn-submit-red:hover {
  background-color: #c9433d;
  color: #fff;
}

.app-link-muted {
  color: var(--app-text-muted);
  font-size: 0.85rem;
  text-decoration: none;
}

.app-link-primary {
  color: var(--app-blue-dark);
  font-weight: 600;
  text-decoration: none;
}

/* ==========================================================================
   Contenu éditorial long (politique de confidentialité)
   Ces classes étaient utilisées par privacy.html sans être définies nulle part :
   les 10 sections juridiques s'affichaient sans séparation ni hiérarchie.
   ========================================================================== */

.privacy-section {
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #f0f0f2;
}

.privacy-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0.5rem;
  padding-bottom: 0;
}

.privacy-section h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--app-dark);
  margin: 0 0 0.5rem 0;
}

.privacy-section h3 {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--app-dark);
  margin: 0.9rem 0 0.35rem 0;
}

.privacy-section p {
  font-size: 0.88rem;
  line-height: 1.55;
  color: #4a4c55;
  margin: 0 0 0.6rem 0;
}

.privacy-section ul {
  margin: 0 0 0.6rem 0;
  padding-left: 1.1rem;
}

.privacy-section li {
  font-size: 0.88rem;
  line-height: 1.55;
  color: #4a4c55;
  margin-bottom: 0.3rem;
}

.privacy-section a {
  color: var(--app-blue-dark);
  text-decoration: none;
  font-weight: 600;
}

.privacy-section a:hover {
  text-decoration: underline;
}

.lead {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--app-dark);
}

/* ==========================================================================
   Pages publiques (login, register, mot de passe oublié, confidentialité...)
   ========================================================================== */

.public-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background-color: var(--app-grey-bg);
}

.public-header {
  background-color: var(--app-dark);
  color: #fff;
  padding: 2rem 1.5rem 2.5rem 1.5rem;
  text-align: center;
  border-bottom-left-radius: 1.5rem;
  border-bottom-right-radius: 1.5rem;
}

.public-header .brand {
  justify-content: center;
  margin-bottom: 0.75rem;
}

/* Le bandeau public est centré et plus aéré : la marque y est un peu plus grande */
.public-header .logo-emadex--compact {
  font-size: 1.2rem;
}

.public-header .brand-logo {
  width: 38px;
  height: 38px;
  font-size: 1.15rem;
}

.public-header .brand-name {
  font-size: 1.1rem;
}

.public-header-subtitle {
  margin: 0.35rem 0 0 0;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.75);
}

.public-content {
  padding: 1.25rem 1.25rem 2rem 1.25rem;
}

/* ---- Liste d'arguments produit (page de connexion) ---- */

.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: #4a4c55;
  padding: 0.35rem 0;
}

.feature-list li + li {
  border-top: 1px solid #f0f0f2;
}

.feature-list i {
  color: var(--app-blue-dark);
  font-size: 1rem;
  flex-shrink: 0;
}

/* ---- Pied de page des écrans publics (remplace footer.html + Bootstrap) ---- */

.public-footer-links {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 0.5rem;
}

.public-footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--app-text-muted);
  font-size: 0.82rem;
  text-decoration: none;
}

.public-footer-links a:hover {
  color: var(--app-blue-dark);
}

.public-footer-note {
  margin: 0.6rem 0 0 0;
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--app-text-muted);
}

.public-footer-note a {
  color: var(--app-text-muted);
  text-decoration: underline;
}

/* ---- Mise en page en deux colonnes (illustration + formulaire) ----
   L'illustration est masquée sur mobile : elle n'apparaît qu'à partir de
   992px, où la carte passe en mode large (.public-shell.wide). */

.public-split-visual {
  display: none;
}

.public-split-form > .app-card:first-child,
.public-split-form > .app-alert:first-child {
  margin-top: 0;
}

@media (min-width: 992px) {
  body.app-body.public-body {
    display: block;
  }

  .public-shell {
    max-width: 480px;
    margin: 2.5rem auto;
    border-radius: 1.5rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
  }

  .public-shell.wide {
    max-width: 860px;
  }

  /* Deux colonnes : illustration à gauche, formulaire à droite */
  .public-shell.wide .public-split {
    display: flex;
    align-items: center;
    gap: 2rem;
  }

  .public-shell.wide .public-split-visual {
    display: block;
    flex: 1 1 45%;
    min-width: 0;
  }

  .public-shell.wide .public-split-visual img {
    display: block;
    width: 100%;
    height: auto;
  }

  .public-shell.wide .public-split-form {
    flex: 1 1 55%;
    min-width: 0;
  }
}

/* ==========================================================================
   Utilitaires locaux
   Bootstrap CSS n'est plus chargé (seules les icônes le sont), or les templates
   utilisent encore ces classes utilitaires. On les redéfinit ici pour éviter
   des marges / couleurs / tailles de texte sans effet.
   ========================================================================== */

.d-block {
  display: block;
}

/* ---- Flexbox (remplace les utilitaires Bootstrap du même nom) ---- */

.d-flex {
  display: flex;
}

.d-grid {
  display: grid;
}

.d-inline-block {
  display: inline-block;
}

.flex-column {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-fill {
  flex: 1;
}

.justify-content-between {
  justify-content: space-between;
}

.justify-content-center {
  justify-content: center;
}

.justify-content-end {
  justify-content: flex-end;
}

.align-items-center {
  align-items: center;
}

.align-items-start {
  align-items: flex-start;
}

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }

/* ---- Grille légère : les templates utilisent .row + .col-6 pour placer deux
   champs côte à côte (register.html : Nom/Prénom, confirmation.html :
   Date/Transaction No.). Sans Bootstrap ces blocs s'empilaient. ---- */

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.row > .col-6 {
  flex: 1 1 0;
  min-width: 0;
}

/* ---- Alignement du texte ---- */

.text-center { text-align: center; }
.text-start  { text-align: left; }
.text-end    { text-align: right; }

/* ---- Cases à cocher (delete_account.html) ---- */

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.form-check-input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0.15rem 0 0 0;
  flex-shrink: 0;
  accent-color: var(--app-blue);
  cursor: pointer;
}

.form-check-label {
  margin: 0;
  cursor: pointer;
  line-height: 1.4;
}

/* ---- Titres de carte : remplace les style="font-weight:700" répétés et
   les h4/h5 non stylés des templates. ---- */

.card-title {
  font-weight: 700;
  font-size: 1rem;
  margin: 0 0 0.5rem 0;
  color: var(--app-dark);
}

/* ---- Décoration de texte ---- */

.text-decoration-none {
  text-decoration: none;
}

.text-decoration-underline {
  text-decoration: underline;
}

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }

.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }

.small {
  font-size: 0.8rem;
}

.text-muted {
  color: var(--app-text-muted) !important;
}

.text-secondary {
  color: var(--app-text-muted) !important;
}

.text-danger {
  color: var(--app-red) !important;
}

.text-success {
  color: var(--app-success-dark) !important;
}

.text-black {
  color: var(--app-dark) !important;
}

/* ---- États de validation ---- */

.error-message {
  display: block;
  font-size: 0.78rem;
  color: var(--app-red);
}

.app-input.is-invalid,
.amount-input-group input.is-invalid {
  border-color: var(--app-red);
  box-shadow: 0 0 0 3px rgba(224, 85, 79, 0.12);
}

.app-input.is-valid,
.amount-input-group input.is-valid {
  border-color: var(--app-blue);
  box-shadow: 0 0 0 3px rgba(64, 123, 255, 0.12);
}

/* ---- Boutons désactivés ---- */

.btn-submit-primary:disabled,
.btn-submit-primary[disabled],
.btn-submit-red:disabled,
.btn-submit-red[disabled] {
  background-color: #c9cbd2;
  color: #fff;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-submit-primary:disabled:hover,
.btn-submit-primary[disabled]:hover,
.btn-submit-red:disabled:hover,
.btn-submit-red[disabled]:hover {
  background-color: #c9cbd2;
}

/* ---- Détails dynamiques du transfert (partiel HTMX) ---- */
/* Rendu à l'intérieur de la carte du formulaire : pas de fond/ombre imbriqués. */

.details-rows {
  border: 1px solid #eceef2;
  border-radius: 0.75rem;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.9rem;
}

.details-row-label {
  margin: 0 0 0.15rem 0;
  font-size: 0.78rem;
  color: var(--app-text-muted);
}

.details-row-value {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--app-dark);
}

.details-row-value + .details-row-label {
  margin-top: 0.6rem;
}

/* Réserve la hauteur du bloc de détails pour éviter un saut de mise en page
   lors du premier chargement htmx. */
#details {
  min-height: 1px;
}

/* ---- Accessibilité des pills (focus clavier) ---- */

.currency-pill:focus-visible,
.reception-pill:focus-visible {
  outline: none;
  border-color: var(--app-blue);
  box-shadow: 0 0 0 3px rgba(64, 123, 255, 0.18);
}

/* ==========================================================================
   RESPONSIVE — Tablette & Desktop (WebApp)
   ==========================================================================
   Jusqu'ici l'application ne comportait qu'un seul media query, et il ne
   ciblait que les pages publiques. Les 11 écrans authentifiés restaient donc
   figés dans une colonne de 480px : sur un écran 1920px, cela laissait ~1440px
   de gris vide, et la barre d'onglets mobile flottait au milieu du bas de la
   fenêtre.

   Ces règles n'exigent AUCUNE modification du HTML : elles s'appuient sur le
   shell (.app-shell) partagé par toutes les pages, ce qui livre le desktop des
   11 écrans d'un seul geste.
   ========================================================================== */

/* ---- Tablette : ≥ 768px ----
   On élargit le shell et on met à profit la largeur pour les grilles de cartes. */

@media (min-width: 768px) {
  .app-shell {
    max-width: 720px;
    margin: 1.5rem auto;
    min-height: calc(100vh - 3rem);
    border-radius: 1.25rem;
    overflow: hidden;
  }

  .mobile-header {
    padding: 1.5rem 1.75rem 1.75rem 1.75rem;
  }

  .mobile-header-title {
    font-size: 1.6rem;
  }

  .app-content {
    padding: 1.5rem 1.75rem 0 1.75rem;
  }

  /* La liste des bénéficiaires passe en deux colonnes */
  .contact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .contact-grid .contact-card {
    margin-bottom: 0;
  }
}

/* ---- Desktop : ≥ 992px ----
   La navigation quitte le bas de l'écran pour devenir une barre latérale : c'est
   la convention attendue sur desktop, et cela supprime la barre d'onglets
   mobile qui flottait au milieu de la fenêtre. */

@media (min-width: 992px) {
  body.app-body {
    /* Compense la barre latérale fixe de 240px */
    padding-left: 240px;
  }

  .app-shell {
    max-width: 1080px;
    margin: 2rem auto;
    min-height: calc(100vh - 4rem);
    padding-bottom: 2rem; /* plus besoin de réserver la place du nav du bas */
  }

  /* --- Navigation latérale --- */
  .bottom-nav {
    top: 0;
    bottom: 0;
    left: 0;
    transform: none;
    width: 240px;
    max-width: 240px;
    height: 100vh;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.25rem;
    padding: 1.5rem 0.75rem;
    border-top: none;
    border-right: 1px solid #ececef;
  }

  .bottom-nav-item {
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: flex-start;
    gap: 0.75rem;
    width: 100%;
    padding: 0.7rem 0.9rem;
    border-radius: 0.65rem;
    font-size: 0.9rem;
    font-weight: 600;
  }

  .bottom-nav-item:hover {
    background-color: #f7f8fa;
  }

  .bottom-nav-item.active {
    background-color: var(--app-blue-light);
    color: var(--app-blue-dark);
  }

  .bottom-nav-item i {
    font-size: 1.15rem;
  }

  /* --- Grilles de contenu --- */

  /* Accueil : les actions rapides et les statistiques respirent */
  .stats-row,
  .action-row {
    gap: 1rem;
  }

  /* Liste des bénéficiaires : trois colonnes */
  .contact-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }

  /* Écrans à deux volets : formulaire à gauche, contexte sticky à droite.
     Les templates concernés portent la classe .app-content-split. */
  .app-content-split {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 1.5rem;
    align-items: start;
  }

  .app-content-split > .split-main {
    min-width: 0;
  }

  .app-content-split > .split-aside {
    position: sticky;
    top: 2rem;
  }

  /* Le titre de section reste lisible sur une largeur confortable */
  .privacy-section p,
  .privacy-section li {
    max-width: 70ch;
  }
}

/* ---- Grands écrans : ≥ 1400px ---- */

@media (min-width: 1400px) {
  .app-shell {
    max-width: 1180px;
  }
}

/* ---- Respect des préférences d'accessibilité ---- */

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}



