@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Playfair+Display:ital,wght@0,600;0,800;1,600&display=swap');

/* =========================================
   DASHBOARD & ADMIN — WHITE GLASSMORPHISM
========================================= */

:root {
    --primary: #0097b2;
    --secondary: #e53935;
    --accent: #6200ea;
    --gold: #ffc032;
    --bg: #f0f4f8;
    --text: #1a1e23;
    --text-muted: #6b7280;
    --white: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 12px 40px rgba(31, 38, 135, 0.08);
    --glass-blur: blur(24px);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --sidebar-width: 280px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body.dashboard-body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
}

.sidebar-toggle-fab { display: none; }

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 30, 0.3);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--white);
    border-right: 1px solid rgba(0,0,0,0.06);
    padding: 30px 0;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0,0,0,0.03);
}

.sidebar-logo {
    padding: 0 30px 30px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

.sidebar-logo img {
    height: 50px;
}

.sidebar-logo .logo-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 5px;
}

.sidebar-nav {
    flex: 1;
    padding: 0 15px;
}

.nav-section {
    margin-bottom: 25px;
}

.nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    padding: 0 15px;
    margin-bottom: 10px;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: 12px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    text-decoration: none;
    position: relative;
}

.nav-item:hover {
    background: rgba(0, 151, 178, 0.06);
    color: var(--primary);
}

.nav-item.active {
    background: rgba(0, 151, 178, 0.1);
    color: var(--primary);
    font-weight: 700;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}

.nav-item i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 700;
}

.sidebar-footer {
    padding: 20px 30px;
    border-top: 1px solid rgba(0,0,0,0.06);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gold);
}

.user-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 1rem;
}

.user-name {
    font-weight: 700;
    font-size: 0.9rem;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* =========================================
   MAIN CONTENT
========================================= */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 40px;
    min-height: 100vh;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 800;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 5px;
}

/* =========================================
   GLASS CARDS
========================================= */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    padding: 30px;
    transition: var(--transition);
}

.glass-card:hover {
    box-shadow: 0 20px 50px rgba(31, 38, 135, 0.12);
}

/* =========================================
   STAT CARDS
========================================= */
/* DASHBOARD TOP LAYOUT (NEW) */
.dashboard-top-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    margin-bottom: 15px; /* Réduit pour coller les deux sections */
    align-items: start;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.activity-sidebar {
    height: 310px; /* Alignement mathématique : (145px * 2) + 20px gap */
}

.activity-sidebar .glass-card {
    height: 100%; /* Occupe toute la hauteur fixée */
    display: flex;
    flex-direction: column;
    padding: 20px 25px; /* Padding optimisé */
}

.activity-feed {
    flex: 1; /* Prend tout l'espace restant dans les 310px */
    overflow-y: auto;
    padding-right: 5px;
}

@media (max-width: 1200px) {
    .activity-feed {
        max-height: 380px; /* Plus d'espace quand c'est sur une seule colonne */
    }
}

@media (max-width: 1200px) {
    .dashboard-top-layout {
        grid-template-columns: 1fr;
    }
    
    .activity-sidebar {
        order: 2;
    }
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: var(--white);
    border-radius: 20px;
    padding: 20px;
    box-shadow: var(--glass-shadow);
    border: 1px solid rgba(0,0,0,0.04);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    height: 145px; /* Hauteur stabilisée */
    display: flex;
    flex-direction: column;
    justify-content: center;
    cursor: pointer;
}

.clickable-row {
    cursor: pointer;
    transition: var(--transition);
}

.clickable-row:hover {
    background: rgba(0, 151, 178, 0.05) !important;
}

.data-table td a {
    position: relative;
    z-index: 2; /* S'assurer que les liens internes restent prioritaires */
}

.data-table td button {
    position: relative;
    z-index: 2;
}

@media (max-width: 768px) {
    .stat-card {
        height: 120px; /* Plus compact sur mobile */
    }
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    border-radius: 0 20px 0 100%;
    opacity: 0.1;
}

