/* ==========================================================================
   MODULE 20 - SÉCURITÉ, AUDIT & GOUVERNANCE (DESKTOP)
   Harmonie Palette FINAGECO : Clair #9fd2fc / Sombre #0A192F / Bordures #9e743d
   ========================================================================== */

.m20-wrapper {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
}

.m20-header-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    gap: 14px;
    flex-wrap: wrap;
}

.m20-header-left h2 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 2px;
}

.m20-header-left p {
    font-size: 12px;
    color: var(--text-muted-col);
}

.m20-tabs-nav {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    background: var(--bg-card-inner);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 4px;
    gap: 4px;
    width: 100%;
    max-width: 860px;
}

.m20-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted-col);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    white-space: nowrap;
}

.m20-tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 122, 0, 0.08);
}

.m20-tab-btn.active {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
    color: #ffffff;
    box-shadow: var(--shadow-xs);
}

/* Grille des 4 KPIs sur UNE SEULE ligne (repeat 4, 1fr) */
.m20-kpi-bar {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 16px !important;
    width: 100%;
}

.m20-kpi-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.m20-kpi-card:hover {
    transform: translateY(-2px);
    border-color: var(--secondary);
    box-shadow: 0 8px 18px rgba(0,0,0,0.1);
}

.m20-kpi-info h4 {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted-col);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.m20-kpi-info .val {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
}

.m20-kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.m20-content-box {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
}

.m20-table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    gap: 12px;
    flex-wrap: wrap;
}

.m20-search-input {
    background: var(--bg-card-inner);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    color: var(--text-main);
    font-size: 12.5px;
    outline: none;
    min-width: 280px;
}

.m20-table-responsive {
    width: 100%;
    overflow-x: auto;
    max-height: 480px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.m20-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    text-align: left;
}

.m20-table th {
    background: var(--bg-card-inner);
    color: var(--text-muted-col);
    font-weight: 700;
    padding: 10px 12px;
    border-bottom: 1.5px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.m20-table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.m20-table tr:hover td {
    background: rgba(255, 122, 0, 0.04);
}

.btn-m20-action {
    background: var(--bg-card-inner);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition-fast);
}

.btn-m20-action:hover {
    border-color: var(--secondary);
    color: var(--secondary);
}

.btn-m20-primary {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

/* Certificat d'Audit et Procès-Verbal PDF A4 */
.audit-cert-paper {
    background: #ffffff;
    color: #0f172a;
    border-radius: 12px;
    padding: 26px;
    border: 2px solid #9e743d;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    font-family: inherit;
    position: relative;
    max-width: 760px;
    margin: 0 auto;
}

.audit-cert-header-top {
    border-bottom: 2px solid #9e743d;
    padding-bottom: 12px;
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media print {
    body * { visibility: hidden !important; }
    .modal-overlay.active .audit-cert-paper, .modal-overlay.active .audit-cert-paper * {
        visibility: visible !important;
    }
    .modal-overlay.active .audit-cert-paper {
        position: absolute !important; left: 0 !important; top: 0 !important; width: 100% !important; max-width: 100% !important;
        box-shadow: none !important; border: 1px solid #000 !important; padding: 0 !important;
    }
}
