/* public/css/style.css */

:root {
    --primary-color: #4f46e5; /* Indigo moderne */
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-color: #f3f4f6;
    --sidebar-width: 260px;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition-speed: 0.3s;
}

body {
    background-color: var(--bg-color);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    color: #1f2937;
}

/* --- SIDEBAR --- */
.sidebar {
    min-height: 100vh;
    background: white;
    width: var(--sidebar-width);
    position: fixed;
    left: 0;
    top: 0;
    box-shadow: var(--card-shadow);
    z-index: 1000;
    transition: margin-left var(--transition-speed) ease;
    display: flex;
    flex-direction: column;
}

.sidebar.toggled {
    margin-left: calc(var(--sidebar-width) * -1);
}

.sidebar-brand {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 25px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    border-bottom: 1px solid #f3f4f6;
}

.sidebar .nav-link {
    color: #4b5563;
    font-weight: 500;
    padding: 12px 25px;
    margin: 5px 0;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    border-left: 4px solid transparent;
    text-decoration: none; /* Important pour Bootstrap */
}

.sidebar .nav-link:hover {
    background-color: #f9fafb;
    color: var(--primary-color);
}

.sidebar .nav-link.active {
    background-color: #eef2ff;
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.sidebar .nav-link i {
    width: 24px;
    margin-right: 10px;
    font-size: 1.1rem;
}

/* --- MAIN CONTENT --- */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 20px 30px;
    transition: margin-left var(--transition-speed) ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content.toggled {
    margin-left: 0;
}

/* --- TOP NAVBAR (Commune) --- */
.top-navbar {
    background: transparent;
    padding: 10px 0;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toggle-btn {
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: #6b7280;
    box-shadow: var(--card-shadow);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-btn:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.user-area {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Notifications */
.notif-btn {
    position: relative;
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #6b7280;
    box-shadow: var(--card-shadow);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notif-btn:hover { color: var(--primary-color); }

.notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--danger-color);
    color: white;
    font-size: 0.65rem;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    padding: 0 4px;
}

/* User Profile */
.user-profile {
    display: flex;
    align-items: center;
    background: white;
    padding: 6px 15px 6px 6px;
    border-radius: 30px;
    box-shadow: var(--card-shadow);
    cursor: pointer;
    transition: all 0.2s;
}

.user-profile:hover { background: #f9fafb; }

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
    border: 2px solid #e5e7eb;
}

.user-info { line-height: 1.2; text-align: left; }
.user-name { font-size: 0.85rem; font-weight: 700; color: #374151; display: block; }
.user-role { font-size: 0.75rem; color: #9ca3af; display: block; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .sidebar { margin-left: calc(var(--sidebar-width) * -1); }
    .sidebar.toggled { margin-left: 0; }
    .main-content { margin-left: 0; }
    .user-info { display: none; }
}