/**
 * CSS Bilans - Style V1 avec jQuery UI
 */

.bilans-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.bilans-container h1 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

.bilans-container .subtitle {
    color: #666;
    margin-bottom: 20px;
}

/* Filtres */
#filtres {
    padding: 15px;
    margin-bottom: 20px;
    background: #fff;
}

#filtres h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1em;
    color: #4D7EA8;
}

.form-row {
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.form-group {
    margin-bottom: 15px;
    flex: 1;
    min-width: 200px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-group select,
.form-group input {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
}

.buttons {
    margin-top: 15px;
    margin-bottom: 0;
    display: flex;
    gap: 10px;
}

/* Accordion Intervenantes */
.intervenante-title {
    background: #00bcd4 !important;
    color: #fff !important;
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px !important;
}

.inter-title-2 {
    float: right;
    display: flex;
    justify-content: end;
    gap: 25px;
    font-size: 0.9em;
    font-weight: normal;
}

.inter-title-2 .periode {
    color: rgba(255,255,255,0.8);
}

.intervenante-content {
    padding: 0 !important;
}

/* Accordion Mois */
h4.mois-title {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    background-color: #CDE6F5 !important;
    color: #333 !important;
    padding: 8px 15px !important;
    margin: 0 !important;
    border-radius: 0 !important;
}

.mois-stats {
    display: inline-grid;
    grid-template-columns: 1em repeat(3, auto) auto;
    column-gap: 8px;
    align-items: center;
    justify-items: end;
    margin-left: auto;
    font-size: 0.9em;
}

.mois-stats .month-interventions,
.mois-stats .month-hours {
    font-weight: bold;
    min-width: 30px;
    text-align: right;
}

.mois-content {
    padding: 15px !important;
    background: #fff;
}

.mois-content h5 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #4D7EA8;
}

/* Tables */
.bilans-container table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 0.9em;
}

.bilans-container table,
.bilans-container th,
.bilans-container td {
    border: 1px solid #ddd;
}

.bilans-container th {
    background-color: #f2f2f2;
    padding: 10px;
    text-align: left;
    font-weight: bold;
}

.bilans-container td {
    padding: 8px;
}

.bilans-container tr:nth-child(even) {
    background-color: #f9f9f9;
}

.text-right {
    text-align: right;
}

/* Lignes payées */
.paid-row {
    background-color: #d4edda !important;
}

tr.paid-row:nth-child(even) {
    background-color: #c3e6cb !important;
}

.unpaid-row {
    background-color: #fff;
}

/* Total intervenante */
.total-intervenante {
    background-color: #e9ecef;
    padding: 10px 15px;
    margin: 0;
    font-weight: bold;
    border-radius: 0;
    display: flex;
    justify-content: space-between;
    border-top: 2px solid #4D7EA8;
}

.total-intervenante .mr-15 {
    margin-right: 15px;
}

/* Stats globales */
.stats-globales {
    background-color: #d4edda;
    padding: 15px;
    margin-top: 30px;
    border-radius: 4px;
}

.stats-globales h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #155724;
}

.resume-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 5px 0;
}

.resume-row:last-child {
    margin-bottom: 0;
}

/* Message vide */
.empty-message {
    padding: 15px;
    margin-bottom: 20px;
}

.empty-message p {
    margin: 0;
    display: flex;
    align-items: center;
}

.empty-message .ui-icon {
    margin-right: 8px;
}

/* Bouton Payer */
.pay-button {
    padding: 4px 12px !important;
    font-size: 0.85em !important;
    margin-left: 15px !important;
}

/* Dialogue de paiement */
#payDialog {
    font-size: 0.95em;
}

.pay-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.pay-table th,
.pay-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.pay-table th {
    background-color: #f2f2f2;
}

.pay-table th:last-child,
.pay-table td:last-child {
    text-align: center;
    width: 40px;
}

.pay-summary {
    background: #f9f9f9;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
    display: flex;
    justify-content: space-around;
}

#confirmPaymentButton {
    width: 100%;
    padding: 10px !important;
    font-size: 1em !important;
}

/* jQuery UI Overrides */
.ui-widget {
    font-family: Arial, sans-serif;
    font-size: 1em;
}

.ui-accordion .ui-accordion-content {
    padding: 0;
}

.ui-accordion .ui-accordion-header {
    margin-top: 0;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }

    .bilans-container {
        max-width: 100%;
        padding: 0;
    }

    .ui-accordion .ui-accordion-content {
        display: block !important;
        height: auto !important;
    }

    .ui-accordion .ui-accordion-header {
        page-break-inside: avoid;
    }

    table {
        page-break-inside: auto;
    }

    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    thead {
        display: table-header-group;
    }

    tfoot {
        display: table-footer-group;
    }

    .pay-button {
        display: none !important;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }

    .form-group {
        min-width: 100%;
    }

    .inter-title-2 {
        flex-direction: column;
        gap: 5px;
        text-align: right;
    }

    .mois-stats {
        grid-template-columns: auto auto auto auto;
        gap: 5px;
    }

    .bilans-container table {
        font-size: 0.8em;
    }

    .bilans-container th,
    .bilans-container td {
        padding: 5px;
    }
}
