/* ======================================= */
/* COMPTABILITÉ CSS - Clic Academy ERP     */
/* ======================================= */

/* Cartes statistiques */
.stat-card {
    background: #fff;
    border: 0.5px solid #e0e0e0;
    border-radius: 10px;
    padding: 1rem 1.2rem;
}
.stat-label {
    margin: 0 0 6px;
    font-size: 12px;
    color: #888;
}
.stat-value {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: #333;
}
.stat-value.success { color: #27ae60; }
.stat-value.danger  { color: #e74c3c; }
.stat-value.warning { color: #f39c12; }
.stat-sub {
    margin: 4px 0 0;
    font-size: 11px;
    color: #aaa;
}

/* Onglets */
.compta-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 1.2rem;
}
.compta-tab {
    padding: 10px 22px;
    font-size: 13px;
    font-weight: 500;
    color: #888;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: 0.2s;
}
.compta-tab.active {
    color: #333;
    border-bottom: 2px solid #8cc46b;
}
.compta-tab:hover { color: #333; }

/* Sections */
.compta-section { display: none; }
.compta-section.active { display: block; }

/* Barre d'outils tableau */
.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 12px;
}
.filter-btn {
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid #ddd;
    background: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: 0.2s;
    color: #555;
}
.filter-btn.active {
    background: #8cc46b;
    color: #fff;
    border-color: #8cc46b;
}
.filter-btn:hover { background: #dce8d5; }
.search-input {
    padding: 7px 14px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 12px;
    outline: none;
    width: 220px;
}
.search-input:focus { border-color: #8cc46b; }

/* Tableau */
.erp-table-wrap {
    background: #fff;
    border: 0.5px solid #e0e0e0;
    border-radius: 10px;
    overflow-x: auto;
}
.erp-table-pro {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.erp-table-pro thead tr {
    background: #f5f5f5;
}
.erp-table-pro th {
    padding: 11px 14px;
    text-align: left;
    font-weight: 500;
    color: #666;
    white-space: nowrap;
    border-bottom: 1px solid #e0e0e0;
}
.erp-table-pro td {
    padding: 11px 14px;
    border-bottom: 0.5px solid #f0f0f0;
    color: #444;
    vertical-align: middle;
}
.erp-table-pro tbody tr:last-child td { border-bottom: none; }
.erp-table-pro tbody tr:hover { background: #f9fdf6; }
.ref-cell { color: #aaa; font-size: 11px; }
.amount-cell { text-align: right; font-weight: 500; }
.success-text { color: #27ae60; }
.danger-text  { color: #e74c3c; }
.desc-cell {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.table-loading {
    text-align: center;
    padding: 30px !important;
    color: #aaa;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}
.badge-success { background: #eafaf1; color: #1e8449; }
.badge-warning { background: #fef9e7; color: #b7770d; }
.badge-danger  { background: #fdf2f2; color: #c0392b; }
.badge-neutral { background: #f0f0f0; color: #666; }
.badge-role    { background: #eaf0fb; color: #2471a3; }

/* Boutons d'action dans les lignes */
.btn-row-edit, .btn-row-delete, .btn-row-valid {
    padding: 5px 9px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 11px;
    transition: 0.2s;
}
.btn-row-edit  { background: #eaf0fb; color: #2471a3; }
.btn-row-edit:hover  { background: #d0e4f7; }
.btn-row-delete { background: #fdf2f2; color: #c0392b; }
.btn-row-delete:hover { background: #f9d6d6; }
.btn-row-valid { background: #eafaf1; color: #1e8449; }
.btn-row-valid:hover { background: #d5f5e3; }
/* Boutons header comptabilité */
.btn-add {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
}

#btnNouvelleEntree {
    background-color: #1c4703;
    color: white;
}

#btnNouvelleEntree:hover {
    background-color: #1c4703;
}

#btnNouveauPayement {
    background-color: #1c4703;
    color: white;
}

#btnNouveauPayement:hover {
    background-color: #1c4703;
}
/* ======================================= */
/* MODAL FORMULAIRE                        */
/* ======================================= */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.modal-overlay.active {
    display: flex;
}
.modal-box {
    background: #fff;
    border-radius: 12px;
    width: 580px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid #f0f0f0;
}
.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #aaa;
    font-size: 14px;
    padding: 4px;
}
.modal-close:hover { color: #333; }
.modal-body {
    padding: 20px 24px;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.form-group {
    margin-bottom: 14px;
}
.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #555;
    margin-bottom: 5px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    transition: 0.2s;
    color: #333;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #8cc46b;
}
.btn-cancel {
    padding: 9px 20px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    transition: 0.2s;
}
.btn-cancel:hover { background: #f5f5f5; }
.btn-submit {
    padding: 9px 20px;
    border: none;
    background: #8cc46b;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
}
.btn-submit:hover { background: #7ab35a; }
/* ======================================= */
/* IMPRESSION                              */
/* Cache tout sauf la zone d'impression    */
/* quand on déclenche window.print()       */
/* ======================================= */
#zoneImpression {
    display: none;
}

@media print {
    body * {
        visibility: hidden;
    }
    #zoneImpression, #zoneImpression * {
        visibility: visible;
    }
    #zoneImpression {
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
    }
}