.stat-card.primary::after { background: var(--primary); }
.stat-card.success::after { background: var(--success); }
.stat-card.warning::after { background: var(--warning); }
.stat-card.danger::after { background: var(--danger); }

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.06);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.stat-icon.primary { background: rgba(0, 151, 178, 0.1); color: var(--primary); }
.stat-icon.success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.stat-icon.warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.stat-icon.danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 4px;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

/* =========================================
   TABLES
========================================= */
.data-table-wrapper {
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    border: 1px solid rgba(0,0,0,0.04);
    overflow: hidden;
}

.scrollable-table {
    max-height: 400px;
    overflow-y: auto !important;
}

.scrollable-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.table-title {
    font-weight: 700;
    font-size: 1.1rem;
}

.table-actions {
    display: flex;
    gap: 10px;
}

.search-input {
    padding: 10px 16px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    background: var(--bg);
    transition: var(--transition);
    min-width: 250px;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 151, 178, 0.1);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    padding: 15px 20px;
    text-align: left;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
    background: var(--bg);
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.data-table td {
    padding: 18px 20px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    font-size: 0.95rem;
}

/* ZEBRA STRIPING */
.data-table tbody tr:nth-child(odd) {
    background: rgba(0, 0, 0, 0.015);
}

.data-table tbody tr:nth-child(even) {
    background: var(--white);
}

.data-table tr:hover {
    background: rgba(0, 151, 178, 0.04) !important;
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* =========================================
   BADGES
========================================= */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.badge-info { background: rgba(59, 130, 246, 0.1); color: var(--info); }
.badge-primary { background: rgba(0, 151, 178, 0.1); color: var(--primary); }
.badge-gold { background: rgba(255, 192, 50, 0.15); color: #b8860b; }

/* =========================================
   BUTTONS
========================================= */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    background: var(--primary);
    color: white;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary:hover {
    background: #007a93;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 151, 178, 0.3);
}

.btn-gold {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    background: var(--gold);
    color: #1a1e23;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-gold:hover {
    background: #e6a800;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 192, 50, 0.3);
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    background: var(--danger);
    color: white;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid rgba(0,0,0,0.12);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-outline:hover {
    background: var(--bg);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
    border-radius: 8px;
}

/* =========================================
   FORMS
========================================= */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text);
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    background: var(--white);
    transition: var(--transition);
    color: var(--text);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 151, 178, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* =========================================
   ALERTS / TOASTS
========================================= */
.alert {
    padding: 18px 24px;
    border-radius: 14px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.alert-success { background: rgba(16, 185, 129, 0.1); color: #065f46; border: 1px solid rgba(16, 185, 129, 0.2); }
.alert-warning { background: rgba(245, 158, 11, 0.1); color: #92400e; border: 1px solid rgba(245, 158, 11, 0.2); }
.alert-danger { background: rgba(239, 68, 68, 0.1); color: #991b1b; border: 1px solid rgba(239, 68, 68, 0.2); }
.alert-info { background: rgba(59, 130, 246, 0.1); color: #1e40af; border: 1px solid rgba(59, 130, 246, 0.2); }

.alert-pending {
    background: linear-gradient(135deg, rgba(255, 192, 50, 0.1), rgba(255, 192, 50, 0.05));
    border: 1px solid rgba(255, 192, 50, 0.3);
    color: #92400e;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 30px;
}

/* =========================================
   MEMBER CARD (QR Section)
========================================= */
.member-card-mini {
    background: linear-gradient(135deg, var(--white), #fefce8);
    border: 2px solid var(--gold);
    border-radius: 24px;
    padding: 35px;
    text-align: center;
    box-shadow: 0 12px 40px rgba(255, 192, 50, 0.15);
    position: relative;
    overflow: hidden;
}

.member-card-mini::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 120px;
    height: 120px;
    background: var(--gold);
    opacity: 0.1;
    border-radius: 50%;
}

.member-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--gold);
    margin: 0 auto 20px;
    display: block;
    box-shadow: 0 10px 25px rgba(255, 192, 50, 0.2);
}

.member-photo-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e5e7eb, #d1d5db);
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    border: 4px solid var(--gold);
}

.member-name { font-size: 1.4rem; font-weight: 800; color: var(--text); }
.member-title { font-size: 0.95rem; font-weight: 700; color: var(--text-muted); margin-top: 4px; }
.member-ministry { font-size: 0.9rem; color: var(--text-muted); margin-top: 2px; }

.member-id {
    display: inline-block;
    background: rgba(255, 192, 50, 0.15);
    color: #b8860b;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    margin-top: 15px;
}

#qrcode {
    display: flex;
    justify-content: center;
    margin: 25px 0;
}

/* =========================================
   VERIFICATION PAGE
========================================= */
.verify-container {
    max-width: 600px;
    margin: 60px auto;
    padding: 0 20px;
}

.verify-card {
    background: var(--white);
    border-radius: 30px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.08);
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.04);
}

.verify-header {
    padding: 40px;
    text-align: center;
    position: relative;
}

.verify-header.certified {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(16, 185, 129, 0.02));
    border-bottom: 3px solid var(--success);
}

