/* ===== VARIABLES CSS (CRVS Brand) ===== */
:root {
  /* Brand primary (Rouge foncé) */
  --primary-color: #AE0F0A;                 /* Rouge foncé */
  --primary-hover: #8F0C07;                 /* Rouge foncé - hover */
  --primary-soft: #EA9477;                  /* Rouge clair (accents/fonds) */
  --primary-focus: rgba(0, 128, 135, 0.25); /* Focus ring turquoise */

  /* Neutres */
  --text-muted: #6c757d;
  --neutral-black: #000000;                 /* Noir */
  --border-color: #B2B2B2;                  /* Mittelgrau (borders) */
  --mittelgrau: #B2B2B2;                    /* Mittelgrau */
  --bg-light: #f8f9fa;                      /* Fond clair générique */
  --bg-white: #FFFFFF;                      /* Blanc */

  /* Secondaires (remplacement du bleu) */
  --tq-dark: #006C73;       /* Turquoise foncé */
  --tq: #008087;            /* Turquoise */
  --tq-light: #C5E7E8;      /* Turquoise clair */
  --yellow-light: #FFECAD;  /* Jaune clair */
  --pink: #FFDCCF;          /* Rose */

  /* Ombres */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
}

/* ===== TYPOGRAPHIE: Gibson (avec fallbacks) ===== */
/* Placez les fichiers dans /static/fonts/ et ajustez si nécessaire */
@font-face {
  font-family: "Gibson";
  src: url("../fonts/Gibson.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Gibson";
  src: url("../fonts/Gibson-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Gibson";
  src: url("../fonts/Gibson-Semibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Gibson";
  src: url("../fonts/Gibson-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ===== STYLES GLOBAUX ===== */
body {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  min-height: 100vh;
  font-family: Gibson, "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--neutral-black);
}

.bg-dark-red {
  background-color: var(--primary-color);
  color: #fff !important;
}

/* Brand color utilities for statuses */
.text-dark-red { color: var(--primary-color) !important; }
.text-light-red { color: var(--primary-soft) !important; }
.bg-light-red { background-color: var(--primary-soft) !important; color: var(--neutral-black) !important; }
.border-dark-red { border-color: var(--primary-color) !important; }

/* ===== BOUTONS PERSONNALISÉS ===== */
.btn-dark-red {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

.btn-dark-red:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
}

.btn-dark-red:focus {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.25rem var(--primary-focus);
  color: #fff;
}

.btn-dark-red:active {
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  color: #fff;
}

.btn-dark-red:disabled {
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===== HEADER COMMUN ===== */
.app-header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  transition: transform 0.3s ease-in-out;
}

.app-header.header-hidden {
  transform: translateY(-100%);
}

/* Offset fixe pour compenser le header fixe - pas de changement dynamique */
body {
  padding-top: 92px; /* Toujours présent pour éviter les layouts shifts */
}

/* Masquer l'offset sur les pages sans header (auth, etc.) */
body.no-header {
  padding-top: 0;
}

.app-header .logo {
  height: 60px;
  width: auto;
  min-width: 120px;
  max-width: 200px;
}

.language-switcher a.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

/* Liens (remplacement du bleu) */
a, .link {
  color: var(--tq);
}
a:hover, .link:hover {
  color: var(--tq-dark);
}

/* Alignement des boutons de langue avec le hamburger */
.language-switcher .btn {
  height: 38px; /* Même hauteur que le bouton hamburger */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
}

/* S'assurer que le hamburger a la même hauteur */
.app-header .btn-sm {
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
}

/* ===== MENU MOBILE ===== */
#mobileMenu {
  border-top: 1px solid var(--border-color);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#mobileMenu .btn {
  text-align: left;
  border-radius: 0.375rem;
  margin-bottom: 0.5rem;
}

#mobileMenu .btn:last-child {
  margin-bottom: 0;
}

/* Animation pour le menu hamburger */
.hamburger-btn {
  transition: transform 0.2s ease;
}

.hamburger-btn:hover {
  transform: scale(1.05);
}

/* Responsive: masquer le menu mobile sur desktop */
@media (min-width: 768px) {
  #mobileMenu {
    display: none !important;
  }
}

/* ===== CONTENEURS ===== */
.form-container {
  max-width: 600px;
  margin: 2rem auto;
  box-shadow: var(--shadow-lg);
  border-radius: 10px;
  background-color: var(--bg-white);
  padding: 2rem;
}

.container-centered {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== CARTES ===== */
.card-hover {
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ===== BADGES DE STATUT ===== */
.status-badge {
  font-size: 0.8rem;
  padding: 0.3rem 0.6rem;
}

.draft-badge {
  background: #ffc107;
  color: #000;
}

.submitted-badge {
  background: var(--primary-color);
  color: #fff;
}

/* ===== AUTHENTIFICATION ===== */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.auth-card {
  background: var(--bg-white);
  border-radius: 15px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  max-width: 450px;
  width: 100%;
}

.auth-header {
  background: var(--primary-color);
  color: #fff;
  padding: 2rem;
  text-align: center;
}

.auth-header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.auth-header p {
  margin: 0.5rem 0 0 0;
  opacity: 0.9;
  font-size: 0.9rem;
}

.auth-body {
  padding: 2rem;
}

/* ===== CHAMPS DE SAISIE SPÉCIAUX ===== */
.code-input {
  font-size: 2rem;
  text-align: center;
  letter-spacing: 0.5rem;
  font-weight: bold;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  border-radius: 10px;
}

.code-input:focus {
  box-shadow: 0 0 0 0.25rem var(--primary-focus);
}

/* ===== COMPOSANTS DASHBOARD ===== */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.action-buttons {
  gap: 0.5rem;
}

.nav-tabs .nav-link.active {
  color: var(--primary-color);
  border-color: var(--primary-color) var(--primary-color) #fff;
}

.nav-tabs .nav-link:hover {
  border-color: var(--primary-color);
}

/* ===== TIMER ET AFFICHAGES SPÉCIAUX ===== */
.email-display {
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.timer {
  background: var(--yellow-light);
  border: 1px solid #f6dfa0;
  border-radius: 8px;
  padding: 0.75rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.timer.expired {
  background: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

/* ===== TITRES DE FORMULAIRE ===== */
.form-page h4,
.form-container h4 {
  color: var(--primary-color);
  font-weight: 600;
  border-left: 4px solid var(--primary-color);
  padding-left: 12px;
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
}

.form-page h6,
.form-container h6 {
  color: var(--primary-color);
  font-weight: 600;
  border-left: 3px solid var(--primary-color);
  padding-left: 10px;
  margin-bottom: 15px;
  font-size: 1.1rem;
}

/* ===== FORMULAIRES ===== */
.form-page {
  display: none;
}

.form-page.active {
  display: block;
}

.progress {
  height: 10px;
  margin-bottom: 20px;
}


/* ===== BOUTON OUTLINE DARK-RED ===== */
.btn-outline-dark-red {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background-color: transparent;
}

.btn-outline-dark-red:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

.btn-outline-dark-red:focus {
  box-shadow: 0 0 0 0.25rem var(--primary-focus);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-outline-dark-red:active {
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  color: #fff !important;
}

/* ===== UTILITAIRES DE FONDS SECONDAIRES ===== */
.bg-tq-dark { background-color: var(--tq-dark) !important; color: #fff !important; }
.bg-tq { background-color: var(--tq) !important; color: #fff !important; }
.bg-tq-light { background-color: var(--tq-light) !important; color: var(--neutral-black) !important; }
.bg-soft-primary { background-color: var(--primary-soft) !important; color: var(--neutral-black) !important; }
.text-tq { color: var(--tq) !important; }
.text-primary-soft { color: var(--primary-soft) !important; }

/* ===== ÉTATS / COMPOSANTS D'ALERTE ADAPTÉS ===== */
.alert-soft-primary { background-color: var(--primary-soft); color: var(--neutral-black); border: 1px solid #e38f74; }
.alert-tq-light { background-color: var(--tq-light); color: var(--neutral-black); border: 1px solid #b6d9da; }

/* ===== NAVIGATION BUTTONS AMÉLIORÉE ===== */
.navigation-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

/* Animation pour le bouton save */
#saveBtn.saving {
  pointer-events: none;
}


.time-select-container {
  display: flex;
  gap: 5px;
}

.status-radios {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.status-radios .form-check {
  margin: 0;
}

/* ===== AUTOCOMPLÉTION D'ADRESSES ===== */
.autocomplete-container {
  position: relative;
  width: 100%;
}

.autocomplete-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ced4da;
  border-top: none;
  border-radius: 0 0 0.25rem 0.25rem;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  box-shadow: var(--shadow-sm);
}

.autocomplete-suggestion {
  padding: 10px 15px;
  cursor: pointer;
  border-bottom: 1px solid #f1f1f1;
  font-size: 14px;
}

.autocomplete-suggestion:hover {
  background-color: var(--bg-light);
}

.autocomplete-suggestion.selected {
  background-color: #e9ecef;
}

.autocomplete-suggestion:last-child {
  border-bottom: none;
}

/* Style pour les suggestions d'adresse */
.suggestion-main {
  font-weight: 600;
  color: var(--neutral-black);
  margin-bottom: 2px;
}

.suggestion-secondary {
  font-size: 12px;
  color: var(--text-muted);
}

.loading-spinner {
  padding: 10px 15px;
  text-align: center;
  font-style: italic;
  color: var(--text-muted);
}

.no-results {
  padding: 12px 15px;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.6;
}

.no-results .fas {
  color: var(--tq);
  margin-right: 5px;
}

.no-results small {
  display: block;
  margin-top: 5px;
  font-size: 11px;
}

.auto-filled {
  background-color: var(--bg-light) !important;
  color: var(--text-muted);
}

/* ===== GROUPES D'ADRESSES ET TRAJETS ===== */
.address-group {
  border: none;
  border-radius: 0;
  padding: 0 0 20px 0;
  margin-bottom: 20px;
  background-color: transparent;
  border-bottom: 1px solid var(--border-color);
}

.travel-options {
  background-color: transparent;
  border: none;
  border-radius: 0;
  padding: 0 0 20px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.travel-option {
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  padding: 10px;
  margin-bottom: 10px;
  transition: background-color 0.2s;
  background-color: var(--bg-white);
}

.travel-option:hover {
  background-color: var(--bg-light);
}

.travel-option input[type="radio"]:checked + label {
  font-weight: bold;
  color: var(--primary-color);
}

.beneficiary-info-display {
  background-color: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  padding: 12px 15px;
  color: #495057;
  font-size: 14px;
}

.beneficiary-info-display i {
  color: var(--text-muted);
  margin-right: 8px;
}

/* ===== SECTION FRAIS (EXPENSES) ===== */
.expense-upload {
  margin-top: 1rem;
}

.expense-item {
  background-color: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: 1.5rem;
  transition: all 0.2s ease;
}

.expense-item:hover {
  box-shadow: none;
}

/* Bootstrap native file input - pas de customisation complexe nécessaire */
.expense-item input[type="file"] {
  cursor: pointer;
}

/* Style minimal pour le bouton du file input - approche Bootstrap */
.expense-item input[type="file"]::-webkit-file-upload-button {
  cursor: pointer;
  background-color: #6c757d;
  color: white;
  border: none;
  padding: 0.375rem 0.75rem;
  margin-right: 0.75rem;
  border-radius: 0.375rem;
  transition: background-color 0.15s ease-in-out;
}

.expense-item input[type="file"]::-webkit-file-upload-button:hover {
  background-color: #5a6268;
}

/* Firefox */
.expense-item input[type="file"]::file-selector-button {
  cursor: pointer;
  background-color: #6c757d;
  color: white;
  border: none;
  padding: 0.375rem 0.75rem;
  margin-right: 0.75rem;
  border-radius: 0.375rem;
  transition: background-color 0.15s ease-in-out;
}

.expense-item input[type="file"]::file-selector-button:hover {
  background-color: #5a6268;
}

/* Alignement des hauteurs pour type et montant */
.expense-item .form-select,
.expense-item input[type="number"] {
  height: calc(2.5rem + 2px);
}

/* Style cohérent pour les labels */
.expense-item .form-label {
  font-weight: 500;
  color: var(--neutral-black);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

/* Boutons d'action */
.expense-item .btn-dark-red,
.expense-item .btn-danger {
  height: calc(2.5rem + 2px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

/* ===== BOUTON QUITTER ===== */
.quit-button-container {
  position: sticky;
  top: 0;
  z-index: 1020;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.quit-button {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  width: auto;
}

.quit-button:hover {
  background: var(--bg-light);
  
}

/* ===== FOOTER ===== */
.app-footer {
  background: var(--primary-color);
  color: white;
  text-align: center;
  padding: 1rem;
  margin-top: auto;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 576px) {
  body {
    font-size: 14px;
    /* Fond uniforme en mode téléphone */
    background: #ffffff;
    /* Padding mobile ajusté */
    padding-top: 82px; /* Moins d'espace sur mobile */
  }

  .app-header .logo {
    height: 50px;
    min-width: 100px;
    max-width: 150px;
  }
  
  .form-container {
    box-shadow: none;
    margin: 0;               /* Suppression des marges latérales */
    padding: 1rem 1rem 2rem;  /* Un peu d'air interne */
    border-radius: 0;         /* Suppression des arrondis */
    max-width: 100%;
    width: 100%;
    background: #ffffff;      /* Fond blanc pleine largeur */
  }
  
  .auth-container {
    padding: 0.5rem;
  }
  
  .language-switcher {
    position: static;
    margin-top: 1rem;
  }

  /* Amélioration des boutons de navigation mobile */
  .navigation-buttons {
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
  }
  
  .navigation-buttons .btn {
    width: 100%;
    min-height: 48px;
    font-size: 16px;
    padding: 12px 20px;
  }

  .navigation-buttons .ms-auto {
    margin-left: 0 !important;
    width: 100%;
  }

  .navigation-buttons .d-flex {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  /* Bouton quitter mobile */
  .quit-button {
    font-size: 14px;
    padding: 8px 12px;
    min-height: 40px;
  }

  .quit-button-container {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: transparent;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
  }

  /* Formulaire mobile */
  .form-page h4,
  .form-container h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-weight: 600;
    border-left: 3px solid var(--primary-color);
    padding-left: 8px;
  }

  .form-page h6,
  .form-container h6 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--primary-color);
    font-weight: 600;
    border-left: 3px solid var(--primary-color);
    padding-left: 8px;
  }

  /* Amélioration des colonnes pour mobile */
  .row .col-6:first-child {
    margin-bottom: 0; /* Supprimé car on gère avec mb-3 mb-md-0 */
  }

  .row .col-4,
  .row .col-6,
  .row .col-8,
  .row .col-12 {
    padding-left: 5px;
    padding-right: 5px;
  }

  /* Maintenir côte à côte pour Date et KM sur mobile */
  .row .col-12.col-md-6 {
    flex: 0 0 50% !important;
    max-width: 50% !important;
    padding-left: 5px;
    padding-right: 5px;
  }

  /* Exception pour les champs qui doivent être en pleine largeur sur mobile */
  .row .col-12.col-md-6.mobile-full-width {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    margin-bottom: 15px;
  }
  
  /* Espacement optimisé pour 2 champs par ligne sur mobile */
  @media (max-width: 576px) {
    .col-6 {
      padding-left: 4px;
      padding-right: 4px;
    }
    
    .col-6:first-child {
      padding-left: 15px;
    }
    
    .col-6:last-child {
      padding-right: 15px;
    }
    
    .form-label {
      font-size: 0.85rem;
      margin-bottom: 4px;
    }
    
    .form-control, .form-control-plaintext {
      font-size: 0.9rem;
      padding: 6px 8px;
    }
  }
  
  /* Alignement cohérent pour tous les champs en col-6 */
  .row .col-6 {
    display: flex;
    flex-direction: column;
  }
  
  .row .col-6 .form-control,
  .row .col-6 .form-control-plaintext {
    height: auto;
    min-height: 38px;
  }
  
  /* Alignement cohérent pour tous les champs du formulaire */
  @media (max-width: 576px) {
    .form-page .row [class*="col-"] {
      padding-left: 4px;
      padding-right: 4px;
    }
    
    .form-page .row [class*="col-"]:first-child {
      padding-left: 15px;
    }
    
    .form-page .row [class*="col-"]:last-child {
      padding-right: 15px;
    }
    
    /* Exception pour les champs uniques (col-12) qui doivent conserver l'alignement standard */
    .form-page .row .col-12:only-child {
      padding-left: 15px;
      padding-right: 15px;
    }
  }

  /* Groupes d'adresses mobile */
  .address-group {
    padding: 0 0 15px 0;
    margin-bottom: 15px;
    border-radius: 0;
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
  }

  .travel-options {
    padding: 0 0 15px 0;
    margin-bottom: 15px;
    border-radius: 0;
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
  }

  .travel-option {
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 8px;
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
  }

  /* Labels et champs mobile */
  .form-label {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 5px;
  }

  .form-control {
    font-size: 16px; /* Évite le zoom automatique sur iOS */
    padding: 12px;
    min-height: 48px;
    border-radius: 8px;
  }

  .form-check-input {
    transform: scale(1.3);
    margin-right: 12px;
    margin-top: 2px;
  }

  .form-check-label {
    font-size: 0.9rem;
    line-height: 1.4;
    padding-left: 5px;
  }

  .form-check {
    margin-bottom: 15px;
  }

  /* Email input container mobile */
  /* Supprimé - plus nécessaire car affichage email complet direct */

  /* Autocomplétion mobile */
  .autocomplete-suggestions {
    max-height: 180px;
    font-size: 0.9rem;
    border-radius: 0 0 8px 8px;
  }

  .autocomplete-suggestion {
    padding: 15px 12px;
    line-height: 1.3;
    border-bottom: 1px solid #f0f0f0;
  }

  .autocomplete-suggestion:hover,
  .autocomplete-suggestion.selected {
    background-color: #f8f9fa;
  }

  /* Progress bar mobile */
  .progress {
    height: 8px;
    margin-bottom: 15px;
    border-radius: 4px;
  }

  /* Boutons d'action sur les frais */
  .expense-item .btn {
    width: 100%;
    min-height: 44px;
  }
  
  /* Amélioration mobile pour expense items */
  .expense-item {
    padding: 0;
    margin-bottom: 1.5rem;
  }
  
  .expense-item .row.mb-2 {
    margin-bottom: 0.75rem !important;
  }
  
  .expense-item .form-label {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
  }
  
  /* Input file mobile - laisser Bootstrap gérer la hauteur naturellement */
  .expense-item input[type="file"] {
    font-size: 14px;
  }
  
  .expense-item input[type="file"]::-webkit-file-upload-button {
    padding: 0.5rem 0.75rem;
    font-size: 14px;
  }
  
  .expense-item input[type="file"]::file-selector-button {
    padding: 0.5rem 0.75rem;
    font-size: 14px;
  }

  /* Exception: le bouton Suivant ne doit pas être pleine largeur */
  .navigation-buttons #nextBtn {
    width: auto;
    min-width: 160px;
    align-self: flex-end; /* se place à droite dans la colonne */
  }

  /* Mode inline spécifique (page 2) pour avoir Précédent gauche / Soumettre droite */
  .navigation-buttons.nav-inline-mobile {
    flex-direction: row;
    align-items: stretch;
  }
  .navigation-buttons.nav-inline-mobile .btn {
    width: auto;
    min-height: 44px;
  }
  .navigation-buttons.nav-inline-mobile #prevBtn {
    align-self: flex-start;
    min-width: 140px;
  }
  .navigation-buttons.nav-inline-mobile .ms-auto {
    margin-left: auto !important;
    display: flex;
    gap: 10px;
  }
  .navigation-buttons.nav-inline-mobile #submitBtn {
    min-width: 160px;
  }

  /* Affichage des informations bénéficiaire */
  .beneficiary-info-display {
    padding: 12px 15px;
    font-size: 0.9rem;
    line-height: 1.4;
    border-radius: 8px;
  }

  /* Container des frais mobile */
  .expense-upload .row {
    margin-bottom: 15px;
  }

  .expense-upload .col-12 {
    margin-bottom: 10px;
  }

  /* États d'affichage texte */
  .form-control-plaintext {
    font-size: 0.9rem;
    padding: 12px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-height: 48px;
    display: flex;
    align-items: center;
  }

  /* Amélioration des options de trajet mobile */
  .travel-option {
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    transition: all 0.2s ease;
  }

  .travel-option:has(input:checked) {
    border-color: var(--primary-color);
    background: rgba(195, 7, 7, 0.05);
  }

  /* Amélioration des champs de fichier */
  input[type="file"] {
    padding: 8px !important;
    font-size: 14px !important;
  }

  /* Texte d'aide et erreurs */
  .form-text {
    font-size: 0.8rem;
    margin-top: 5px;
  }

}

/* Ajout pour les écrans moyens (tablettes) */
@media (min-width: 577px) and (max-width: 768px) {
  .form-container {
    margin: 1rem;
    padding: 1.5rem;
  }
  
  .navigation-buttons .btn {
    min-height: 44px;
    font-size: 15px;
  }
}

/* ===== SECTIONS PAR MOIS (DASHBOARD) ===== */
.month-section {
  transition: opacity 0.2s ease-in-out;
}

.month-section h3 {
  color: var(--primary-color);
  font-weight: 600;
  border-left: 4px solid var(--primary-color);
  padding-left: 12px;
  letter-spacing: 0.5px;
}

.month-section hr {
  border-color: #dee2e6;
  opacity: 0.5;
}

.month-section .badge {
  font-size: 0.75rem;
  font-weight: normal;
}

/* ===== CARTES BÉNÉFICIAIRES ===== */
.beneficiaries-title {
  color: var(--primary-color);
  font-weight: 600;
  position: relative;
}

.beneficiaries-title::before {
  content: '';
  position: absolute;
  left: -15px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 100%;
  background: var(--primary-color);
  border-radius: 2px;
}

/* Effet hover sur les cartes de bénéficiaires (admin dashboard) */
.beneficiary-card .card {
  transition: all 0.2s ease-in-out;
  cursor: pointer;
}

.beneficiary-card .card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.beneficiary-card .card-title {
  color: var(--primary-color);
  font-weight: 600;
}

.beneficiary-card .badge {
  font-size: 0.75rem;
  font-weight: 500;
}

.beneficiary-card .badge.bg-warning {
  background-color: #ffc107 !important;
  color: #212529 !important;
}

.beneficiary-card .badge.bg-success {
  background-color: #198754 !important;
}

/* Amélioration responsive pour les badges */
@media (max-width: 576px) {
  .beneficiary-card .d-flex.flex-wrap {
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem !important;
  }
  
  .beneficiary-card .badge {
    font-size: 0.7rem;
  }
}

/* ===== BADGES DE STATUT INTERVENTIONS ===== */
.badge.bg-warning {
  background-color: #ffc107 !important;
  color: #212529 !important;
  border: 1px solid #f0c040;
}

.badge.bg-success {
  background-color: #198754 !important;
  color: #fff !important;
}

.badge.bg-danger {
  background-color: #dc3545 !important;
  color: #fff !important;
}

.badge.bg-secondary {
  background-color: #6c757d !important;
  color: #fff !important;
}

/* ===== DÉTAILS D'INTERVENTION ===== */
.intervention-detail-card {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease-in-out;
}

.intervention-detail-card:hover {
  box-shadow: var(--shadow-md);
}

.info-group {
  padding: 0.75rem;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 3px solid var(--primary-color);
  min-height: 70px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.info-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
  display: block;
}

.info-value {
  font-size: 0.9rem;
  font-weight: 500;
  color: #212529;
  line-height: 1.4;
}

.info-value i {
  color: var(--primary-color);
  opacity: 0.8;
}

/* Responsive pour les détails */
@media (max-width: 768px) {
  .info-group {
    min-height: 60px;
    padding: 0.5rem;
  }
  
  .info-label {
    font-size: 0.7rem;
  }
  
  .info-value {
    font-size: 0.85rem;
  }
  
  .intervention-detail-card .card-title {
    font-size: 1rem;
  }
  
  .intervention-detail-card .row.g-3 {
    gap: 0.75rem !important;
  }
}

@media (max-width: 576px) {
  .info-group {
    min-height: 55px;
    padding: 0.4rem;
  }
  
  .info-label {
    font-size: 0.65rem;
    margin-bottom: 0.15rem;
  }
  
  .info-value {
    font-size: 0.8rem;
  }
}

/* Lien sans décoration pour les cartes */
a.text-decoration-none:hover {
  text-decoration: none !important;
}

/* Animation pour les cartes dans les sections de mois */
.month-section .timesheet-card {
  transition: all 0.2s ease-in-out;
}

.month-section .timesheet-card:hover {
  transform: translateY(-2px);
}

/* Responsive: ajustements pour mobile */
@media (max-width: 768px) {
  .month-section h3 {
    font-size: 1.1rem;
  }
  
  .month-section .badge {
    display: block;
    margin-top: 0.5rem;
    margin-left: 0;
  }
  
  .month-section .d-flex {
    flex-direction: column;
    align-items: start !important;
  }
  
  .month-section hr {
    width: 100%;
    margin-top: 0.5rem;
    margin-left: 0 !important;
  }
}

/* ===== FIXES POUR BOUTONS CÔTE À CÔTE SUR MOBILE ===== */
@media (max-width: 576px) {
  /* Règles très spécifiques pour surcharger Bootstrap */
  .card-footer .d-flex,
  .card .card-footer .d-flex {
    flex-wrap: nowrap !important; /* Empêche le retour à la ligne */
    flex-direction: row !important; /* Force en ligne horizontale */
    align-items: stretch !important; /* Assure que les boutons ont la même hauteur */
    gap: 4px !important; /* Espace réduit entre les boutons */
    justify-content: stretch !important;
  }
  
  /* Le bouton "Voir les détails" prend l'espace restant mais pas tout */
  .card-footer .btn.flex-grow-1,
  .card .card-footer .btn.flex-grow-1 {
    flex: 1 1 auto !important; /* Prend l'espace disponible */
    min-width: 0 !important; /* Permet la compression si nécessaire */
    max-width: calc(100% - 50px) !important; /* Laisse de la place pour le bouton poubelle */
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  /* Quand il n'y a pas de bouton delete, le bouton prend toute la largeur */
  .card-footer .d-flex:not(:has(.delete-intervention-btn)) .btn.flex-grow-1,
  .card .card-footer .d-flex:not(:has(.delete-intervention-btn)) .btn.flex-grow-1 {
    max-width: 100% !important;
  }
  
  /* Centrage des icônes dans les boutons */
  .card-footer .btn i,
  .card .card-footer .btn i {
    display: inline-flex !important;
    align-items: center !important;
    margin-right: 0.25rem !important;
  }
  
  /* Le bouton de suppression garde sa taille fixe */
  .card-footer .btn.flex-shrink-0,
  .card .card-footer .btn:not(.flex-grow-1),
  .card-footer .delete-intervention-btn {
    flex: 0 0 auto !important; /* Ne grandit pas, ne rétrécit pas */
    width: 42px !important; /* Taille fixe */
    min-width: 42px !important; /* Taille minimale pour l'accessibilité tactile */
    max-width: 42px !important; /* Taille maximale */
    padding: 0.375rem 0.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important; /* Centre l'icône poubelle */
  }
  
  /* S'assurer que les boutons restent en ligne */
  .card-footer .d-flex > * {
    display: inline-flex !important;
    float: none !important;
  }
}

/* ===== NOTES DE VALIDATION (REJETS) ===== */
.validation-notes-box {
  max-width: 350px;
  word-wrap: break-word;
  white-space: normal;
}

/* Alignement vertical des cellules du tableau pour les pages admin */
.timesheet-row td {
  vertical-align: top;
}



