/* ═══════════════════════════════════════════════════════════════════════════
   COMPTABILITE.CSS — Module Comptabilités — Couleurs dynamiques CECF
   ───────────────────────────────────────────────────────────────────────────
   Stratégie : body .classname {} = spécificité 0,1,1 > page .classname 0,1,0
   Toutes les couleurs passent par var(--kz-*) → admin contrôle depuis /parametres/themes
   Fond blanc partout. Bleus hardcodés → CECF vert.
═══════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────────
   1. RAPPORTS STATISTIQUES — .rs-* (RapportsStatistiques.razor)
───────────────────────────────────────────────────────────────────────── */
body .rs-page {
    background: #ffffff !important;
    padding: 2rem;
}

body .rs-header {
    background: linear-gradient(135deg,
        var(--kz-sidebar-bg,#0D1B12) 0%,
        var(--kz-primary-dark,#1F6B0A) 55%,
        var(--kz-primary,#3D9E0F) 100%) !important;
    border-radius: 20px !important;
    padding: 2.5rem !important;
    margin-bottom: 2rem !important;
    box-shadow: 0 8px 30px rgba(61,158,15,.25) !important;
    position: relative;
    overflow: hidden;
}

body .rs-header::before {
    content: '';
    position: absolute;
    width: 300px; height: 300px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.06);
    top: -80px; right: -80px;
}

body .rs-title {
    color: #ffffff !important;
    font-size: 1.8rem !important;
    font-weight: 800 !important;
}

body .rs-subtitle {
    color: rgba(255,255,255,.70) !important;
}

body .rs-header-icon {
    font-size: 3rem !important;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,.20));
}

body .rs-btn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

body .rs-btn {
    background: #ffffff !important;
    border: 1.5px solid rgba(61,158,15,.15) !important;
    border-radius: 14px !important;
    padding: 1.2rem 1rem !important;
    text-align: left !important;
    cursor: pointer !important;
    transition: all .22s !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.04) !important;
}

