/* Variables de Couleurs Néo-Futuristes / Cyberpunk soft */
:root {
    --bg-dark: #0b0f19;
    --bg-card: #131a26;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --primary: #6366f1; /* Indigo */
    --success: #10b981; /* Émeraude */
    --warning: #f59e0b; /* Ambre */
    --danger: #ef4444;  /* Rouge Rose */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- BARRE LATÉRALE (SIDEBAR) --- */
.sidebar {
    width: 260px;
    background-color: var(--bg-card);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    padding: 2rem 1rem;
    position: fixed;
    height: 100vh;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: #fff;
}

.logo i {
    color: var(--primary);
    text-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.logo span span {
    color: var(--primary);
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-links li a {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-links li.active a, .nav-links li a:hover {
    background-color: rgba(99, 102, 241, 0.15);
    color: #fff;
    box-shadow: inset 0 0 10px rgba(99, 102, 241, 0.1);
}

.user-profile {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), #a855f7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.user-info h4 { font-size: 0.9rem; }
.user-info p { font-size: 0.8rem; color: var(--text-muted); }

/* --- CONTENU PRINCIPAL --- */
.main-content {
    margin-left: 260px;
    flex: 1;
    width: calc(100% - 260px);
    padding: 2rem 3rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.magic-text {
    background: linear-gradient(to right, #6366f1, #a855f7, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.badge {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge i {
    margin-right: 5px;
}

/* --- CARTES DE STATISTIQUES --- */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background-color: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.stat-card:hover {
    transform: translateY(-5px);
}

.card-icon {
    font-size: 1.8rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.card-data h3 { font-size: 1.8rem; font-weight: 700; }
.card-data p { color: var(--text-muted); font-size: 0.85rem; }

/* Effets de lueur magique */
.blue-glow { border-left: 4px solid var(--primary); box-shadow: 0 4px 20px rgba(99, 102, 241, 0.05); }
.blue-glow .card-icon { background: rgba(99, 102, 241, 0.1); color: var(--primary); }

.green-glow { border-left: 4px solid var(--success); box-shadow: 0 4px 20px rgba(16, 185, 129, 0.05); }
.green-glow .card-icon { background: rgba(16, 185, 129, 0.1); color: var(--success); }

.yellow-glow { border-left: 4px solid var(--warning); box-shadow: 0 4px 20px rgba(245, 158, 11, 0.05); }
.yellow-glow .card-icon { background: rgba(245, 158, 11, 0.1); color: var(--warning); }

.red-glow { border-left: 4px solid var(--danger); box-shadow: 0 4px 20px rgba(239, 68, 68, 0.05); }
.red-glow .card-icon { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

/* --- CONTENEUR DU TABLEAU --- */
.table-container {
    background-color: var(--bg-card);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    outline: none;
    transition: all 0.3s ease;
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    color: var(--text-muted);
    font-weight: 600;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

td {
    padding: 1.2rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    font-size: 0.95rem;
}

tr:hover td {
    background-color: rgba(255, 255, 255, 0.01);
}

/* Pilules de statut */
.status-pill {
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: bold;
    display: inline-block;
}
.status-pill.dispo { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.status-pill.active { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.status-pill.block { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

/* Boutons d'action */
.btn-action {
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-block {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn-block:hover { background: var(--danger); color: #fff; }

.btn-unblock {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}
.btn-unblock:hover { background: var(--success); color: #fff; }

/* --- BOUTON GÉNÉRER --- */
.btn-generate {
    background: linear-gradient(135deg, var(--primary), #a855f7);
    color: #fff;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

/* --- SYSTÈME DE POP-UP (MODAL) --- */
.modal {
    display: none; /* Caché par défaut */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px); /* Floute l'arrière-plan */
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: scaleUp 0.3s ease;
}

@keyframes scaleUp {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}

.close-modal {
    font-size: 1.8rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover { color: var(--danger); }

.modal-body {
    padding: 1.5rem;
}

.modal-body p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.input-group select {
    width: 100%;
    padding: 0.8rem;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    outline: none;
    font-size: 1.05rem;
}

.btn-confirm-generation {
    width: 100%;
    background: var(--success);
    color: #fff;
    border: none;
    padding: 0.8rem;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.2s;
}

.btn-confirm-generation:hover { background: #059669; }
/* --- SÉCURITÉ : ÉCRAN DE LOG-IN --- */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.login-card {
    background-color: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2.5rem;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(99, 102, 241, 0.05);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header i {
    font-size: 2.5rem;
    color: var(--primary);
    text-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
    margin-bottom: 1rem;
}

.login-header h2 {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.login-alert {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-form .input-group {
    margin-bottom: 1.2rem;
}

.login-form .input-group input {
    width: 100%;
    padding: 0.8rem;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #fff;
    outline: none;
    transition: all 0.3s;
}

.login-form .input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.btn-login {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), #a855f7);
    color: #fff;
    border: none;
    padding: 0.8rem;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
    transition: all 0.2s;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}
/* Styles pour la table de l'équipe */
.badge-role {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-main);
}
.btn-revoke {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}
.btn-revoke:hover { background: var(--danger); color: #fff; }

.btn-restore {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid var(--success);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}
.btn-restore:hover { background: var(--success); color: #fff; }
.perf-badge {
    background: rgba(99, 102, 241, 0.15);
    color: #a855f7;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}
/* --- STYLE DU TERMINAL DE LOGS --- */
.log-line {
    padding: 0.4rem 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    display: flex;
    gap: 15px;
}
.log-time { color: #6b7280; font-weight: bold; }
.log-user { color: #3b82f6; font-weight: bold; }
.log-action { color: #f3f4f6; }
.log-line.danger-action .log-action { color: #f43f5e; }
.log-line.success-action .log-action { color: #10b981; }

/* =========================================================================
   SÉCURITÉ : FENÊTRE DE DÉCONNEXION CYBER-MAGIQUE (CORRIGÉE)
   ========================================================================= */

/* Forcer l'affichage du fond noir flouté sur tout l'écran */
#logout-modal {
    display: none; /* Géré par le JavaScript */
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(4, 7, 13, 0.85) !important; /* Fond très sombre */
    backdrop-filter: blur(10px) !important; /* Floutage magique de l'arrière-plan */
    z-index: 99999 !important; /* Passe au-dessus de TOUT le reste */
    align-items: center !important;
    justify-content: center !important;
}

/* La boîte centrale du Pop-up */
#logout-modal .modal-content {
    background: #111622 !important; /* Fond carte sombre */
    border: 1px solid rgba(239, 68, 68, 0.3) !important; /* Bordure néon rouge */
    border-radius: 24px !important;
    padding: 3rem 2rem !important;
    width: 90% !important;
    max-width: 420px !important;
    margin: auto !important;
    box-shadow: 0 0 50px rgba(239, 68, 68, 0.25), 
                inset 0 0 20px rgba(239, 68, 68, 0.05) !important;
    animation: cyberPopupEntrance 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards !important;
}

/* Animation d'apparition dynamique */
@keyframes cyberPopupEntrance {
    from { transform: scale(0.85) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

/* Icône d'alimentation avec effet halo électrique pulsant */
.logout-icon-glow {
    width: 80px !important;
    height: 80px !important;
    background: rgba(239, 68, 68, 0.08) !important;
    color: #ef4444 !important;
    font-size: 2.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    margin: 0 auto 1.5rem auto !important;
    border: 1px solid rgba(239, 68, 68, 0.4) !important;
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.3) !important;
    animation: cyberPulse 2s infinite ease-in-out !important;
}

@keyframes cyberPulse {
    0% { transform: scale(1); box-shadow: 0 0 25px rgba(239, 68, 68, 0.3); }
    50% { transform: scale(1.05); box-shadow: 0 0 45px rgba(239, 68, 68, 0.6); color: #ff6b6b; }
    100% { transform: scale(1); box-shadow: 0 0 25px rgba(239, 68, 68, 0.3); }
}

/* Boutons interactifs du Pop-up */
#logout-modal .btn-action {
    padding: 0.8rem 1.8rem !important;
    font-size: 0.95rem !important;
    border-radius: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    cursor: pointer !important;
    font-weight: 600 !important;
    border: none !important;
    transition: all 0.3s ease !important;
}

/* Bouton Annuler (Vert Émeraude subtil) */
#logout-modal .btn-unblock {
    background: rgba(16, 185, 129, 0.08) !important;
    color: #10b981 !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
}
#logout-modal .btn-unblock:hover {
    background: #10b981 !important;
    color: #fff !important;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4) !important;
    transform: translateY(-2px) !important;
}

/* Bouton Déconnexion (Rouge Électrique Solide) */
#logout-modal .btn-block {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #ef4444 !important;
    border: 1px solid rgba(239, 68, 68, 0.5) !important;
}
#logout-modal .btn-block:hover {
    background: linear-gradient(135deg, #ef4444, #b91c1c) !important;
    color: #fff !important;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.5) !important;
    transform: translateY(-2px) !important;
}

/* Badge de compteur (paiements en attente) */
.badge-count {
    display: inline-block;
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
    margin-left: 0.4rem;
}
