﻿/* ==========================================================
   1. VARIABLES & CONFIGURATION
   ========================================================== */
:root {
    --sidebar-width: 300px; /* Largeur fixe et confortable */
    --navbar-height: 80px; /* Hauteur de la zone logo */
    --bg-gradient-start: #052767;
    --bg-gradient-end: #3a0647;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

/* ==========================================================
   2. ZONE LOGO (En haut à gauche)
   ========================================================== */
.navbar-brand {
    display: flex;
    align-items: center;
    justify-content: center; /* Centre le logo horizontalement */
    height: var(--navbar-height);
    width: 100%;
    padding: 10px;
    background-color: rgba(0,0,0,0.2); /* Légère distinction du fond */
}

    .navbar-brand img {
        /* Le logo prendra la hauteur max disponible sans déborder */
        height: 100%;
        width: auto;
        max-height: 110px; /* Limite absolue de hauteur */
        max-width: 99%; /* Ne touche pas les bords */
        object-fit: contain;
    }

/* ==========================================================
   3. LIENS DE NAVIGATION (Alignement Icone/Texte)
   ========================================================== */
.nav-item .nav-link {
    display: flex;
    align-items: center; /* Centre verticalement STRICTEMENT */
    flex-direction: row;
    gap: 15px; /* Espace propre entre l'icône et le texte */

    height: 55px; /* Hauteur de ligne confortable */
    padding: 0 25px; /* Marges latérales */

    color: rgba(255,255,255,0.75);
    text-decoration: none;
    transition: all 0.2s ease;
}

    .nav-item .nav-link:hover, .nav-item .nav-link.active {
        color: white;
        background-color: rgba(255,255,255,0.15);
        border-left: 4px solid #fff; /* Petit indicateur visuel actif */
        padding-left: 21px; /* Compenste la bordure pour ne pas décaler le texte */
    }

/* L'icône */
.nav-item .bi {
    font-size: 1.4rem;
    line-height: 1; /* CRUCIAL : Empêche l'icône de flotter en hauteur */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px; /* Largeur fixe pour aligner tous les textes */
}

/* ==========================================================
   4. STRUCTURE GLOBALE
   ========================================================== */
.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

main {
    flex: 1;
    padding: 2rem;
}

/* BARRE MOBILE (Top Row) */
.top-row {
    height: 4rem;
    background-color: #052767;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 2000;
}

/* Burger Menu */
.navbar-toggler {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 4px;
    padding: 0.5rem;
    cursor: pointer;
}

    .navbar-toggler::after {
        content: "☰";
        color: white;
        font-size: 1.5rem;
        line-height: 1;
    }

/* Menu Mobile caché */
.nav-scrollable {
    display: none;
    background: var(--bg-gradient-start);
}

.navbar-toggler:checked ~ .nav-scrollable {
    display: block;
}

/* ==========================================================
   5. VERSION ORDINATEUR (> 768px)
   ========================================================== */
@media (min-width: 768px) {
    .page {
        flex-direction: row;
    }

    .sidebar {
        width: var(--sidebar-width) !important;
        min-width: var(--sidebar-width) !important;
        flex: 0 0 var(--sidebar-width); /* Fixe la largeur */

        height: 100vh;
        position: sticky;
        top: 0;
        background-image: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 70%);
        display: flex;
        flex-direction: column;
        z-index: 1000;
        box-shadow: 5px 0 15px rgba(0,0,0,0.3);
    }

    /* Cache éléments mobile */
    .navbar-toggler, .top-row {
        display: none;
    }

    /* Affiche menu desktop */
    .nav-scrollable {
        display: block !important;
        flex: 1;
        overflow-y: auto;
    }

    /* Logo Desktop : On utilise la classe .navbar-brand définie au point 2 */
}

/* Erreurs Blazor */
.blazor-error-boundary {
    background: #b32121;
    color: white;
    padding: 1rem;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 9999;
}

/* Animation d'entrée */
.fade-in {
    animation: fadeIn 0.8s ease-in-out;
}

@@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* --- STRUCTURE & FOND --- */
.dashboard-wrapper {
    min-height: 100vh;
    background-color: #f8f9fa; /* Gris très clair pour éviter le blanc pur */
}

/* --- HERO SECTION --- */
.hero-card {
    background: linear-gradient(135deg, #052767 0%, #3a0647 100%);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(5, 39, 103, 0.2);
    color: white;
}

/* Cercles décoratifs abstraits */
.circle-decoration {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    filter: blur(40px);
}

.circle-1 {
    width: 300px;
    height: 300px;
    top: -100px;
    right: -50px;
}

.circle-2 {
    width: 200px;
    height: 200px;
    bottom: -50px;
    left: -50px;
    background: rgba(255, 215, 0, 0.05);
}

.hero-bg-icon {
    position: absolute;
    right: -30px;
    bottom: -60px;
    font-size: 20rem;
    color: rgba(255, 255, 255, 0.04);
    transform: rotate(-15deg);
    pointer-events: none;
}

/* Typographie Hero */
.text-white-75 {
    color: rgba(255, 255, 255, 0.75);
}

.tracking-wider {
    letter-spacing: 0.1em;
}

/* Badge effet verre */
.glass-badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}

/* Texte Or dégradé */
.text-gradient-gold {
    background: linear-gradient(to right, #ffd700, #ffec8b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

/* Boutons Hero */
.lift-on-hover {
    transition: transform 0.2s, box-shadow 0.2s;
}

    .lift-on-hover:hover {
        transform: translateY(-3px);
        box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    }

/* --- KPI STATS CARDS --- */
.stat-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    border: 1px solid rgba(0,0,0,0.05);
    transition: transform 0.2s;
    height: 100%;
}

    .stat-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    }

/* Bordures colorées sur le côté gauche */
.border-start-primary {
    border-left: 5px solid #0d6efd;
}

.border-start-success {
    border-left: 5px solid #198754;
}

.border-start-warning {
    border-left: 5px solid #ffc107;
}

/* Icônes KPI */
.icon-box {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.bg-primary-soft {
    background-color: rgba(13, 110, 253, 0.1);
}

.bg-success-soft {
    background-color: rgba(25, 135, 84, 0.1);
}

.bg-warning-soft {
    background-color: rgba(255, 193, 7, 0.1);
}

/* --- ACTION CARDS (Design Matériel) --- */
.action-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

    .action-card:hover {
        transform: translateY(-10px);
        box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    }

/* Le bandeau de couleur en haut de la carte */
.card-img-top-placeholder {
    height: 80px;
    width: 100%;
}

.bg-gradient-primary {
    background: linear-gradient(45deg, #0d6efd, #0a58ca);
}

.bg-gradient-success {
    background: linear-gradient(45deg, #198754, #146c43);
}

.bg-gradient-danger {
    background: linear-gradient(45deg, #dc3545, #b02a37);
}

/* L'icône ronde qui flotte */
.action-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    /* margin-top négatif pour faire chevaucher le header */
}

/* Animation d'entrée */
.fade-in {
    animation: fadeIn 0.8s ease-out;
}

@@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
