        form textarea#commentaire {
        resize: none; /* Désactive la poignée de redimensionnement */
        overflow-y: hidden; /* Cache la barre de défilement */
        }  
        body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; max-width: 800px; margin: 20px auto; background: #f9f9f9; color: #333; }
        h1, h2 { color: #005a9c; border-bottom: 2px solid #005a9c; padding-bottom: 5px;}
        form { background: #fff; border: 1px solid #ccc; padding: 20px; border-radius: 8px; margin-bottom: 20px; }
        form div { margin-bottom: 12px; }
        form label { display: block; font-weight: bold; margin-bottom: 5px; }
        form input, form textarea { width: 100%; padding: 8px; box-sizing: border-box; border: 1px solid #ccc; border-radius: 4px; }
        .btn { background: #005a9c; color: white; padding: 10px 15px; border: none; border-radius: 4px; cursor: pointer; font-weight: bold; }
        .btn-secondary { background-color: #6c757d; }
        .btn-danger { background: #d9534f; } /* Rouge (Déconnexion) */
        h1 { text-align: center; border-bottom: none; } 
        .modal { display: none; position: fixed; z-index: 1; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.4); }
        .modal-content { background-color: #fefefe; margin: 10% auto; padding: 20px; border: 1px solid #888; width: 80%; max-width: 600px; border-radius: 8px; }
        .close-btn { color: #aaa; float: right; font-size: 28px; font-weight: bold; cursor: pointer; }
        #modal-fiche-list { list-style: none; padding: 0; }
        #modal-fiche-list li { padding: 8px; cursor: pointer; }
        #modal-fiche-list li:hover { background-color: #f4f4f4; }

/* ========================================= */
/* --- STYLES POUR L'IMPRESSION PDF (v1) --- */
/* ========================================= */

@media print {

    /* Cache les éléments inutiles (boutons, en-tête, etc.) */
    .app-header, .top-button-row, .action-button-row, #add-photo-btn, #add-attachment-btn, .modal, .delete-btn, .enlarge-btn {
        display: none !important;
        visibility: hidden !important;
    }

    /* Assure que le formulaire est visible */
    body, #create-fiche-form {
        margin: 0;
        padding: 0;
        box-shadow: none;
        border: none;
        width: 100%;
    }

    /* Cache les miniatures des photos (on affichera l'annexe) */
    #photos-preview {
        display: none !important;
    }

    /* --- CORRECTION PIÈCES JOINTES (en liste) --- */
    #attachments-preview {
        border: none !important; /* Cache la boîte en pointillés */
    }

    /* Cache la miniature (l'icône 📄 ou l'aperçu image) */
    .attachment-preview-wrapper .preview-element { 
        display: none !important;
    }

    /* Cache les boutons superflus */
    .attachment-preview-wrapper .delete-btn, 
    .attachment-preview-wrapper .enlarge-btn {
        display: none !important;
    }

    /* Transforme les conteneurs en simples puces de liste */
    .attachment-preview-wrapper {
        display: list-item !important;
        list-style-type: disc !important; /* Ajoute une puce */
        margin-left: 20px !important; /* Indentation */
        border: none !important;
        padding: 0 !important;
        height: auto !important;
        width: auto !important;
        margin-bottom: 5px !important;
        /* Ne garde que le nom du fichier visible */
        justify-content: flex-start !important;
    }

    .attachment-preview-wrapper .file-name {
        font-size: 12pt !important;
        font-weight: bold;
        color: #000 !important;
        text-align: left !important;
        word-break: keep-all !important;
    }

    /* --- CORRECTION PHOTOS (Annexe) --- */

    /* Cache la nouvelle section par défaut (sur l'écran) */
    #print-photos-full {
        display: none;
    }

    /* Force l'affichage de l'annexe photo LORS DE L'IMPRESSION */
    #print-photos-full {
        display: block !important;
        page-break-before: always; /* Commence l'annexe sur une nouvelle page */
        margin-top: 20px;
    }

    #print-photos-full h2 {
        font-size: 16pt;
        border-bottom: 1px solid #ccc;
        padding-bottom: 10px;
        color: #000;
    }

    /* Style pour chaque photo en grand format */
    #print-photos-full .print-photo-item {
        width: 100%;
        height: auto;
        max-height: 90vh; /* Limite la hauteur à 90% de la page */
        object-fit: contain; /* Garde les proportions */
        margin-top: 15px;
        page-break-inside: avoid; /* Évite qu'une photo soit coupée entre deux pages */
    }
}
/* ========================================= */
/* --- STYLES POUR L'IMPRESSION PDF (v1) --- */
/* ========================================= */

/* Cache l'annexe photo sur l'écran par défaut */
#print-photos-full {
    display: none;
}

@media print {

    /* Cache les éléments inutiles (boutons, en-tête, etc.) */
    .app-header, .top-button-row, .action-button-row, #add-photo-btn, #add-attachment-btn, .modal, .delete-btn, .enlarge-btn, .modal-delete-btn, #export-combo-btn, #reset-btn, #logout-btn, #load-fiche-btn, button[type="submit"] {
        display: none !important;
        visibility: hidden !important;
    }

    /* Assure que le formulaire est visible et prend toute la place */
    body, #create-fiche-form, .modal-content {
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
        width: 100% !important;
    }

    /* Force les sections à s'afficher */
    .info-section, .form-group, div[style*="margin-top: 20px"] {
         display: block !important;
         margin-top: 15px !important;
    }

    /* Cache les miniatures des photos (on affichera l'annexe) */
    #photos-preview {
        display: none !important;
    }

    /* --- CORRECTION PIÈCES JOINTES (en liste) --- */
    #attachments-preview {
        border: none !important; /* Cache la boîte en pointillés */
        padding: 0 !important;
        margin: 10px 0 0 20px !important; /* Marge pour l'indentation */
        min-height: 0 !important;
    }

    /* Transforme les conteneurs en simples puces de liste */
    .attachment-item {
        display: list-item !important;
        list-style-type: disc !important; /* Ajoute une puce */
        padding: 0 !important;
        height: auto !important;
        width: auto !important;
        margin-bottom: 5px !important;
    }

    /* Style pour le texte du lien de la pièce jointe */
    .attachment-item span {
        font-size: 12pt !important;
        font-weight: bold !important;
        color: #000 !important;
        text-align: left !important;
    }

    /* Cache les boutons supprimer des pièces jointes */
    .attachment-item button {
        display: none !important;
    }


    /* --- CORRECTION PHOTOS (Annexe) --- */

    /* Force l'affichage de l'annexe photo LORS DE L'IMPRESSION */
    #print-photos-full {
        display: block !important;
        page-break-before: always; /* Commence l'annexe sur une nouvelle page */
        margin-top: 40px;
    }

    #print-photos-full h2 {
        font-size: 16pt;
        border-bottom: 1px solid #ccc;
        padding-bottom: 10px;
        color: #000;
    }

    /* Style pour chaque photo en grand format */
    #print-photos-full .print-photo-item {
        width: 100%;
        height: auto;
        max-height: 90vh; /* Limite la hauteur à 90% de la page */
        object-fit: contain; /* Garde les proportions */
        margin-top: 15px;
        page-break-inside: avoid; /* Évite qu'une photo soit coupée entre deux pages */
    }
}
