/* Variables de couleurs affinées pour un Dark Mode profond et pro */
:root {
    --bg-dark: #151821; 
    --bg-sidebar: #1E232F;
    --bg-card: #222834;
    --border-light: rgba(255, 255, 255, 0.06);
    --text-main: #F3F4F6;
    --text-muted: #9CA3AF;
    --accent-blue: #3B82F6;
    --purple: #8B5CF6;
    --yellow: #F59E0B;
    --green: #10B981;
    --red: #EF4444;
    --shadow-base: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.15);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden; 
}

/* Layout Principal */
.app-container {
    display: flex;
    height: 100vh;
}

/* --- SIDEBAR --- */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    padding: 30px 24px;
    border-right: 1px solid var(--border-light);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 50px;
}

.logo-icon {
    font-size: 32px;
    color: var(--accent-blue);
}

.logo-container h1 {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.5px;
}

.main-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-item {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.nav-item i {
    font-size: 20px;
}

.nav-item.active, .nav-item:hover {
    color: var(--accent-blue);
    background-color: rgba(59, 130, 246, 0.1);
}

/* --- CONTENU PRINCIPAL --- */
.main-content {
    flex-grow: 1;
    padding: 30px 50px;
    overflow-y: auto; 
}

/* Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 50px;
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: var(--bg-card);
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    width: 350px;
}

.search-bar i {
    color: var(--text-muted);
    font-size: 18px;
}

.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-main);
    margin-left: 12px;
    width: 100%;
    outline: none;
    font-size: 14px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 30px;
}

.notification-icon {
    position: relative;
    font-size: 22px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.notification-icon:hover { color: var(--text-main); }

.badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: var(--red);
    color: white;
    font-size: 10px;
    font-weight: bold;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-dark);
}

.avatar-info {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-text {
    display: flex;
    flex-direction: column;
}

.user-name { font-size: 14px; font-weight: 600; color: var(--text-main); }
.user-role { font-size: 12px; color: var(--text-muted); }

/* Titre de page */
.page-title h2 {
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

/* Grille des KPIs */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.kpi-card {
    background-color: var(--bg-card);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-base);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(255, 255, 255, 0.12);
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.kpi-date {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* Couleurs des icônes avec un fond subtil */
.icon-purple { background-color: rgba(139, 92, 246, 0.15); color: var(--purple); }
.icon-yellow { background-color: rgba(245, 158, 11, 0.15); color: var(--yellow); }
.icon-green { background-color: rgba(16, 185, 129, 0.15); color: var(--green); }
.icon-red { background-color: rgba(239, 68, 68, 0.15); color: var(--red); }

.kpi-card h3 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 6px;
}

.kpi-status {
    font-size: 14px;
    color: var(--text-muted);
}