table {
    table-layout: fixed;
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0; }

/* Règle générale pour toutes les cellules */
th, td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left; }

th {
    background-color: #3498db;
    color: white; }

tr:nth-child(even) { background-color: #f2f2f2; }

tr:hover { background-color: #e9f5ff; }

.table-facture th { text-align: center !important;}

.table-facture th:nth-child(1), .table-facture td:nth-child(1) { width: 15%;}
.table-facture th:nth-child(2), .table-facture td:nth-child(2) { width: 15%; text-align: center;}
.table-facture th:nth-child(3), .table-facture td:nth-child(3) { width: 15%; text-align: right;}
.table-facture th:nth-child(4), .table-facture td:nth-child(4) { width: 15%; text-align: right;}

/* Table-liste (spécifiquement pour la consultation) */
.table-liste {
    table-layout: auto;
}

/* Règle spécifique pour les titres de la table-liste */
.table-liste thead th {
    text-align: center !important;
    background-color: #3498db; /* Optionnel : pour bien les distinguer */
    color: white;
}

.table-liste th, .table-liste td {
    width: auto;
}

.table-liste th:nth-child(1), .table-liste td:nth-child(1) { width: 15%;}
.table-liste th:nth-child(2), .table-liste td:nth-child(2) { width: 15%;}
.table-liste th:nth-child(3), .table-liste td:nth-child(3) { width: 30%;}
.table-liste th:nth-child(4), .table-liste td:nth-child(4) { width: 15%; text-align: right;}
.table-liste th:nth-child(5), .table-liste td:nth-child(5) { width: 25%; text-align: center;}

.table-lignes th:nth-child(1), .table-lignes td:nth-child(1) { width: 45%; } /* Produit */
.table-lignes th:nth-child(2), .table-lignes td:nth-child(2) { width: 15%; text-align: right; }
.table-lignes th:nth-child(3), .table-lignes td:nth-child(3) { width: 20%; text-align: right; }
.table-lignes th:nth-child(4), .table-lignes td:nth-child(4) { width: 20%; text-align: right; }

.page-header {
    margin-top: -15px;
    margin-bottom: 25px;
    width: 100%;
}

.header {
    display: flex;
    justify-content: space-between; /* Aligne le logo à gauche et laisse de la place à droite */
    align-items: center;
    padding: 20px 0;
    border-bottom: 2px solid #eeeeee; /* Petite ligne discrète pour séparer l'entête */
    margin-bottom: 30px;
}

/* Style spécifique pour l'image du logo */
.header img {
    max-height: 80px; /* Évite que le logo ne devienne géant si tu changes d'image */
    width: auto;
    display: block;
}

.header-main {
    display: flex;
    align-items: center; /* Aligne le logo et le H1 sur la même ligne horizontale */
    margin-top: -15px;
    width: 100%
}

.page-header img {
    margin: 0;
}

.header-main h1 {
    flex: 1;
    text-align: center;
    margin: 0 125px 0 0;
    font-size: 2.2rem;
    color: #2c3e50;
    white-space: nowrap; /* Empêche le titre de se couper en deux */
}

.page-header h2 {
    display: block;
    min-width: 600px;
    width: fit-content;
    margin: 10px auto;  /* Centre le sous-titre avec sa ligne bleue */
    text-align: center;
    border-bottom: 3px solid #3498db;
    font-size: 1.1rem;
    font-weight: normal;
    color: #34495e;
    padding-bottom: 5px;
}

/* Affichage cellulaire */
@media (max-width: 480px) {
    .header-main {
        flex-direction: column;
        gap: 10px;
    }

    .header-main h1 {
        margin-right: 0;
        white-space: normal;
    }

    .page-header h2 {
        min-width: 90%;
    }
}

.form-container {
    display: flex; border: 1px solid #ccc; margin-bottom: 1rem;
    padding: 20px; border-radius: 8px; width: 80%; background: #f9f9f9; }

/* Structure de grille générique pour tous tes formulaires de type "b" */
.form-container.b .row-flex {
    display: grid;
    /* Aligne les colonnes : min 250px, s'adapte au mobile automatiquement */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    align-items: flex-end; /* Aligne les boîtes par le bas */
    width: 100%;
}

/* Uniformisation de TOUS les types de saisie (Texte, Date, Menu déroulant) */
.form-container.b input,
.form-container.b select,
.form-container.b textarea {
    width: 100%;
    height: 40px;
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

/* Cas particulier pour les zones de texte multi-lignes */
.form-container.b textarea {
    height: auto;
    min-height: 80px;
}

/* Style pour les champs verrouillés (ex: No Facture) */
.form-container.b input[readonly] {
    background-color: #f4f4f4;
    color: #666;
    border-style: dashed;
    cursor: not-allowed;
}

.form-container.b .form-group {
    display: flex;
    flex-direction: column;
}

.form-container.b label {
    font-weight: bold;
    margin-bottom: 5px;
    color: #2c3e50;
}

.A-container{ border: 1px solid #ccc; margin-bottom: 1rem;
    padding: 20px; border-radius: 8px; width: 60%; background: #f9f9f9; }

body {
    font-family: sans-serif; margin: 40px; line-height: 1.6;
}

.container {
    display: flex; gap: 20px; justify-content: space-around;
}

.pole {
    border: 1px solid #ccc; padding: 20px; border-radius: 8px; width: 30%; background: #f9f9f9;
}

h2 {
    color: #2c3e50; border-bottom: 2px solid #3498db;
}

ul {
    list-style: none; padding: 0;
}

li {
    margin: 10px 0;
}

a {
    text-decoration: none; color: #3498db; font-weight: bold;
}
.alerte {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}
.alerte-erreur {
    color: #a94442;
    background-color: #f2dede;
    border-color: #ebccd1;
}
.alerte-succes {
    color: #3c763d;
    background-color: #dff0d8;
    border-color: #d6e9c6;
}
.btn-enregistrer, .btn-retour, .btn-ajouter {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    height: 40px;        /* Force la même hauteur pour les deux */
    padding: 0 20px;     /* Espace intérieur horizontal */

    font-size: 1rem;
    font-family: inherit;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    white-space: nowrap; /* Empêche le texte de sauter une ligne */
    transition: 0.3s;
}

.btn-retour {
    background-color: #95a5a6;
    color: white;
}

.btn-ajouter {
    background-color: #3498db;
    color: white;
}

.btn-supprimer {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
}

.btn-supprimer:disabled {
    background-color: #cccccc;
    color: #666666;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-danger { color: #e74c3c; font-weight: bold; text-decoration: none; margin-left: 10px; }
.btn-danger:hover { color: #c0392b; }
.btn-view { color: #27ae60; text-decoration: none; margin-right: 10px; }
.btn-view:hover { color: #1e8449; text-decoration: underline; }
.btn-enregistrer {
    background-color: #3498db;
    color: white;
}

.btn-enregistrer:hover, .btn-retour:hover, .btn-ajouter:hover {
    opacity: 0.9;
}

.row-flex {
    display: flex;         /* Active le mode "côte à côte" */
    gap: 20px;            /* Crée un espace entre les deux champs */
    align-items: flex-end; /* Aligne le bas des champs (pratique si les labels ont des tailles différentes) */
}

    .form-group {
        margin-bottom: 1rem; /* Crée un espace sous chaque bloc */
        display: flex;flex: 1;
        flex-direction: column;
    }

    .groupe-champ {margin-bottom: 1rem; /* Crée un espace sous chaque bloc */
        display: flex;
        flex-direction: column;}

    .groupe-bas-de-page {
        display: flex;       /* Aligne sur la même ligne */
        gap: 15px;          /* Espace précis entre les boîtes */
        margin-top: 30px;    /* Distance avec le tableau/formulaire au-dessus */
        align-items: center; /* Aligne les centres verticalement */
    }

.modal {
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5); /* Fond noir transparent */
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    width: 500px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

