/* CSS spécifique pour les écritures */
.ecritures-tabs {
    margin: 20px 0 0 0;
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    gap: 5px;
    position: relative;
    z-index: 1;
}

.ecritures-tab {
    padding: 12px 24px;
    background: #f3f4f6;
    border: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #065f46;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ecritures-tab:hover {
    background: #e5e7eb;
    color: #374151;
    text-decoration: none;
}

.ecritures-tab.active {
    background: white;
    color: #065f46;
    border-bottom: 3px solid #065f46;
    margin-bottom: -2px;
    position: relative;
    z-index: 2;
}

.ecritures-tab.virement.active {
    color: #065f46;
    border-bottom-color: #065f46;
}

.ecritures-tab.liste.active {
    color: #065f46;
    border-bottom-color: #065f46;
}

.ecritures-tab.scan-cheque.active {
    color: #065f46;
    border-bottom-color: #065f46;
}

.ecritures .tab-content {
    background: white;
    border-radius: 0 8px 8px 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    min-height: 400px;
    display: block !important; /* Toujours visible pour les écritures */
}

/* Styles pour les formulaires d'écritures */
.compta-form {
    max-width: none;
}

.compta-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #374151;
}

.compta-form input[type="text"],
.compta-form input[type="number"],
.compta-form input[type="date"],
.compta-form select,
.compta-form textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 15px;
}

.compta-form button[type="submit"] {
    background: #047857;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
}

.compta-form button[type="submit"]:hover {
    background: #065f46;
}

/* Styles pour les modales d'écritures */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal {
    background: white;
    border-radius: 8px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.bank-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
}

.bank-tag:hover {
    background: #bae6fd;
    cursor: help;
}

/* Styles pour le scan de chèque */
#cheque_preview {
    text-align: center;
    margin: 20px 0;
}

#cheque_preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#ocr_status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #f0f9ff;
    border-left: 4px solid #0ea5e9;
    border-radius: 6px;
    margin: 15px 0;
}

#ocr_status strong {
    color: #0369a1;
}

progress#ocr_progress {
    flex: 1;
    height: 6px;
}

#ocr_button {
    background: #8b5cf6;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    margin: 15px 0;
    width: 100%;
    transition: background 0.2s;
}

#ocr_button:hover:not(:disabled) {
    background: #7c3aed;
}

#ocr_button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

#form_cheque input,
#form_cheque select {
    width: 100%;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
    box-sizing: border-box;
}

#form_cheque button {
    background: #10b981;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}

#form_cheque button:hover {
    background: #059669;
}

#no_data_message {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

#no_data_message p {
    font-size: 16px;
    margin: 0;
}

.modal h4 {
    margin: 0 0 20px 0;
    color: #374151;
    font-size: 20px;
}

.actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.actions button[type="submit"] {
    background: #047857;
    color: white;
}

.actions button.cancel {
    background: #6b7280;
    color: white;
}

