/* --- VARIABLES SAAS 2026 --- */
:root {
    --primary: #D81B60; 
    --primary-hover: #b0154e;
    --sidebar-bg: #0a0816; /* Le noir profond de ta charte graphique */
    --sidebar-text: #b0bec5;
    --sidebar-active: rgba(216, 27, 96, 0.15);
    --bg-light: #f4f6f9; /* Fond gris très clair pour faire ressortir les cartes */
    --card-bg: #ffffff;
    --text-main: #2c3e50;
    --text-muted: #95a5a6;
    --border-color: #e2e8f0;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 20px rgba(0,0,0,0.05);
    --radius: 12px;
}

body, html {
    margin: 0; padding: 0;
    background-color: var(--bg-light);
    font-family: 'Poppins', sans-serif;
    color: var(--text-main);
    height: 100vh; overflow: hidden; /* Empêche le scroll global, seul le contenu scroll */
}

* { box-sizing: border-box; }

/* --- LAYOUT GLOBAL --- */
.admin-layout {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* --- SIDEBAR (Barre Latérale) --- */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 1000;
}
.sidebar-logo {
    padding: 25px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.sidebar-logo img { max-height: 45px; filter: brightness(0) invert(1); }

.sidebar-nav {
    padding: 20px 15px;
    flex: 1;
    overflow-y: auto;
}
.nav-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #6c757d;
    margin: 20px 0 10px 15px;
    font-weight: 700;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 5px;
    font-weight: 500;
    transition: all 0.3s ease;
}
.sidebar-nav a i {
    width: 25px;
    font-size: 1.1rem;
    margin-right: 10px;
}
.sidebar-nav a:hover {
    background-color: rgba(255,255,255,0.05);
    color: white;
}
.sidebar-nav a.active {
    background-color: var(--sidebar-active);
    color: var(--primary);
    border-left: 4px solid var(--primary);
}

/* --- MAIN WRAPPER (Zone de droite) --- */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Cache les débordements */
}

/* --- TOPBAR (En-tête) --- */
.topbar {
    height: 80px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}
.topbar-left { display: flex; align-items: center; gap: 20px; }
.mobile-toggle {
    display: none;
    background: none; border: none; font-size: 1.5rem;
    color: var(--text-main); cursor: pointer;
}
.page-info h2 { margin: 0; font-size: 1.4rem; color: var(--text-main); font-weight: 700; }
.page-info span { font-size: 0.85rem; color: var(--text-muted); }

.topbar-right { display: flex; align-items: center; gap: 20px; }
.user-profile { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.user-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--primary); color: white;
    display: flex; justify-content: center; align-items: center;
    font-size: 1.2rem;
}
.btn-logout {
    background: #ffebee; color: #c62828; padding: 10px 15px;
    border-radius: 8px; text-decoration: none; font-weight: 600; transition: 0.3s;
}
.btn-logout:hover { background: #ffcdd2; }

/* --- CONTENT AREA (Le contenu de la page) --- */
.content-area {
    flex: 1;
    padding: 30px;
    overflow-y: auto; /* C'est ici que ça défile ! */
}

/* --- ELEMENTS GENERIQUES (Formulaires, Alertes, etc.) --- */
.dashboard-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card { background: var(--card-bg); padding: 25px; border-radius: var(--radius); border: 1px solid var(--border-color); box-shadow: var(--shadow-sm); text-align: center; transition: 0.3s; }
.stat-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.stat-card i { font-size: 2.5rem; margin-bottom: 15px; }
.stat-card h3 { font-size: 2.2rem; margin: 0; color: var(--text-main); font-weight: 800; }
.stat-card p { margin: 5px 0 0; color: var(--text-muted); font-weight: 500; }
a.stat-link { text-decoration: none; color: inherit; display: block; }

form { background: var(--card-bg); padding: 25px; border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--border-color); margin-bottom: 30px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 8px; color: var(--text-main); }
.form-group input, .form-group select { width: 100%; padding: 12px; border: 1px solid var(--border-color); border-radius: 8px; font-size: 1rem; font-family: 'Poppins', sans-serif; transition: 0.3s; }
.form-group input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(216,27,96,0.1); }
button[type="submit"] { background: var(--primary); color: white; border: none; padding: 12px 20px; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: 0.3s; width: 100%; display: flex; justify-content: center; align-items: center; gap: 10px; }
button[type="submit"]:hover { background: var(--primary-hover); transform: translateY(-2px); }

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 992px) {
    .sidebar { position: fixed; left: -260px; height: 100vh; }
    .sidebar.open { left: 0; box-shadow: 10px 0 30px rgba(0,0,0,0.5); }
    .mobile-toggle { display: block; }
    .sidebar-overlay { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.5); z-index: 999; }
    .sidebar-overlay.open { display: block; }
    .content-area { padding: 15px; }
    .topbar { padding: 0 15px; }
    .user-profile span { display: none; } /* Cache le nom sur mobile */
}