.verify-header.expired {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05), rgba(245, 158, 11, 0.02));
    border-bottom: 3px solid var(--warning);
}

.verify-header.invalid {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), rgba(239, 68, 68, 0.02));
    border-bottom: 3px solid var(--danger);
}

.verify-seal {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2.5rem;
    animation: sealPulse 2s infinite ease-in-out;
}

.verify-seal.certified { background: rgba(16, 185, 129, 0.1); }
.verify-seal.expired { background: rgba(245, 158, 11, 0.1); }
.verify-seal.invalid { background: rgba(239, 68, 68, 0.1); }

@keyframes sealPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.verify-body {
    padding: 40px;
}

.verify-info-row {
    display: flex;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.verify-info-label {
    color: var(--text-muted);
    font-weight: 500;
}

.verify-info-value {
    font-weight: 700;
    text-align: right;
}

/* =========================================
   LOGIN / REGISTER PAGES
========================================= */
.auth-page {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 20px;
    position: relative;
}

.auth-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 20% 30%, rgba(0, 151, 178, 0.08), transparent 50%),
                radial-gradient(circle at 80% 70%, rgba(255, 192, 50, 0.08), transparent 50%);
    pointer-events: none;
}

.auth-card {
    max-width: 460px;
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 50px 40px;
    box-shadow: var(--glass-shadow);
    position: relative;
    z-index: 1;
}

.auth-logo {
    text-align: center;
    margin-bottom: 35px;
}

.auth-logo img {
    height: 60px;
}

.auth-title {
    text-align: center;
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 35px;
}

