/* --- LAYOUT GLOBAL --- */
.labo-body {  
    background-color: #0d1117;
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    color: #e2e8f0;
}

.interface-container { display: flex; width: 100vw; height: 100vh; }

/* --- SIDEBAR (GAUCHE) --- */
.sidebar {
    width: 400px;
    background-color: #0a1324;
    padding: 20px;
    color: white;
    overflow-y: auto;
    border-right: 1px solid #1e293b;
    display: flex;
    flex-direction: column;
}

.sidebar-title { 
    font-size: 20px; 
    font-weight: bold; 
    margin-bottom: 20px; 
    color: #64ffda; 
    text-transform: uppercase; 
    text-align: center;
}

/* --- PREVIEW AREA (CENTRE) --- */
.preview-area {
    flex-grow: 1;
    background-color: #f1f5f9;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px;
    overflow-y: auto;
}

/* --- DOCUMENT A4 PAYSAGE --- */
.document-final {
    background: white;
    width: 1000px;
    display: flex;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    gap: 40px;
}

.doc-left-side {
    position: relative;
    flex: 0 0 320px;
    background: transparent;
    border-right: 1px solid #eee;
    padding-right: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.doc-right-side {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* --- ELEMENTS DU DOCUMENT --- */
.header-cert { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; }
.cert-tag { background: #0a1324; color: white; padding: 4px 12px; border-radius: 20px; font-size: 10px; font-weight: bold; }
.cert-main-title { font-size: 26px; margin: 0; color: #0a1324; font-weight: 900; }
.doc-hr { border: none; border-top: 1px solid #e2e8f0; margin: 15px 0; }

.report-header-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.info-box {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    padding: 8px 12px;
    border-radius: 4px;
    text-align: left;
}

.info-box small { display: block; font-size: 9px; font-weight: bold; color: #64748b; margin-bottom: 2px; text-transform: uppercase; }
.info-box div { font-size: 13px; color: #0f172a; font-weight: 700; min-height: 1.2em; }

#reportList { font-size: 13px; line-height: 1.6; padding-left: 20px; color: #334155; }
h4 { margin: 10px 0; color: #0f172a; text-transform: uppercase; font-size: 14px; border-bottom: 2px solid #3b82f6; display: inline-block;}

/* --- CORRECTION COULEURS TEXTE DOCUMENT --- */
#docMedsList li, #docPreconsList li, #docObsSupText {
    color: #000000 !important; /* Force le noir */
    font-size: 12px;
    line-height: 1.4;
}

/* --- SILHOUETTE --- */
.bodyframe { 
    position: relative; 
    width: 280px; 
    height: 630px; 
    margin: 0 auto;
    z-index: 5;
    background: transparent;
}
.body-bg { width: 100%; height: 100%; display: block; pointer-events: none; opacity: 0.9; }
.overlay { position: absolute; inset: 0; cursor: crosshair; }

.marker-point {
    position: absolute;
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 0 5px rgba(0,0,0,0.8);
    transform: translate(-50%, -50%);
    z-index: 100;
    cursor: grab;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 11px; font-weight: bold; font-family: Arial, sans-serif;
}
.marker-point:active { cursor: grabbing; }

.report-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; border-radius: 4px;
    color: white; font-size: 10px; font-weight: bold;
    margin-right: 8px; vertical-align: middle;
}

/* --- FOOTER --- */
.cert-footer { 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-end; 
    margin-top: 40px; 
}

.cert-signature { 
    border-top: 2px solid #0a1324; 
    min-width: 200px; 
    padding-top: 10px; 
    font-weight: bold; 
    font-size: 11px; 
    color: #000000; 
}

#d-sig { 
    font-family: 'Alex Brush', cursive; 
    font-size: 32px; 
    color: #000000; 
}

.round-stamp {
    display: inline-flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center;
    padding: 5px; 
    border: 2px solid #000; 
    border-radius: 4px; 
    background-color: white; 
    width: fit-content;
    opacity: 1; 
    transform: none;
}

.qr-code { width: 70px; height: 70px; margin-bottom: 2px; }

.stamp-text { 
    font-family: 'Arial', sans-serif; 
    font-weight: bold; 
    font-size: 9px; 
    color: #000; 
    text-transform: uppercase; 
}

/* Le texte légal tout en bas */
.legal-text {
    font-size: 10px;
    color: #000000 !important; 
    text-align: center;
    margin-top: 20px;
    opacity: 0.7;
    font-style: italic;
}

/* --- FORMULAIRES SIDEBAR --- */
.form-group-row { display: flex; gap: 10px; }
.form-group { margin-bottom: 10px; }
label { display: block; font-size: 10px; font-weight: bold; color: #94a3b8; margin-bottom: 4px; text-transform: uppercase; }

input[type="text"], input[type="date"], textarea {
    width: 100%; background: #111b2d; border: 1px solid #334155; color: white;
    padding: 8px; border-radius: 4px; font-size: 11px; outline: none;
}
input:focus, textarea:focus { border-color: #64ffda; }

.lesions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chip { padding: 8px; background: #121c2f; border: 1px solid #1e293b; border-radius: 4px; font-size: 11px; cursor: pointer; text-align: center; color: #94a3b8; }
.chip.active { background: #1e293b; border-color: #3b82f6; color: white; }

/* --- CORRECTION CHECKBOXES & LISTES (Compacts) --- */
.checkbox-grid { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 4px 10px; /* Espace vertical réduit */
    margin: 5px 0; 
}

.checkbox-item { 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    cursor: pointer; 
    font-size: 10px; 
    color: #cbd5e1; 
    white-space: nowrap;
}

.checkbox-item input[type="checkbox"] {
    width: 12px; height: 12px; margin: 0; cursor: pointer;
}

/* --- PANNEAU OPTIONS --- */
#detailsContainer { 
    background: #0f172a; border: 1px solid #1e293b; padding: 15px; border-radius: 8px; margin-top: 15px; 
    border-left: 3px solid #3b82f6;
}
.details-header { font-size: 12px; font-weight: bold; color: white; margin-bottom: 10px; display: block; }
.details-sub-title { font-size: 9px; font-weight: bold; color: #94a3b8; text-transform: uppercase; margin-bottom: 5px; margin-top: 8px;}

.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 5px; }

/* BOUTONS D'OPTION  */
.opt-btn { 
    background: #1e293b; 
    border: 1px solid #334155; 
    color: #cbd5e1; 
    padding: 6px 10px; /* Plus petit */
    border-radius: 4px; 
    font-size: 10px; 
    cursor: pointer; 
    text-align: left; 
    display: flex; align-items: center; gap: 8px;
}
.opt-btn:hover { background: #334155; }

/* Le rond ou le carré avant le texte */
.opt-btn::before {
    content: '';
    width: 8px; height: 8px;
    border: 1px solid #64748b;
    display: inline-block;
}

/* Style RADIO (Rond) pour les choix uniques */
.opt-btn[onclick*="false"]::before { border-radius: 50%; } 
/* Style CHECKBOX (Carré) pour les choix multiples */
.opt-btn[onclick*="true"]::before { border-radius: 2px; }

/* ETAT SÉLECTIONNÉ */
.opt-btn.selected { border-color: #3b82f6; background: rgba(59, 130, 246, 0.1); color: white; }
.opt-btn.selected::before { background: #3b82f6; border-color: #3b82f6; }


/* --- BOUTONS ACTIONS --- */
.edit-btns-container { display: flex; flex-direction: column; gap: 8px; margin-top: 15px; }
.btn-edit { background: #1e293b; color: #94a3b8; border: 1px solid #334155; padding: 8px; font-size: 10px; font-weight: bold; text-transform: uppercase; cursor: pointer; border-radius: 4px; }
.btn-edit:hover { background: #334155; color: white; }

.actions-group { margin-top: 15px; display: flex; flex-direction: column; gap: 10px; }
.btn-image, .btn-discord { width: 100%; padding: 12px; border: none; border-radius: 4px; font-weight: bold; cursor: pointer; text-transform: uppercase; font-size: 11px; }
.btn-image { background: #ffffff; color: #0a1324; }
.btn-discord { background: #5865f2; color: #ffffff; }

/* BADGES ET ALERTS */
.paf-badge { background: #991b1b; color: white; padding: 5px; border-radius: 4px; font-size: 9px; margin-top: 10px; text-align: center; }
.paf-hidden { display: none; }

/* SWITCH */
.debug-container { display: flex; justify-content: space-between; align-items: center; background: rgba(255, 255, 255, 0.05); padding: 8px; border-radius: 4px; margin-top: 10px; }
.switch { position: relative; display: inline-block; width: 30px; height: 16px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background-color: #334155; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 12px; width: 12px; left: 2px; bottom: 2px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: #3b82f6; }
input:checked + .slider:before { transform: translateX(14px); }

/* POPUP */
.popup-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    overflow-y: auto;
    padding: 20px;
}
.popup-content {
    background: #1e293b;
    padding: 25px;
    border-radius: 8px;
    width: 90%;
    max-width: 900px;   
    text-align: center;
    border: 1px solid #334155;
}
.popup-content img {
    max-width: 100%;
    max-height: 70vh;   
    height: auto;
    border: 1px solid #64ffda;
    object-fit: contain;
}

.cursor-tip { position: fixed; background: rgba(10, 19, 36, 0.95); color: #64ffda; padding: 4px 10px; border-radius: 4px; font-size: 11px; z-index: 10000; pointer-events: none; display: none; border: 1px solid #64ffda; }


/* Empêche le crop lors de la génération d'image */
#capture-zone {
    width: 1000px !important;
    min-width: 1000px !important;
    transform: none !important;
}