/* ═══════════════════════════════════════════════════════════════════════════
   CREDITS.CSS — Module Crédits — 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 (#0d1b6e, #1a237e, #1565c0) → CECF vert.
═══════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────────
   1. CONTAINERS PRINCIPAUX — Fond blanc
───────────────────────────────────────────────────────────────────────── */
body .approval-container,
body .dec-container,
body .credit-container,
body .report-body {
    background: #ffffff !important;
    border-radius: 16px;
}

/* ─────────────────────────────────────────────────────────────────────────
   2. HERO / EN-TÊTES — Gradient CECF (remplace gradient bleu)
───────────────────────────────────────────────────────────────────────── */
body .approval-header,
body .dec-header,
body .app-header,
body .table-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,.25) !important;
}

/* Pseudo-éléments décoratifs */
body .approval-header::before,
body .dec-header::before,
body .app-header::before {
    border-color: rgba(255,255,255,.06) !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   3. CONTENUS PRINCIPAUX
───────────────────────────────────────────────────────────────────────── */
body .approval-main,
body .dec-main {
    background: #ffffff !important;
    border-color: rgba(61,158,15,.12) !important;
    box-shadow: 0 2px 12px rgba(61,158,15,.08) !important;
}

body .dec-body {
    background: #f9fdfb !important;
}

body .dec-footer {
    background: #f9fdfb !important;
    border-top-color: rgba(61,158,15,.10) !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   4. TITRES DE SECTIONS
───────────────────────────────────────────────────────────────────────── */
body .section-title {
    color: var(--kz-primary-dark,#1F6B0A) !important;
    border-left-color: var(--kz-secondary,#D6C451) !important;
}

body .credit-card-title {
    color: var(--kz-primary-dark,#1F6B0A) !important;
}

body .page-header-title {
    color: var(--kz-primary-dark,#1F6B0A) !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   5. CARTES INFORMATIONS CRÉDIT
───────────────────────────────────────────────────────────────────────── */
body .credit-card {
    background: #ffffff !important;
    border-color: rgba(61,158,15,.15) !important;
    box-shadow: 0 2px 8px rgba(61,158,15,.06) !important;
}
body .credit-card:hover {
    border-color: var(--kz-primary,#3D9E0F) !important;
    box-shadow: 0 4px 16px rgba(61,158,15,.18) !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   6. STATS CARDS
───────────────────────────────────────────────────────────────────────── */
body .stats-card {
    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 6px 20px rgba(61,158,15,.30) !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   7. STEPPER (DemandeCredit)
───────────────────────────────────────────────────────────────────────── */
body .stepper-container {
    background: #ffffff !important;
    border-bottom-color: rgba(61,158,15,.10) !important;
}

body .stepper-progress::before {
    background: linear-gradient(90deg, rgba(61,158,15,.20), rgba(61,158,15,.10)) !important;
}

body .step-circle.active {
    background: linear-gradient(135deg,
        var(--kz-primary-dark,#1F6B0A),
        var(--kz-primary,#3D9E0F)) !important;
    border-color: var(--kz-primary,#3D9E0F) !important;
    box-shadow: 0 4px 14px rgba(61,158,15,.45), 0 0 0 3px rgba(255,215,64,.20) !important;
}

body .step-circle.inactive {
    background: #f9fdfb !important;
    border-color: rgba(61,158,15,.18) !important;
    color: rgba(61,158,15,.40) !important;
}

body .step-label.active {
    color: var(--kz-primary-dark,#1F6B0A) !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   8. TABS PANELS
───────────────────────────────────────────────────────────────────────── */
body .custom-tabs .mud-tabs-panels {
    background: #f9fdfb !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   9. FORM SECTIONS
───────────────────────────────────────────────────────────────────────── */
body .form-section {
    background: #ffffff !important;
    border-color: rgba(61,158,15,.10) !important;
    box-shadow: 0 2px 12px rgba(61,158,15,.04) !important;
}

body .form-section:hover {
    box-shadow: 0 8px 28px rgba(61,158,15,.12) !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   10. NAVIGATION BUTTONS
───────────────────────────────────────────────────────────────────────── */
body .navigation-buttons {
    border-top-color: rgba(61,158,15,.10) !important;
}

body .btn-primary {
    background: linear-gradient(135deg,
        var(--kz-primary-dark,#1F6B0A),
        var(--kz-primary,#3D9E0F)) !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   11. TABLES AMORTISSEMENT / GARANTIES
───────────────────────────────────────────────────────────────────────── */
body .table-amortissement-container,
body .garanties-container {
    background: #f9fdfb !important;
    border-color: rgba(61,158,15,.12) !important;
    box-shadow: 0 4px 20px rgba(61,158,15,.08) !important;
}

body .amortissement-table,
body .garanties-table {
    border-color: rgba(61,158,15,.12) !important;
}

body .amortissement-table thead,
body .garanties-table thead {
    background: linear-gradient(90deg,
        var(--kz-sidebar-bg,#0D1B12),
        var(--kz-primary,#3D9E0F)) !important;
    color: white !important;
}

body .amortissement-table tbody tr:nth-child(even),
body .garanties-table tbody tr:nth-child(even) {
    background: rgba(61,158,15,.025) !important;
}

body .amortissement-table tbody tr:hover,
body .garanties-table tbody tr:hover {
    background: rgba(61,158,15,.05) !important;
}

body .amortissement-table tbody tr,
body .garanties-table tbody tr {
    border-bottom-color: rgba(61,158,15,.06) !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   12. SECTION BOX (DecaissementCredit)
───────────────────────────────────────────────────────────────────────── */
body .section-box {
    background: #ffffff !important;
    border: 1px solid rgba(61,158,15,.10) !important;
    border-left: 3px solid var(--kz-primary,#3D9E0F) !important;
    box-shadow: 0 2px 8px rgba(61,158,15,.06) !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   13. APPROVAL BADGES
───────────────────────────────────────────────────────────────────────── */
body .stat-badge {
    background: var(--kz-primary,#3D9E0F) !important;
}

body .approval-badge-info {
    background: rgba(61,158,15,.08) !important;
    border-color: rgba(61,158,15,.20) !important;
    color: var(--kz-primary-dark,#1F6B0A) !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   14. TABLE HEADERS RAPPORTS
───────────────────────────────────────────────────────────────────────── */
body .custom-table .mud-table-head .mud-table-cell {
    background: linear-gradient(90deg,
        var(--kz-sidebar-bg,#0D1B12),
        var(--kz-primary,#3D9E0F)) !important;
    color: white !important;
    border-bottom-color: rgba(61,158,15,.20) !important;
}

/* RapportDecaissementGroupe — classes cecco */
body .cecco-card {
    border-color: rgba(61,158,15,.12) !important;
    box-shadow: 0 2px 8px rgba(61,158,15,.06) !important;
}

body .kpi-card {
    background: linear-gradient(135deg,#f0fdf4,#ffffff) !important;
    border-left: 4px solid var(--kz-primary,#3D9E0F) !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   15. SOLDIARES — EncaissementRemboursementJournalier
───────────────────────────────────────────────────────────────────────── */
/* Override CSS variables via higher-specificity rules */
body .input-montant-professionnel:focus-within {
    box-shadow: 0 0 0 3px rgba(61,158,15,.25) !important;
    border-color: var(--kz-primary,#3D9E0F) !important;
}

body .main-table th {
    background: linear-gradient(90deg,
        var(--kz-sidebar-bg,#0D1B12),
        var(--kz-primary,#3D9E0F)) !important;
    color: white !important;
}

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

body .total-amount-highlight {
    color: var(--kz-secondary,#D6C451) !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   16. SOLIDAIRES — FicheRemboursementSolidaire
───────────────────────────────────────────────────────────────────────── */
body .fiche-header {
    border-bottom-color: rgba(61,158,15,.15) !important;
}

body .institution-name {
    color: var(--kz-primary-dark,#1F6B0A) !important;
}

body .main-table td {
    border-bottom-color: rgba(61,158,15,.08) !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   17. RAPPORTS MIITPCS — inline style overrides via MUD table heads
───────────────────────────────────────────────────────────────────────── */
/* Ces pages utilisent des inline styles; on cible les wrappers MudBlazor */
body .mud-table-head .mud-table-cell:has(div[style*="background"]) {
    background: linear-gradient(90deg,
        var(--kz-sidebar-bg,#0D1B12),
        var(--kz-primary,#3D9E0F)) !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   18. BALANCE AGE — Champs sur fond sombre du header
───────────────────────────────────────────────────────────────────────── */
body .bal-header-picker .mud-input-label,
body .bal-header-picker label {
    color: rgba(255,255,255,.80) !important;
}
body .bal-header-picker .mud-input,
body .bal-header-picker .mud-input input {
    color: rgba(255,255,255,.90) !important;
    -webkit-text-fill-color: rgba(255,255,255,.90) !important;
}
body .bal-header-picker .mud-input-adornment .mud-icon-root {
    color: rgba(255,255,255,.75) !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   19. GROUPES SOLIDAIRES
───────────────────────────────────────────────────────────────────────── */
body .bg-primary-light {
    background: rgba(61,158,15,.08) !important;
}

body .bg-table-header {
    background: linear-gradient(90deg,
        var(--kz-sidebar-bg,#0D1B12),
        var(--kz-primary,#3D9E0F)) !important;
    color: white !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   20. RAPPORT DEMANDE CRÉDIT
───────────────────────────────────────────────────────────────────────── */
body .report-body {
    background: #ffffff !important;
}

body .sticky-filters {
    background: #ffffff !important;
    border-bottom: 1px solid rgba(61,158,15,.10) !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   21. REMBOURSEMENT — CreditRemboursementAdd
───────────────────────────────────────────────────────────────────────── */
/* Statut badges — couleurs sémantiques gardées */

/* ─────────────────────────────────────────────────────────────────────────
   22. MUD BUTTONS DANS LE MODULE — couleur primaire → CECF
───────────────────────────────────────────────────────────────────────── */
/* Ciblage via les classes action-button */
body .approval-actions .action-button,
body .action-button.btn-primary {
    background: linear-gradient(135deg,
        var(--kz-primary-dark,#1F6B0A),
        var(--kz-primary,#3D9E0F)) !important;
    box-shadow: 0 4px 14px rgba(61,158,15,.35) !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   23. FICHE REMBOURSEMENT (print page)
───────────────────────────────────────────────────────────────────────── */
/* Garder les styles d'impression intacts; juste changer header dans navigateur */
@media screen {
    body .app-header.print-only { display: none; }

    body .brand-logo {
        background: linear-gradient(135deg,
            var(--kz-primary-dark,#1F6B0A),
            var(--kz-primary,#3D9E0F)) !important;
    }

    body .fin-table thead {
        background: linear-gradient(90deg,
            var(--kz-sidebar-bg,#0D1B12),
            var(--kz-primary,#3D9E0F)) !important;
        color: white !important;
    }

    body .slip-title {
        color: var(--kz-primary-dark,#1F6B0A) !important;
        border-bottom-color: var(--kz-secondary,#D6C451) !important;
    }
}
