/* CSS pour les états financiers - Style Excel fidèle */

/* Reset et base */
body, div, table, thead, tbody, tfoot, tr, th, td, p {
    font-family: "Arial", sans-serif;
    font-size: x-small;
    margin: 0;
    padding: 0;
}

body {
    background-color: #ffffff;
    color: #000000;
}

/* Tables financières */
.table-financial {
    border-collapse: collapse;
    width: 100%;
    table-layout: fixed;
}

/* En-têtes principaux */
.header-cell {
    background-color: #A6A6A6;
    font-weight: bold;
    text-align: center;
    padding: 8px;
    border: 2px solid #000000;
    vertical-align: middle;
}

.header-cell font {
    font-family: "Arial Black", Arial, sans-serif;
    font-size: 14px;
}

/* Informations entreprise */
.company-info {
    background-color: #FFFFFF;
    padding: 5px 8px;
    vertical-align: middle;
    border: none;
}

.company-info b {
    font-weight: bold;
}

.company-info font[face="Bookman Old Style"] {
    font-family: "Bookman Old Style", serif;
}

/* En-têtes de sections */
.section-header {
    background-color: #D9D9D9;
    font-weight: bold;
    text-align: center;
    border: 2px solid #000000;
    padding: 5px;
    vertical-align: middle;
}

.section-header-left {
    background-color: #D9D9D9;
    font-weight: bold;
    text-align: left;
    border: 2px solid #000000;
    padding: 5px;
    vertical-align: middle;
}

/* Sous-en-têtes */
.subsection-header {
    background-color: #BFBFBF;
    font-weight: bold;
    border: 2px solid #000000;
    padding: 3px 5px;
    vertical-align: middle;
}

.subsection-header-center {
    background-color: #BFBFBF;
    font-weight: bold;
    text-align: center;
    border: 2px solid #000000;
    padding: 3px 5px;
    vertical-align: middle;
}

/* Cellules de données */
.data-cell {
    text-align: right;
    padding: 2px 8px;
    border: 1px solid #000000;
    vertical-align: middle;
    background-color: #FFFFFF;
}

.data-cell-left {
    text-align: left;
    padding: 2px 8px;
    border: 1px solid #000000;
    vertical-align: middle;
    background-color: #FFFFFF;
}

.data-cell-center {
    text-align: center;
    padding: 2px 8px;
    border: 1px solid #000000;
    vertical-align: middle;
    background-color: #FFFFFF;
}

/* Lignes de totaux */
.total-row {
    background-color: #D9D9D9;
    font-weight: bold;
}

.major-total-row {
    background-color: #BFBFBF;
    font-weight: bold;
    border-top: 2px solid #000000;
    border-bottom: 2px solid #000000;
}

.final-total-row {
    background-color: #A6A6A6;
    font-weight: bold;
    border-top: 3px solid #000000;
    border-bottom: 3px solid #000000;
}

/* Bordures spéciales */
.border-top-thick {
    border-top: 2px solid #000000;
}

.border-bottom-thick {
    border-bottom: 2px solid #000000;
}

.border-left-thick {
    border-left: 2px solid #000000;
}

.border-right-thick {
    border-right: 2px solid #000000;
}

.border-top-thin {
    border-top: 1px solid #000000;
}

.border-bottom-thin {
    border-bottom: 1px solid #000000;
}

.border-left-thin {
    border-left: 1px solid #000000;
}

.border-right-thin {
    border-right: 1px solid #000000;
}

/* Styles spécifiques pour les colonnes N-1 (double bordure) */
.column-n-minus-1 {
    border-left: 2px solid #000000;
    border-right: 2px solid #000000;
}

/* Alignements */
.align-left {
    text-align: left;
}

.align-center {
    text-align: center;
}

.align-right {
    text-align: right;
}

.valign-top {
    vertical-align: top;
}

.valign-middle {
    vertical-align: middle;
}

.valign-bottom {
    vertical-align: bottom;
}

/* Styles typographiques */
.font-bold {
    font-weight: bold;
}

.font-small {
    font-size: x-small;
}

.font-normal {
    font-size: small;
}

.font-large {
    font-size: medium;
}

.font-arial-black {
    font-family: "Arial Black", Arial, sans-serif;
}

.font-bookman {
    font-family: "Bookman Old Style", serif;
}

.font-calibri {
    font-family: "Calibri", Arial, sans-serif;
}

/* Espacement */
.height-30 {
    height: 30px;
}

.height-36 {
    height: 36px;
}

.height-39 {
    height: 39px;
}

.height-60 {
    height: 60px;
}

.height-95 {
    height: 95px;
}

/* Largeurs de colonnes pour différents états */
.col-ref {
    width: 79px;
}

.col-designation {
    width: 488px;
}

.col-note {
    width: 151px;
}

.col-amount-1 {
    width: 259px;
}

.col-amount-2 {
    width: 232px;
}

.col-amount-3 {
    width: 202px;
}

.col-amount-4 {
    width: 154px;
}

/* Couleurs de fond spécifiques */
.bg-gray-light {
    background-color: #F2F2F2;
}

.bg-gray-medium {
    background-color: #D9D9D9;
}

.bg-gray-dark {
    background-color: #BFBFBF;
}

.bg-gray-darker {
    background-color: #A6A6A6;
}

.bg-white {
    background-color: #FFFFFF;
}

/* Styles pour l'impression */
@media print {
    body {
        font-size: 10px;
    }

    .table-financial {
        page-break-inside: avoid;
    }

    .header-cell {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .section-header, .subsection-header, .total-row {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}

/* Responsive pour petits écrans */
@media screen and (max-width: 768px) {
    .table-financial {
        font-size: xx-small;
    }

    .data-cell, .data-cell-left, .data-cell-center {
        padding: 1px 3px;
    }

    .company-info {
        padding: 3px 5px;
    }
}

/* Utilitaires pour masquer/afficher des colonnes */
.hide-column {
    display: none;
}

.show-column {
    display: table-cell;
}

/* Animation pour les changements de données */
.data-changed {
    background-color: #ffffcc;
    transition: background-color 0.3s ease;
}

.data-changed:hover {
    background-color: #ffff99;
}

/* Styles pour les notes en bas de page */
.notes-section {
    margin-top: 20px;
    font-size: x-small;
    border-top: 1px solid #000000;
    padding-top: 10px;
}

.note-reference {
    font-weight: bold;
    color: #0066cc;
    text-decoration: underline;
    cursor: pointer;
}

/* Styles pour les formules et calculs */
.formula-cell {
    font-style: italic;
    color: #666666;
}

.calculated-value {
    font-weight: bold;
    color: #000000;
}

/* Classes pour les erreurs et validations */
.error-value {
    background-color: #ffcccc;
    color: #cc0000;
}

.warning-value {
    background-color: #ffffcc;
    color: #cc6600;
}

.success-value {
    background-color: #ccffcc;
    color: #006600;
}