/* --- OVERLAY DE TÉLÉVERSEMENT (Le correctif !) --- */
.upload-overlay {
    display: none; /* C'est ceci qui le cache par défaut ! */
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(10, 8, 22, 0.9);
    backdrop-filter: blur(10px);
    z-index: 99999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
}
.upload-overlay.active {
    display: flex; /* Le JS ajoute cette classe pour l'afficher */
}
.upload-spinner {
    width: 60px; height: 60px;
    border: 6px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}
.upload-message { font-size: 1.5rem; font-weight: 700; margin-bottom: 5px; color: white; }
.upload-submessage { font-size: 1rem; color: #b0bec5; margin-bottom: 20px; }

@keyframes spin { 
    0% { transform: rotate(0deg); } 
    100% { transform: rotate(360deg); } 
}

/* --- BARRE DE PROGRESSION --- */
.progress-bar-container {
    width: 100%; max-width: 400px;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.2);
}
.progress-bar {
    height: 15px;
    width: 0%;
    background: var(--primary);
    transition: width 0.3s ease;
}
.progress-text {
    display: block; text-align: center; margin-top: 8px; font-weight: 600; font-size: 0.9rem;
}

/* --- PAGE DE CONNEXION (LOGIN) --- */
.login-body {
    background-color: var(--sidebar-bg); /* Utilise le noir profond global */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
    margin: 0;
    padding: 0;
}

/* Effet de fond Cyber-Blur (Spécifique Login) */
.bg-blob {
    position: absolute; width: 40vw; height: 40vw;
    background: var(--primary); border-radius: 50%;
    filter: blur(150px); opacity: 0.15; z-index: 0;
    animation: float 10s infinite alternate ease-in-out;
}
.blob-1 { top: -10%; left: -10%; }
.blob-2 { bottom: -10%; right: -10%; background: #4A148C; animation-delay: -5s; }

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.login-wrapper {
    position: relative; z-index: 10;
    width: 100%; max-width: 420px; padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    text-align: center;
    color: white; /* Force le texte en blanc sur fond sombre */
}

.login-card h1 { margin: 0 0 10px 0; font-size: 1.8em; font-weight: 800; }

.gradient-text-login {
    background: linear-gradient(135deg, var(--primary), #4A148C);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-subtitle {
    color: var(--sidebar-text);
    font-size: 0.9em; margin-bottom: 30px; display: block;
}

.login-form-group { margin-bottom: 20px; text-align: left; position: relative; }
.login-form-group label {
    display: block; font-size: 0.85em; font-weight: 600;
    color: var(--sidebar-text); margin-bottom: 8px; padding-left: 5px;
}

.input-icon-wrap { position: relative; }
.input-icon-wrap i {
    position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
    color: #6c757d; font-size: 1em;
}

.login-form-group input {
    width: 100%; padding: 14px 15px 14px 45px;
    border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3); color: white;
    font-family: 'Poppins', sans-serif; font-size: 0.95em;
    outline: none; transition: all 0.3s ease;
}
.login-form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(216, 27, 96, 0.3);
    background: rgba(0, 0, 0, 0.5);
}

.login-btn {
    width: 100%; padding: 15px; margin-top: 10px;
    border-radius: 12px; border: none;
    background: linear-gradient(135deg, var(--primary), #4A148C);
    color: white; font-family: 'Poppins', sans-serif;
    font-size: 1em; font-weight: 700; letter-spacing: 1px;
    cursor: pointer; transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(216, 27, 96, 0.3);
}
.login-btn:hover {
    transform: translateY(-3px); box-shadow: 0 8px 25px rgba(216, 27, 96, 0.5);
}

.login-brand-logo {
    width: 60px; height: 60px; background: rgba(255,255,255,0.05);
    border-radius: 50%; display: flex; justify-content: center; align-items: center;
    margin: 0 auto 20px auto; font-size: 1.5em; color: var(--primary);
    border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 0 20px rgba(216,27,96,0.2);
}