/* style.css */
:root { --bleu: #0b4f8a; --bg: #f4f6f8; --bordure: #e1e5ea; --rouge:#980808; --orange:#ff9900;}
/* Empêche le débordement horizontal global de la page */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

* { box-sizing: border-box; }

body { 
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif; 
    margin: 0; 
    background: var(--bg); 
    color: #1c2733; 
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header { 
    background: var(--bleu); 
    color: #fff; 
    padding: 10px 32px; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    width: 100%;
}
header img {
    height: 100px; 
    max-width: 150px;
    width: auto;
    object-fit: contain;
	border: 1px solid;
  margin: 0px 5px;
  padding: 5px;
  box-shadow: 5px 5px 10px rgba(0, 0, 0, .5);
}
header h1 { margin: 0; font-size: 20px; font-weight: 600; }

/* Menu de navigation */
/* Menu de navigation */
nav { 
    background: #fff; 
    border-bottom: 1px solid var(--bordure); 
    padding: 0 32px; 
    display: flex; 
    gap: 20px; 
    width: 100%;
}

main {
    flex: 1;
    width: 100%;
    max-width: 1600px;
    margin: 24px auto;
    padding: 0 16px;
    box-sizing: border-box;
    min-width: 0; /* Empêche les éléments flexibles de dépasser de leur conteneur */
}

nav a { padding: 12px 0; text-decoration: none; color: var(--bleu); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; }
nav a:hover, nav a.active { border-bottom: 2px solid var(--bleu); }

/* Conteneur principal du tableau : gère proprement le scroll horizontal en interne */
.table-responsive {
    width: 100%;
    max-width: 100%; /* S'assure de ne jamais dépasser de main */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 16px;
}

.toolbar { display: flex; gap: 12px; margin-bottom: 16px; align-items: center; }
select, button { padding: 8px 12px; border-radius: 6px; border: 1px solid var(--bordure); font-size: 14px; }
/* Change la couleur du texte de l'option de chargement */

.en-chargement {
    color: white; 
    background-color: var(--orange);
}

.en-erreur {
	font-weight:bold;
    color: white; 
    background-color: var(--rouge); 
}

.logout { background: var(--rouge); color: #fff; border: none; cursor:pointer; text-decoration: none; border-radius: 6px; padding: 5px 12px; }
button { background: var(--bleu); color: #fff; border: none; cursor: pointer; }
button:hover { background: #093c6b; }

/* Force la table à occuper l'espace et empêche l'écrasement des colonnes */
table {
    width: 100%;
    min-width: 1250px; /* Force l'affichage confortable de toutes les colonnes sans les tasser */
    border-collapse: collapse;
    background: #fff;
    border-radius: 0; /* Géré par le conteneur parent .table-responsive */
    box-shadow: none;
}

th, td {
    padding: 5px 10px;
    text-align: left;
    border-bottom: 1px solid var(--bordure);
    font-size: 14px;
    white-space: nowrap; /* Empêche le texte de se briser et de déformer la structure des colonnes */
}

th {
    background: #eef2f6;
    font-weight: 600;
}

tr:hover td {
    background: #f9fbfd;
}

  .statut { padding: 3px 10px; border-radius: 12px; font-size: 10px; font-weight: 600; }
  .statut-DEPOSEE, .statut-EMISE { background: #e8f0fe; color: #1a56b0; }
  .statut-REJETEE, .statut-ABANDONNEE, .statut-REFUSEE_MOE,.statut-REJET_TECHNIQUE { background: #b3261e; color: white; }
  /* .statut-ERREUR_DE_MOE,.statut-ERREUR_DE_MOA { background: #ff8a7d;  color: white; } */
  [class*="ERREUR"] {
    background: #ff8a7d;
    color: white;
}
  .statut-A_ASSOCIER_MOE { background: orangered;color: white; }
  
  .statut-VALIDEE,.statut-VALIDER,.statut-MANDATEE,.statut-MISE_EN_PAIEMENT,.statut-MISE_A_DISPOSITION,.statut-A_ASSOCIER_MOA,.statut-TRANSMISE_MOA { background: #1e7a34; color: white; }
  
  .statut-SUSPENDUE {background: #b07d00;  color: white;}
  #info { color: #667; font-size: 13px; margin-top: 12px; }
  /* Boutons d'action dans le tableau */
/* Conteneur des actions : alignement horizontal forcé */
.actions-cell { 
    display: flex; 
    flex-direction: row; 
    gap: 6px; 
    align-items: center; 
    white-space: nowrap;
}

/* Style des boutons carrés avec les symboles */
.actions-cell { 
    display: flex; 
    flex-direction: row; 
    gap: 4px; 
    align-items: center; 
}

.btn-action { 
    width: 32px;
    height: 32px;
    padding: 6px; /* Espace autour du logo */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px; 
    cursor: pointer; 
    border: none; 
    transition: background 0.2s;
}

/* Force les images SVG à prendre toute la place disponible */
.btn-action img {
    width: 100%;
    height: 100%;
    pointer-events: none; /* Empêche l'image de bloquer le clic du bouton */
}

.btn-valider { background: #1e7a34; }
.btn-valider:hover { background: #155724; }

.btn-rejeter { background: #b3261e; }
.btn-rejeter:hover { background: #8a1c17; }

.btn-suspendre { background: #b07d00; }
.btn-suspendre:hover { background: #855e00; }

.btn-download { background: #0b4f8a; }
.btn-download:hover { background: #093c6b; }
.btn-nodownload { background: red; }

.btn-paiement { background: #8a0b88; }
.btn-paiement:hover { background: #6b0e69; }

.btn-decompte { background: #8a0b88; }
.btn-decompte:hover { background: #6b0e69; }

/* Bouton de retour en haut */
#btnRemonter {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    background: var(--bleu);
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: background 0.2s, transform 0.2s;
}

#btnRemonter:hover {
    background: #093c6b;
    transform: translateY(-2px);
}

#btnRemonter img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1); /* Rend l'icône blanche si c'est un SVG noir */
}
/* Design du pied de page */
footer {
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 20px 40px;
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: auto; /* Force le footer à se positionner tout en bas de la fenêtre */
}

/* Bloc de gauche */
.footer-left {
    flex: 1;
    display: flex;
    align-items: center;
}
.footer-left img {
    height: 50px;     /* Vous pouvez ajuster cette valeur (ex: 25px ou 35px) */
    max-width: 120px; /* Empêche un logo trop large de casser la mise en page */
    width: auto;      /* Conserve les proportions d'origine */
    object-fit: contain;
    margin-right: 10px;
	box-shadow: 5px 5px 10px rgba(0, 0, 0, .5);
}
/* Bloc du centre (Logo) */
.footer-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-center img {
    height: 100px; 
    max-width: 150px;
    width: auto;
    object-fit: contain;
	border: 1px solid;
  border-radius: 5px;
  padding: 5px;
  box-shadow: 5px 5px 10px rgba(0, 0, 0, .5);
}

/* Bloc de droite */
.footer-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
}

.footer-right a {
    color: #0056b3;
    text-decoration: none;
}

.footer-right a:hover {
    text-decoration: underline;
}

.badge-version {
    background: #e2e8f0;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    color: #4a5568;
}
/* Style pour indiquer que le texte est cliquable/éditable */
.editable {
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    transition: background 0.2s;
}
.editable:hover {
    background: #eef2f6;
    border: 1px dashed var(--bleu);
}

/* Style de l'input qui remplace le texte lors de l'édition */
.input-edition {
    width: 100%;
    padding: 4px 6px;
    font-size: 14px;
    border: 1px solid var(--bleu);
    border-radius: 4px;
    box-sizing: border-box;
    background: #fff;
}