/* RESET & BASE */
    body { font-size: 0.95rem; font-family: system-ui, -apple-system, sans-serif; background-color: #f8f9fa; color: #212529; }
    
    /* REMPLACEMENT CONTAINER & LARGEUR */
    .custom-container { 
        width: 100%; 
        max-width: 1400px; /* Largeur augmentée */
        margin: 0 auto; 
        background-color: #fff; 
        padding: 3rem; 
        border-radius: 0.5rem; 
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15); 
    }

    /* GRILLE SIMPLIFIÉE (Flexbox) */
    .row { display: flex; flex-wrap: wrap; margin-right: -15px; margin-left: -15px; }
    .col-8 { flex: 0 0 66.666%; max-width: 66.666%; padding: 0 15px; }
    .col-4 { flex: 0 0 33.333%; max-width: 33.333%; padding: 0 15px; text-align: right; }
    .col-md-3 { flex: 0 0 25%; max-width: 25%; padding: 0 15px; }
    .col-md-4 { flex: 0 0 33.333%; max-width: 33.333%; padding: 0 15px; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; padding: 0 15px; }
    .col-md-9 { flex: 0 0 75%; max-width: 75%; padding: 0 15px; }
    .col-12 { flex: 0 0 100%; max-width: 100%; padding: 0 15px; }

    /* COMPOSANTS (CARD, TABLE, PILL) */
    .section-title { border-bottom: 2px solid #0d6efd; margin-top: 30px; margin-bottom: 15px; font-weight: bold; text-transform: uppercase; }
    .valeur { font-weight: bold; color: #0d6efd; }
    .result-pill { padding: 10px 20px; border-radius: 50px; font-weight: bold; display: inline-block; }
    .bg-success { background-color: #198754; color: white; }
    .bg-danger { background-color: #dc3545; color: white; }
    .bg-light { background-color: #f8f9fa; border: 1px solid #dee2e6; }
    .bg-dark { background-color: #212529; color: white; }
    
    .table { width: 100%; margin-bottom: 1rem; border-collapse: collapse; }
    .table-bordered { border: 1px solid #dee2e6; }
    .table-bordered td, .table-bordered th { border: 1px solid #dee2e6; padding: 0.5rem; }
    .table-sm td { padding: 0.25rem; }
    .table-secondary { background-color: #e2e3e5; }
    .table-borderless td { border: 0; }
    
    .card { position: relative; display: flex; flex-direction: column; background-color: #fff; border: 1px solid rgba(0,0,0,.125); border-radius: 0.25rem; }
    .card-header { padding: 0.5rem 1rem; background-color: rgba(0,0,0,.03); border-bottom: 1px solid rgba(0,0,0,.125); }
    .card-body { flex: 1 1 auto; padding: 1rem; }

    /* LISTES ET UTILITAIRES */
    .list-group { display: flex; flex-direction: column; padding-left: 0; margin-bottom: 0; }
    .list-group-item { border: 0; border-bottom: 1px solid rgba(0,0,0,.125); padding: 0.75rem 1.25rem; display: flex; justify-content: space-between; }
    .text-muted { color: #6c757d; }
    .text-center { text-align: center; }
    .fw-bold { font-weight: 700; }
    .mb-4 { margin-bottom: 1.5rem; }
    .mt-5 { margin-top: 3rem; }
    .shadow { box-shadow: 0 0.5rem 1rem rgba(0,0,0,.15); }
    .rounded { border-radius: 0.25rem; }
    .border { border: 1px solid #dee2e6; }
    .p-3 { padding: 1rem; }
    .p-2 { padding: 0.5rem; }

    /* BOUTONS */
    .btn { display: inline-block; font-weight: 400; text-align: center; vertical-align: middle; cursor: pointer; padding: 0.375rem 0.75rem; border: 1px solid transparent; border-radius: 0.25rem; text-decoration: none; }
    .btn-primary { color: #fff; background-color: #0d6efd; border-color: #0d6efd; }
    .btn-outline-secondary { color: #6c757d; border-color: #6c757d; }
    .btn-lg { padding: 0.5rem 1rem; font-size: 1.25rem; }

    @media print { .no-print { display: none; } .custom-container { box-shadow: none; border: none; width: 100%; max-width: none; } }
	@media print {
    /* 1. Masquer les publicités, le menu et les boutons d'action */
    .no-print, 
    #menu-toggle, 
    .ads-container, 
    header, 
    footer, 
    .sidebar { 
        display: none !important; 
    }

    /* 2. Forcer le rapport à prendre toute la largeur sans marges grises */
    body { 
        background: white !important; 
        padding: 0 !important; 
        margin: 0 !important; 
    }
    
    .main-content, .custom-container {
        width: 100% !important;
        max-width: none !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* 3. Éviter de couper un tableau ou une carte en deux entre deux pages */
    .card, .section-title, table {
        page-break-inside: avoid;
    }
}
  
  /* Rétablissement de la structure Card (Essieux) */
.card {
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Pour que le header sombre ne dépasse pas des arrondis */
}

.card-header.bg-dark {
    background-color: #212529 !important;
    color: #fff !important;
    padding: 0.5rem 1rem;
    font-weight: bold;
}

.card-body {
    padding: 1rem;
    flex: 1 1 auto;

  }

/* Rétablissement du Container Blanc Principal */
.custom-container {
    background-color: #fff;
    padding: 3rem; /* équivalent p-5 */
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15); /* shadow */
    margin-top: 2rem;
    width: 100%;
    max-width: 1200px; /* Ajustez à 1400px si vous voulez plus large */
    margin-left: auto;
    margin-right: auto;
}

/* Utilitaires de colonnes pour div.col-md-9 */
.row { display: flex; flex-wrap: wrap; margin-left: -15px; margin-right: -15px; }
.col-md-3 { flex: 0 0 25%; max-width: 25%; padding: 0 15px; }
.col-md-9 { flex: 0 0 75%; max-width: 75%; padding: 0 15px; }
.text-white { color: #fff !important; }
.py-1 { padding-top: 0.25rem !important; padding-bottom: 0.25rem !important; }

/* Forcer la mise en forme du tableau des essieux */
.card-body .row.text-center.fw-bold {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6 !important;
    margin: 0; /* Aligne parfaitement avec les lignes suivantes */
}

/* Fixer les colonnes (20% pour le N°, 40% pour Masse, 40% pour Entraxe) */
.card-body .col-2 { flex: 0 0 20%; max-width: 20%; border-right: 1px solid #eee; }
.card-body .col-5 { flex: 0 0 40%; max-width: 40%; border-right: 1px solid #eee; }
.card-body .col-5:last-child { border-right: none; }

/* Style des lignes d'essieux */
.essieu-item {
    border-bottom: 1px solid #dee2e6 !important;
    margin: 0 !important;
    transition: background-color 0.2s;
}

.essieu-item:hover {
    background-color: #f0f7ff;
}

/* Zone de défilement pour ne pas casser la page si beaucoup d'essieux */
.overflow-auto {
    overflow-y: auto;
    max-height: 300px;
    border: 1px solid #eee;
}

/* Alignement vertical et padding des cellules */
.essieu-item .row > div {
    padding: 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