.auth-footer {
    text-align: center;
    margin-top: 25px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

/* AUTH UI ENHANCEMENTS */
.btn-back-home {
    position: absolute;
    top: 25px;
    left: 25px;
    width: 42px;
    height: 42px;
    background: var(--white);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.btn-back-home:hover {
    color: var(--primary);
    border-color: var(--primary);
    transform: translateX(-3px);
    box-shadow: 0 6px 15px rgba(0, 151, 178, 0.15);
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    left: 18px;
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    pointer-events: none;
    transition: var(--transition);
}

.input-with-icon .form-input {
    padding-left: 52px;
}

.input-with-icon .form-input:focus + i {
    color: var(--primary);
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.forgot-link {
    font-size: 0.85rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-submit {
    width: 100%;
    justify-content: center;
    padding: 18px !important;
    margin-top: 10px;
    font-size: 1rem !important;
}

.animate-fade-in {
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* DASHBOARD COMPONENTS */
.actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.action-card {
    display: flex;
    flex-direction: column;
}

.action-card-title {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
}

.action-card-title i {
    color: var(--primary);
}

.action-card-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
    flex: 1;
}

.profile-summary-card {
    margin-top: 20px;
}

.profile-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.profile-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.profile-details-grid p {
    font-size: 0.95rem;
}

/* PROFILE PAGE COMPONENTS */
.profile-edit-card, .profile-security-card {
    max-width: 700px;
}

.profile-photo-section {
    text-align: center;
    margin-bottom: 35px;
}

.photo-upload-group {
    margin-top: 15px;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.submit-btn-full {
    width: 100%;
    justify-content: center;
}

.card-title-small {
    font-size: 1.2rem;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ADMIN UTILITIES */
.filters-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.filters-chips {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-form {
    flex: 1;
    max-width: 400px;
}

.search-group {
    display: flex;
    gap: 10px;
}

.member-info-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.member-name-text {
    font-weight: 700;
}

.member-sub-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.mobile-only-title {
    display: none;
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
}

.table-actions-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* RESPONSIVE TABLES REVOLUTION */
.data-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 15px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .responsive-table thead {
        display: none; /* Masquer les en-têtes classiques */
    }

    .responsive-table tr {
        display: block;
        padding: 20px;
        border-bottom: 1px solid rgba(0,0,0,0.06);
        background: var(--white);
        margin-bottom: 10px;
        border-radius: 15px;
    }

    .responsive-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0 !important;
        border: none !important;
        text-align: right;
        font-size: 0.95rem;
    }

    .responsive-table td::before {
        content: attr(data-label);
        font-weight: 700;
        text-align: left;
        color: var(--text-muted);
        font-size: 0.8rem;
        text-transform: uppercase;
        letter-spacing: 1px;
        margin-right: 20px;
    }

    .responsive-table td:last-child {
        border-bottom: none;
    }

    /* Exceptions pour les cellules d'info riches */
    .responsive-table td.full-width-mobile {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .responsive-table td.full-width-mobile::before {
        margin-bottom: 8px;
    }

    .member-info-cell {
        width: 100%;
    }
}

/* TABS UTILITIES */
.tabs-container {
    margin-bottom: 30px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.tabs-chips {
    display: flex;
    gap: 12px;
    min-width: max-content;
}

.mobile-only-date {
    display: none;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* MODAL RESPONSIVE */
.modal {
    padding: 20px;
}

@media (max-width: 768px) {
    .modal-content-wrapper {
        max-width: 100% !important;
        margin: 0 !important;
    }
    
    .modal-body {
        padding: 20px !important;
    }
}

/* FORCE AVATAR SIZES (Prevents huge images in tables) */
.table-avatar, .member-info-cell img {
    width: 40px !important;
    height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    flex-shrink: 0 !important;
}

/* SIDEBAR & MOBILE HEIGHTS */
@media (max-width: 768px) {
    body.sidebar-open {
        overflow: hidden !important;
        height: 100dvh !important; /* Dynamic Viewport Height */
        position: fixed;
        width: 100%;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: var(--transition);
        z-index: 2001;
        width: 280px;
        max-width: 85%;
        box-shadow: 20px 0 50px rgba(0,0,0,0.1);
        overflow-y: auto !important;
        height: 100dvh !important;
        padding-bottom: 80px; /* Space for browser UI */
        top: 0;
        left: 0;
        position: fixed;
        display: flex;
        flex-direction: column;
    }
    
    .sidebar-nav {
        padding-bottom: 40px; /* Extra padding for last items */
    }
}

/* MODAL RESPONSIVE REVOLUTION */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 30, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10000;
    display: none; /* Contrôlé par JS flex/none */
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.modal-content-wrapper {
    background: var(--white);
    width: 100%;
    max-width: 700px;
    max-height: 90dvh;
    border-radius: 28px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0,0,0,0.25);
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    background: var(--primary);
    padding: 20px 30px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
}

.modal-close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    background: rgba(255,255,255,0.25);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.modal-footer {
    padding: 20px 30px;
    background: #f9fafb;
    border-top: 1px solid rgba(0,0,0,0.05);
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .modal {
        padding: 10px;
        align-items: flex-end; /* Coller en bas sur mobile pour accessibilité pouce */
    }

    .modal-content-wrapper {
        max-height: 85dvh;
        border-radius: 24px 24px 0 0; /* Design "Sheet" moderne */
    }

    .modal-body {
        padding: 20px;
    }

    .modal-footer {
        flex-direction: column;
        padding: 15px 20px 30px;
    }

    .modal-footer button {
        width: 100%;
        justify-content: center;
        padding: 15px !important;
    }
}

/* UI Helpers inside Modal */
.info-box-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.info-box {
    padding: 15px;
    background: #f3f4f6;
    border-radius: 15px;
}

.info-box-label {
    font-size: 0.75rem;
    color: #666;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 5px;
    display: block;
}

.info-box-value {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    word-break: break-all;
}

@media (max-width: 600px) {
    .info-box-grid {
        grid-template-columns: 1fr;
    }
}

/* PAGINATION */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding: 20px 0;
    flex-wrap: wrap;
    gap: 20px;
}

.pagination-info {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.pagination-btns {
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-numbers {
    display: flex;
    gap: 5px;
}

.page-num {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    background: var(--white);
    border: 1px solid rgba(0,0,0,0.05);
    font-weight: 600;
    transition: var(--transition);
}

.page-num:hover {
    background: var(--bg);
    border-color: var(--primary);
    color: var(--primary);
}

.page-num.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* SORTING STYLES */
.sortable-header {
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}

.sortable-header:hover {
    background: rgba(0, 151, 178, 0.05) !important;
    color: var(--primary);
}

.sort-icon-muted {
    opacity: 0.3;
    width: 14px;
    margin-left: 5px;
    vertical-align: middle;
}

.sort-icon-active {
    color: var(--primary);
    width: 14px;
    margin-left: 5px;
    vertical-align: middle;
}

.mobile-only-certification {
    display: none;
    font-size: 0.7rem;
    font-weight: 700;
    margin-top: 5px;
}

@media (max-width: 768px) {
    .mobile-only-certification {
        display: block;
    }
}

@media (max-width: 600px) {
...
    .pagination-container {
        flex-direction: column;
        text-align: center;
    }
}

/* ACTIVITY FEED */
.activity-feed {
    max-height: 380px;
    overflow-y: auto;
    padding-right: 10px;
}

/* Scrollbar personnalisée pour le flux */
.activity-feed::-webkit-scrollbar { width: 4px; }
.activity-feed::-webkit-scrollbar-track { background: transparent; }
.activity-feed::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.05); border-radius: 10px; }

.activity-item {
    display: flex;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0,0,0,0.03);
    align-items: flex-start;
    transition: var(--transition);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    min-width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 151, 178, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.activity-icon i {
    width: 18px;
    height: 18px;
}

.activity-details {
    flex: 1;
    min-width: 0; /* Important pour le tronquage */
}

.activity-actor {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.activity-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 2px 0;
}

.activity-target {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.8rem;
}

.activity-meta {
    display: flex;
    gap: 10px;
    font-size: 0.75rem;
    color: #999;
    margin-top: 4px;
}

.activity-ip {
    font-family: monospace;
    background: #f3f4f6;
    padding: 1px 6px;
    border-radius: 4px;
}

/* BREADCRUMBS */
.breadcrumb {
    margin-bottom: 25px;
}

.breadcrumb ol {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0;
    font-size: 0.85rem;
}

.breadcrumb li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
}

.breadcrumb li a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb li a:hover {
    color: var(--primary);
}

.breadcrumb li i {
    width: 14px;
    height: 14px;
    opacity: 0.5;
}

.breadcrumb li[aria-current="page"] {
    color: var(--primary);
    font-weight: 700;
}

/* =========================================
   GRID LAYOUTS
========================================= */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.grid-sidebar { display: grid; grid-template-columns: 1fr 2fr; gap: 40px; align-items: start; }

/* =========================================
   RESPONSIVE
========================================= */
@media (max-width: 1024px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 20px; }
    .grid-sidebar { grid-template-columns: 1fr; }
    .main-content { padding: 30px 20px; }
}

@media (max-width: 768px) {
    body.dashboard-body {
        flex-direction: column;
    }

    .sidebar-toggle-fab {
        display: flex;
        position: fixed;
        bottom: 30px;
        right: 30px;
        width: 60px;
        height: 60px;
        background: var(--primary);
        color: white;
        border-radius: 50%;
        align-items: center;
        justify-content: center;
        z-index: 2000;
        box-shadow: 0 10px 25px rgba(0, 151, 178, 0.4);
        border: none;
        cursor: pointer;
        transition: var(--transition);
    }

    .sidebar-toggle-fab:active {
        transform: scale(0.9);
    }

    .sidebar-toggle-fab i {
        width: 28px;
        height: 28px;
    }

    body.sidebar-open .sidebar-toggle-fab {
        display: none;
    }

    body.sidebar-open {
        overflow: hidden !important;
        height: 100vh;
        width: 100%;
        position: fixed;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: var(--transition);
        z-index: 2001;
        width: 280px;
        max-width: 85%;
        box-shadow: 20px 0 50px rgba(0,0,0,0.1);
        overflow-y: auto !important; /* Forcer le scroll interne */
        height: 100% !important; /* Utiliser toute la hauteur disponible */
        top: 0;
        left: 0;
        position: fixed;
        display: flex;
        flex-direction: column;
    }
    
    .sidebar.open { transform: translateX(0); }
    
    .main-content { 
        margin-left: 0; 
        padding: 40px 20px 100px; 
    }

    .stats-grid { grid-template-columns: 1fr; gap: 15px; }
    .page-title { font-size: 1.5rem; }
    .auth-card { padding: 35px 20px; }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .btn-primary { width: 100%; justify-content: center; }

    /* DASHBOARD MOBILE ADJUSTMENTS */
    .actions-grid {
        grid-template-columns: 1fr;
    }

    .profile-details-grid {
        grid-template-columns: 1fr;
    }
    
    .member-card-mini {
        padding: 25px 15px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .hide-mobile {
        display: none !important;
    }

    .mobile-only-title {
        display: block;
    }

    .mobile-only-date {
        display: block;
    }

    .search-form {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .page-title { font-size: 1.3rem; }
    .glass-card { padding: 20px; }
}

/* =========================================
   CUSTOM CONFIRM DIALOG
========================================= */
.custom-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 30, 0.4);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.custom-confirm-overlay.show {
    opacity: 1;
    visibility: visible;
}

.custom-confirm-card {
    background: var(--white);
    width: 100%;
    max-width: 420px;
    border-radius: 24px;
    padding: 35px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-confirm-overlay.show .custom-confirm-card {
    transform: scale(1);
}

.confirm-icon {
    width: 60px;
    height: 60px;
    background: rgba(0, 151, 178, 0.1);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.confirm-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--text);
}

.confirm-message {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

.confirm-actions {
    display: flex;
    gap: 15px;
}

.confirm-actions button {
    flex: 1;
    padding: 14px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-confirm-yes {
    background: var(--primary);
    color: white;
    border: none;
}

.btn-confirm-yes:hover {
    background: #007a93;
    transform: translateY(-2px);
}

.btn-confirm-no {
    background: #f3f4f6;
    color: var(--text);
    border: 1px solid rgba(0,0,0,0.05);
}

.btn-confirm-no:hover {
    background: #e5e7eb;
}
