/* Nom du fichier : assets/css/style.css */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

:root {
    --bg-color: #F4F7FE; /* Gris/Bleu très clair et lumineux */
    --card-bg: #FFFFFF;
    --text-main: #2B3674; /* Bleu marine très chic */
    --text-muted: #A3AED0;
    --primary-color: #4318FF; /* Bleu électrique Premium */
    --primary-hover: #3311DB;
    --shadow-soft: 0px 18px 40px rgba(112, 144, 176, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

/* --- DESIGN PREMIUM (CONFIANCE & PROFESSIONNALISME) --- */

/* Fond Utilisateurs (Clair, pur, technologique) */
body {
    background: radial-gradient(circle at top left, #F4F7FE 0%, #D9E2F8 100%);
    background-attachment: fixed;
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* Fond Super Admin (Sérieux, puissant, sobre) */
.admin-bg {
    background: radial-gradient(circle at top right, #E2E8F0 0%, #CBD5E1 100%);
    background-attachment: fixed;
}

/* --- AUTHENTIFICATION (Connexion / Inscription) --- */
.auth-container {
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    width: 100%;
    max-width: 450px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 15px;
    border: 1px solid #E0E5F2;
    border-radius: 12px;
    font-size: 14px;
    color: var(--text-main);
    transition: all 0.3s ease;
    background-color: #F4F7FE;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #FFFFFF;
    box-shadow: 0px 0px 0px 3px rgba(67, 24, 255, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 15px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.auth-footer {
    text-align: center;
    margin-top: 25px;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.alert-error {
    background-color: #FFE1E1;
    color: #D32F2F;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: center;
}

/* --- LAYOUT GLOBAL DU DASHBOARD --- */
.dashboard-layout {
    display: flex;
    width: 100%;
    min-height: 100vh;
    background-color: transparent;
}

/* --- MENU LATÉRAL (SIDEBAR) --- */
.sidebar {
    width: 250px;
    background-color: var(--card-bg);
    box-shadow: 2px 0 20px rgba(112, 144, 176, 0.08);
    padding: 30px 20px;
    position: fixed;
    height: 100vh;
    overflow-y: auto; /* Permet de faire glisser le menu s'il est long */
    overflow-x: hidden;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
}

/* Personnalisation de la barre de défilement de la sidebar */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #A3AED0; border-radius: 10px; }

/* Menu latéral Admin spécifique */
.admin-sidebar {
    background: linear-gradient(180deg, #0B1437 0%, #111C44 100%) !important;
    box-shadow: 4px 0 25px rgba(0,0,0,0.15) !important;
    border-right: 1px solid rgba(255,255,255,0.05);
}

.sidebar .logo h2 {
    color: var(--text-main);
    font-size: 24px;
    margin-bottom: 40px;
    text-align: center;
}

.sidebar .logo span {
    color: var(--primary-color);
}

.nav-links {
    list-style: none;
    padding-bottom: 40px; /* Évite que le dernier lien soit collé en bas */
}

.nav-links li {
    margin-bottom: 15px;
}

.nav-links a {
    display: block;
    padding: 12px 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.nav-links a:hover, .nav-links a.active {
    background-color: var(--primary-color);
    color: white;
}

.nav-links a.logout {
    color: #D32F2F;
    background-color: #FFE1E1;
}

.nav-links a.logout:hover {
    background-color: #D32F2F;
    color: white;
}

/* --- ZONE PRINCIPALE (MAIN CONTENT) --- */
.main-content {
    margin-left: 250px;
    padding: 40px;
    width: calc(100% - 250px);
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.top-header h1 {
    font-size: 28px;
    color: var(--text-main);
}

/* --- CARTES & STATISTIQUES --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card, .deposit-card, .queue-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255,255,255,0.8);
}

.stat-card:hover, .deposit-card:hover, .queue-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.08);
}

.stat-card h3 {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 10px;
}

.stat-card .value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-main);
}

.stat-card .value.highlight {
    color: var(--primary-color);
}

/* Bouton hamburger (Caché sur PC) */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-main);
    cursor: pointer;
    margin-bottom: 20px;
    padding: 5px;
}


/* =========================================================
   RESPONSIVE MOBILE ULTIME (Écrans < 768px)
   ========================================================= */
@media (max-width: 768px) {
    /* 1. Affichage du bouton Burger */
    .mobile-toggle { display: block; }
    
    /* 2. Menu latéral caché à gauche et scrollable */
    .sidebar { 
        transform: translateX(-100%); 
        width: 250px; 
        padding-bottom: 120px; 
    }
    
    .sidebar.active { 
        transform: translateX(0); 
    }
    
    /* 3. Adaptation de la zone principale */
    .main-content { 
        margin-left: 0; 
        width: 100%; 
        padding: 20px; 
    }
    
    .stats-grid { 
        grid-template-columns: 1fr; 
    }
    
    .top-header { 
        flex-direction: column; 
        align-items: flex-start; 
        gap: 15px; 
    }

    /* 4. OPTIMISATION DES TABLEAUX EN CARTES (Fini le scroll horizontal !) */
    .mobile-optimized-table table, 
    .mobile-optimized-table thead, 
    .mobile-optimized-table tbody, 
    .mobile-optimized-table th, 
    .mobile-optimized-table td, 
    .mobile-optimized-table tr { 
        display: block; 
    }
    
    .mobile-optimized-table thead tr { 
        position: absolute; 
        top: -9999px; 
        left: -9999px; 
    }
    
    .mobile-optimized-table table { 
        min-width: 100%; 
    }
    
    .mobile-optimized-table tr { 
        background: #fff; 
        border-radius: 12px; 
        margin-bottom: 15px; 
        padding: 15px; 
        box-shadow: 0 4px 10px rgba(0,0,0,0.05); 
        border: 1px solid #E0E5F2; 
    }
    
    .mobile-optimized-table td { 
        border: none; 
        border-bottom: 1px dashed #F4F7FE; 
        position: relative; 
        padding-left: 45%; 
        text-align: right; 
        min-height: 40px; 
        display: flex; 
        justify-content: flex-end; 
        align-items: center; 
        font-size: 14px; 
    }
    
    .mobile-optimized-table td:last-child { 
        border-bottom: 0; 
        padding-bottom: 0; 
        margin-bottom: 0; 
    }
    
    .mobile-optimized-table td::before { 
        content: attr(data-label); 
        position: absolute; 
        left: 0; 
        width: 40%; 
        text-align: left; 
        font-weight: bold; 
        color: #111C44; 
        font-size: 13px; 
        text-transform: uppercase; 
    }
    
    .action-wrapper { 
        justify-content: flex-end; 
        width: 100%; 
    }
}