/* ═══════════════════════════════════════════════════════════════════════════
   DOCUMENT MODAL - GESTACRISES v25 FINALE
   Modal 100% plein écran + fond gris léger + zone amendement blanche + texte noir
   ═══════════════════════════════════════════════════════════════════════════ */

.doc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.doc-modal-container {
    background: white;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

.doc-modal-header {
    background: linear-gradient(135deg, #E8EEF2 0%, #C8D6E5 100%);
    padding: 15px 25px;
    border-bottom: 3px solid #5DADE2;
    border-radius: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.doc-modal-title {
    color: #000000;
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

.doc-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #000000;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.doc-modal-close:hover {
    background: rgba(0,0,0,0.1);
}

.doc-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 30px 40px;
    line-height: 1.8;
    color: #111827;
}

/* Tokens bilan */
.doc-tokens-bilan {
    background: #F0F9FF;
    padding: 20px;
    margin: 30px 0;
    border-left: 4px solid #60A5FA;
    border-radius: 4px;
}

.doc-tokens-title {
    color: #1e40af;
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 15px 0;
}

.doc-tokens-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #E5E7EB;
    font-size: 14px;
}

.doc-tokens-row:last-child {
    border-bottom: none;
}

.doc-tokens-label {
    color: #475569;
    font-weight: 600;
}

.doc-tokens-value {
    color: #000000;
    font-weight: 700;
}

/* Affichage amendements validés */
.doc-amendment-display {
    background: #E8F5FD;
    padding: 20px 25px;
    margin: 30px 0;
    border-left: 5px solid #3498DB;
    border-radius: 4px;
}

.doc-amendment-display-title {
    color: #1e3a8a;
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 15px 0;
}

.doc-amendment-display-content {
    background: white;
    padding: 15px;
    border-radius: 3px;
    white-space: pre-wrap;
    font-size: 15px;
    line-height: 1.8;
    color: #000000;
}

/* Zone amendement éditable - BLANCHE SIMPLE */
.doc-amendment-zone {
    margin-top: 40px;
    padding: 25px;
    background: white;
    border: 2px solid #BDC3C7;
    border-radius: 6px;
}

.doc-amendment-title {
    color: #1e3a8a;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 10px 0;
}

.doc-amendment-placeholder {
    color: #7F8C8D;
    font-size: 14px;
    margin-bottom: 12px;
}

.doc-amendment-textarea {
    width: 100%;
    min-height: 180px;
    padding: 15px;
    border: 2px solid #BDC3C7;
    border-radius: 4px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    line-height: 1.6;
}

.doc-amendment-textarea:focus {
    outline: none;
    border-color: #3498DB;
    background: #F8FAFC;
}

/* Footer */
.doc-modal-footer {
    padding: 20px 30px;
    border-top: 2px solid #ECF0F1;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    align-items: center;
    flex-shrink: 0;
}

/* Message verrouillage - TEXTE NOIR */
.doc-modal-footer > div {
    color: #000000 !important;
}

/* Tableaux Markdown - scroll horizontal si besoin */
.doc-modal-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
    display: block;
    overflow-x: auto;
}

.doc-modal-body table th {
    background: linear-gradient(135deg, #3498DB 0%, #2980B9 100%);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 700;
    border: 1px solid #2980B9;
}

.doc-modal-body table td {
    padding: 10px 12px;
    border: 1px solid #BDC3C7;
    background: white;
    color: #000000;
    white-space: normal;
    word-wrap: break-word;
}

.doc-modal-body table tr:nth-child(even) td {
    background: #F8FAFC;
}

.doc-modal-body table tr:hover td {
    background: #E8F5FD;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MODAL CONSULTATION - AJOUT v37
   Modal plein écran pour consulter Phase 1/2/3 avec onglets
   ═══════════════════════════════════════════════════════════════════════════ */

.consultation-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.consultation-modal-container {
    background: white;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

.consultation-modal-header {
    background: linear-gradient(135deg, #E8EEF2 0%, #C8D6E5 100%);
    padding: 15px 25px;
    border-bottom: 3px solid #5DADE2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.consultation-modal-title {
    color: #000000;
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

.consultation-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #000000;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.consultation-modal-close:hover {
    background: rgba(0,0,0,0.1);
}

/* Onglets principaux Phase 1/2/3 */
.consultation-tabs {
    display: flex;
    gap: 10px;
    padding: 15px 25px;
    background: #F8F9FA;
    border-bottom: 2px solid #BDC3C7;
    flex-shrink: 0;
}

.consultation-tab {
    padding: 12px 24px;
    background: #E0E0E0;
    border: none;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #000000;
    transition: all 0.2s;
}

.consultation-tab:hover {
    background: #D0D0D0;
}

.consultation-tab.active {
    background: white;
    color: #5DADE2;
    border-bottom: 3px solid #5DADE2;
}

/* Sous-onglets Phase 1 (Mission, Situation, etc.) */
.consultation-subtabs {
    display: flex;
    gap: 8px;
    padding: 12px 25px;
    background: white;
    border-bottom: 1px solid #E0E0E0;
    flex-shrink: 0;
    overflow-x: auto;
}

.consultation-subtab {
    padding: 8px 16px;
    background: #F0F0F0;
    border: 1px solid #CCC;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #000000;
    transition: all 0.2s;
    white-space: nowrap;
}

.consultation-subtab:hover {
    background: #E0E0E0;
}

.consultation-subtab.active {
    background: #5DADE2;
    color: white;
    border-color: #3498DB;
}

/* Contenu modal consultation */
.consultation-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 30px 40px;
    line-height: 1.8;
    background: white;
}

.consultation-modal-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
}

.consultation-modal-body table th {
    background: linear-gradient(135deg, #3498DB 0%, #2980B9 100%);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 700;
    border: 1px solid #2980B9;
}

.consultation-modal-body table td {
    padding: 10px 12px;
    border: 1px solid #BDC3C7;
    background: white;
    color: #000000;
}

.consultation-modal-body table tr:nth-child(even) td {
    background: #F8FAFC;
}
