/* public/css/report-print.css */

/* --- Configuration de la page pour l'impression --- */
@page {
    size: A4 portrait;
    margin: 20mm 15mm; /* Marges : Haut/Bas 2cm, Gauche/Droite 1.5cm */
}

/* --- Pied de page avec numérotation --- */
@page {
    @bottom-center {
        content: "Page " counter(page);
        font-family: Arial, sans-serif;
        font-size: 9pt;
        color: #888;
        vertical-align: top;
        padding-top: 10mm;
    }
}

/* --- Styles de base pour le corps du document imprimé --- */
body.printing {
    background-color: #fff !important;
    color: #000 !important;
    font-family: Arial, sans-serif;
    font-size: 10pt;
    -webkit-print-color-adjust: exact;
    color-adjust: exact;
}

/* --- Masquage des éléments de l'interface --- */
.printing #sidebar,
.printing #sidebar-overlay,
.printing .no-print,
/* Règle plus robuste pour masquer le header mobile */
.printing .flex-1 > header.lg\:hidden {
    display: none !important;
}
/* --- Affichage et style de l'en-tête du rapport --- */
.printing .print-header {
    display: block !important;
}

/* --- NOUVELLE MISE EN PAGE PLUS STRICTE POUR LE HEADER --- */
.print-header-container {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    width: 100%;
    border-bottom: 2px solid #000;
    padding-bottom: 10mm;
    margin-bottom: 10mm;
}

.print-header-logos {
    width: 20% !important;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.print-header-logos img {
    max-width: 100%;
    height: auto;
    max-height: 40px; /* Réduit légèrement pour un meilleur alignement */
    object-fit: contain;
    margin-bottom: 10px;
}

.print-header-info {
    width: 60% !important;
    text-align: center;
    font-size: 11pt;
}
.print-header-info strong {
    font-size: 12pt;
    margin-bottom: 5px;
    display: block;
}
.print-header-info span {
    line-height: 1.5;
    display: block;
}

.print-header-date {
    width: 20% !important;
    text-align: right;
    font-size: 10pt;
}
/* --- FIN DE LA NOUVELLE MISE EN PAGE --- */

/* --- Styles pour les tables du rapport --- */
.printing .printable-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 5mm;
    page-break-inside: auto;
}

.printing .printable-table th,
.printing .printable-table td {
    border: 1px solid #333;
    padding: 2mm;
    text-align: left;
    font-size: 9pt;
}

.printing .printable-table th {
    background-color: #e9ecef !important;
    font-weight: bold;
}

.printing .printable-table tr {
    page-break-inside: avoid;
}

/* --- Gestion des titres et sauts de page --- */
.printing h3 {
    font-size: 14pt;
    color: #333;
    border-bottom: 1px solid #ccc;
    padding-bottom: 2mm;
    margin-top: 10mm;
    margin-bottom: 5mm;
    page-break-after: avoid;
}

.printing .main-content {
    margin: 0 !important;
    padding: 0 !important;
}

.printing .printable-area {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}


.printing main,
.printing .overflow-y-auto {
    overflow: visible !important;
    max-height: none !important;
}