body .rs-btn:hover {
    border-color: var(--kz-primary,#3D9E0F) !important;
    box-shadow: 0 4px 18px rgba(61,158,15,.15) !important;
    transform: translateY(-2px) !important;
}

body .rs-btn-active {
    background: linear-gradient(135deg,
        var(--kz-sidebar-bg,#0D1B12) 0%,
        var(--kz-primary-dark,#1F6B0A) 55%,
        var(--kz-primary,#3D9E0F) 100%) !important;
    border-color: transparent !important;
    box-shadow: 0 6px 20px rgba(61,158,15,.30) !important;
    color: white !important;
}

body .rs-btn-active .rs-btn-label,
body .rs-btn-active .rs-btn-sub { color: rgba(255,255,255,.90) !important; }

body .rs-btn-label {
    display: block;
    font-weight: 700;
    font-size: .9rem;
    color: #111827 !important;
    margin: .4rem 0 .2rem;
}

body .rs-btn-sub {
    display: block;
    font-size: .75rem;
    color: #6b7280 !important;
}

body .rs-btn-icon {
    font-size: 1.6rem;
    display: block;
    margin-bottom: .3rem;
}

body .rs-report-area {
    background: #ffffff !important;
    border-radius: 16px !important;
    border: 1px solid rgba(61,158,15,.10) !important;
    box-shadow: 0 2px 16px rgba(61,158,15,.06) !important;
    overflow: hidden;
}

/* ─────────────────────────────────────────────────────────────────────────
   2. OPÉRATION DIVERSE / OPÉRA COMPTE — inline styles convertis
───────────────────────────────────────────────────────────────────────── */
/* blue-text → CECF green */
body .blue-text { color: var(--kz-primary,#3D9E0F) !important; }

/* Les totaux débit/crédit dans OperationDiverse et OperaCompte */
body .debit-total  { color: var(--kz-primary,#3D9E0F) !important; font-weight: 700 !important; }
body .credit-total { color: var(--kz-error,#DC2626) !important; font-weight: 700 !important; }

/* ─────────────────────────────────────────────────────────────────────────
   3. PLAN COMPTABLE / COMPTE COMPTABLE
───────────────────────────────────────────────────────────────────────── */
body .plan-header,
body .compte-header {
    background: linear-gradient(135deg,
        var(--kz-sidebar-bg,#0D1B12) 0%,
        var(--kz-primary-dark,#1F6B0A) 55%,
        var(--kz-primary,#3D9E0F) 100%) !important;
}

body .plan-card,
body .compte-card {
    background: #ffffff !important;
    border-color: rgba(61,158,15,.12) !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   4. JOURNAL DES OPÉRATIONS / BALANCE GÉNÉRALE / GRAND LIVRE
───────────────────────────────────────────────────────────────────────── */
body .journal-header,
body .balance-header,
body .gl-header {
    background: linear-gradient(135deg,
        var(--kz-sidebar-bg,#0D1B12) 0%,
        var(--kz-primary-dark,#1F6B0A) 55%,
        var(--kz-primary,#3D9E0F) 100%) !important;
    box-shadow: 0 4px 20px rgba(61,158,15,.20) !important;
}

body .balance-total-row,
body .gl-total-row {
    background: rgba(61,158,15,.06) !important;
    border-top: 2px solid rgba(61,158,15,.15) !important;
    font-weight: 700 !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   5. BILAN / RÉSULTAT
───────────────────────────────────────────────────────────────────────── */
body .bilan-header,
body .resultat-header {
    background: linear-gradient(135deg,
        var(--kz-sidebar-bg,#0D1B12) 0%,
        var(--kz-primary-dark,#1F6B0A) 55%,
        var(--kz-primary,#3D9E0F) 100%) !important;
}

body .bilan-actif-header {
    background: linear-gradient(90deg,
        var(--kz-primary-dark,#1F6B0A),
        var(--kz-primary,#3D9E0F)) !important;
    color: white !important;
}

body .bilan-passif-header {
    background: linear-gradient(90deg,
        var(--kz-sidebar-bg,#0D1B12),
        var(--kz-primary-dark,#1F6B0A)) !important;
    color: white !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   6. OUVERTURE JOURNÉE COMPTABLE
───────────────────────────────────────────────────────────────────────── */
body .ouverture-header,
body .ojc-header {
    background: linear-gradient(135deg,
        var(--kz-sidebar-bg,#0D1B12) 0%,
        var(--kz-primary-dark,#1F6B0A) 55%,
        var(--kz-primary,#3D9E0F) 100%) !important;
}

body .ojc-card {
    background: #ffffff !important;
    border-color: rgba(61,158,15,.12) !important;
    box-shadow: 0 2px 12px rgba(61,158,15,.06) !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   7. CLÔTURE CAISSE
───────────────────────────────────────────────────────────────────────── */
body .cloture-header {
    background: linear-gradient(135deg,
        var(--kz-sidebar-bg,#0D1B12) 0%,
        var(--kz-primary-dark,#1F6B0A) 55%,
        var(--kz-primary,#3D9E0F) 100%) !important;
}

body .cloture-summary {
    background: linear-gradient(135deg,
        var(--kz-primary-dark,#1F6B0A),
        var(--kz-primary,#3D9E0F)) !important;
    color: white !important;
    border-radius: 12px !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   8. VALIDATION WORKFLOW
───────────────────────────────────────────────────────────────────────── */
body .workflow-header {
    background: linear-gradient(135deg,
        var(--kz-sidebar-bg,#0D1B12) 0%,
        var(--kz-primary-dark,#1F6B0A) 55%,
        var(--kz-primary,#3D9E0F) 100%) !important;
}

body .workflow-step-active {
    border-color: var(--kz-primary,#3D9E0F) !important;
    box-shadow: 0 0 0 3px rgba(61,158,15,.20) !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   9. DÉPÔT OV / RETRAIT OV CLIENT (hero selector div)
      Les divs inline-styled restent couverts par les remplacements directs.
      Ici on cible les wrappers MudBlazor.
───────────────────────────────────────────────────────────────────────── */
body .ov-type-selector {
    background: linear-gradient(135deg,
        var(--kz-sidebar-bg,#0D1B12) 0%,
        var(--kz-primary-dark,#1F6B0A) 100%) !important;
    border-color: var(--kz-secondary,#D6C451) !important;
}

body .ov-icon-badge {
    background: linear-gradient(135deg,
        var(--kz-secondary,#D6C451),
        #f0cc7a) !important;
}

body .ov-label {
    color: var(--kz-secondary,#D6C451) !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   10. CAISSE DÉCAISSEMENT
───────────────────────────────────────────────────────────────────────── */
body .dec-caisse-header {
    background: linear-gradient(135deg,
        var(--kz-sidebar-bg,#0D1B12) 0%,
        var(--kz-primary,#3D9E0F) 100%) !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   11. TABLES MUD DANS TOUT LE MODULE COMPTABILITÉS
       Têtes de colonne → CECF gradient
───────────────────────────────────────────────────────────────────────── */
/* On cible les MudTable dans les pages Comptabilites via le contexte */
body .mud-table-container .mud-table-head .mud-table-cell {
    background: linear-gradient(90deg,
        var(--kz-sidebar-bg,#0D1B12),
        var(--kz-primary,#3D9E0F)) !important;
    color: white !important;
    font-weight: 600 !important;
    font-size: .72rem !important;
    text-transform: uppercase !important;
    letter-spacing: .5px !important;
}

/* Zebra rows CECF tint */
body .mud-table-body .mud-table-row:nth-child(even) {
    background: rgba(61,158,15,.02) !important;
}

body .mud-table-body .mud-table-row:hover {
    background: rgba(61,158,15,.05) !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   12. CHARGEMENT / DÉPENSE DIALOG / ADD OPERATION DIALOG
───────────────────────────────────────────────────────────────────────── */
body .charger-header,
body .depense-header {
    background: linear-gradient(135deg,
        var(--kz-sidebar-bg,#0D1B12) 0%,
        var(--kz-primary,#3D9E0F) 100%) !important;
    color: white !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   13. OVERRIDES MudBlazor PRIMARY DANS LE MODULE
───────────────────────────────────────────────────────────────────────── */
/* Les MudPaper avec gradient bleu inline restent couverts par les edits directs.
   Ici on s'assure que MudButton Primary dans ce module est CECF. */
body .comptabilite-page .mud-button-filled-primary {
    background: linear-gradient(135deg,
        var(--kz-primary-dark,#1F6B0A),
        var(--kz-primary,#3D9E0F)) !important;
}
