/* FORMAT A4 AJUSTABLE */
.document-vertical { 
    width: 750px; 
    height: auto !important; /* Laisse le document grandir */
    min-height: 1100px;
    flex-direction: column;
    padding: 50px;
    gap: 15px;
    background: white;
    padding-bottom: 60px;
    margin-bottom: 50px;
}

.preview-area { 
    align-items: flex-start; /* Important pour voir le haut */
    justify-content: center;
    padding-top: 20px;
    overflow-y: auto;
}

/* En cas de terme dépassé */
.alert-term {
    background: #fef2f2 !important;
    border-color: #ef4444 !important;
}
.alert-term span { color: #dc2626 !important; }

/* Bannière */
.patient-banner {
    background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: 6px; padding: 12px;
    display: flex; justify-content: space-between; margin-bottom: 15px;
}
.patient-banner div { display: flex; flex-direction: column; }
.patient-banner small { font-size: 9px; color: #64748b; font-weight: bold; text-transform: uppercase; }
.patient-banner span { font-size: 13px; color: #0f172a; font-weight: 700; }

/* Titres */
.section-title {
    font-size: 14px; font-weight: 800; color: #0f172a;
    border-bottom: 2px solid #0f172a; padding-bottom: 5px; margin-bottom: 10px;
    text-transform: uppercase; display: flex; justify-content: space-between;
}

/* Tableau Bio */
.bio-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.bio-table th { text-align: left; background: #f8fafc; padding: 6px; border-bottom: 2px solid #e2e8f0; color: #64748b; }
.bio-table td { padding: 6px; border-bottom: 1px solid #e2e8f0; color: #000; vertical-align: middle; }
.result-bad { color: #dc2626 !important; font-weight: bold; }
.result-good { color: #2563eb !important; font-weight: bold; }

/* ECHO */
.echo-container { display: flex; gap: 20px; align-items: flex-start; }
.echo-frame {
    width: 100%; height: 250px; background-color: black;
    position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    border: 4px solid #000; margin-bottom: 5px;
}
.echo-frame img { max-width: 100%; max-height: 100%; filter: contrast(1.2) brightness(1.1) grayscale(100%); }

.echo-thumbnails { display: flex; gap: 5px; justify-content: space-between; }
.thumb-frame {
    width: 32%; height: 60px; background: black; border: 2px solid #000;
    overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.thumb-frame img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(100%) contrast(1.2); opacity: 0.8; }

.echo-overlay-text {
    position: absolute; color: #00ff00; font-family: 'Courier New', monospace;
    font-size: 10px; font-weight: bold; text-shadow: 1px 1px 0 #000; pointer-events: none;
}
.top-left { top: 10px; left: 10px; }
.top-right { top: 10px; right: 10px; text-align: right; }
.bottom-left { bottom: 10px; left: 10px; }
.bottom-center { bottom: 10px; width: 100%; text-align: center; font-size: 14px; color: white; }

/* Biométries */
.biometrics-panel { flex: 1; background: #f8fafc; padding: 10px; border-radius: 4px; border: 1px solid #e2e8f0; }
.biometrics-panel h5 { font-size: 10px; color: #64748b; margin: 0 0 8px 0; text-transform: uppercase; border-bottom: 1px dashed #cbd5e1; padding-bottom: 2px; }
.bio-list { list-style: none; padding: 0; margin: 0; }
.bio-list li { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 6px; border-bottom: 1px solid #f1f5f9; padding-bottom: 2px; }
.bio-list li span { color: #475569; }
.bio-list li strong { color: #0f172a; }

/* ORDONNANCE */
.ordo-block {
    border: 1px dashed #0f172a;
    padding: 15px;
    border-radius: 4px;
    background: #fff;
    margin-top: 10px;
}
.ordo-stamp {
    border: 2px solid #2563eb; color: #2563eb; font-weight: bold; padding: 5px 10px;
    transform: rotate(-10deg); font-size: 12px; border-radius: 4px; opacity: 0.8;
}

/* FOOTER & LEGAL */
.legal-text {
    font-size: 9px; color: #000000 !important; text-align: center;
    margin-top: 30px; font-style: italic; opacity: 0.8; width: 100%;
}
.cert-footer { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 20px; }
