/* Variables */
:root {
    --primary-color: #000;
    --secondary-color: #333;
    --accent-color: #051435;
    --bg-color: #fff;
    --sidebar-bg: #f8f9fa;
    --border-color: #e5e7eb;
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 0.375rem;
    --card-bg: #fff;
}

/* Import de la police Inter Tight */
@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@100;200;300;400;500;600;700;800;900&display=swap');

/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: 12px;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #2980b9;
}

/* Layout */
.container {
    display: flex;
    min-height: 100vh;
    width: 100%;
   
    margin: 0 auto;
    padding: 0 15px;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem 0;
    position: fixed;
    height: 100%;
    overflow-y: auto;
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
    left: 0;
    top: 0;
}

/* Bouton Burger */
.menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    background: var(--accent-color);
    border: none;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    z-index: 1100;
    flex-direction: column;
    justify-content: space-between;
    width: 40px;
    height: 30px;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Overlay pour mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Styles pour le contenu principal */
.main {
    margin-left: 250px;
    padding: 2rem;
    transition: margin-left 0.3s ease-in-out;
    min-height: 100vh;
}

/* Styles pour le header du dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

/* Styles responsifs */
@media (max-width: 992px) {
    .menu-toggle {
        display: flex;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main {
        margin-left: 0;
        padding: 1rem;
        padding-top: 5rem;
    }
    
    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

.logo {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

.nav {
    padding: 0 0.75rem;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0 1rem;
    margin-bottom: 0.75rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: var(--radius);
    margin-bottom: 0.25rem;
    transition: all 0.2s;
}

.nav-link:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.nav-link.active {
    background-color: var(--accent-color);
    color: white;
}

.nav-link i {
    margin-right: 0.75rem;
    width: 1.25rem;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 2rem;
}

/* En-tête */
.header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Navigation */
.nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 0.75rem;
}

.nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
}

/* User Menu */
.user-menu {
    position: relative;
    display: inline-block;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    transition: background-color 0.2s;
}

.user-menu-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.user-menu-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-width: 200px;
    z-index: 10;
    display: none;
}

.user-menu:hover .user-menu-dropdown {
    display: block;
}

.user-menu-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    transition: background-color 0.2s;
}

.user-menu-item:hover {
    background-color: var(--sidebar-bg);
}

.user-menu-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 0.25rem 0;
}

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: white;
    border-bottom: 1px solid var(--border-color);
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: var(--sidebar-bg);
    border-radius: var(--radius);
    padding: 0.5rem 1rem;
    width: 300px;
}

.search-bar i {
    color: var(--text-muted);
    margin-right: 0.5rem;
}

.search-bar input {
    border: none;
    background: none;
    outline: none;
    width: 100%;
    color: var(--text-color);
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

/* User Menu */
.user-menu {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
}

.user-info {
    display: flex;
    flex-direction: column;
    margin-right: 0.75rem;
    text-align: right;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Content */
.content {
    padding: 2rem;
    background-color: var(--bg-color);
    min-height: calc(100vh - 80px);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 20;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }
}

/* Utility classes */
.text-muted {
    color: var(--text-muted);
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.p-4 {
    padding: 1rem;
}

.mr-2 {
    margin-right: 0.5rem;
}

.text-sm {
    font-size: 0.875rem;
}

/* Cartes */
.card {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Boutons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Formulaires */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Alertes */
.alert {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Authentification */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem 0;
    background-color: var(--bg-color);
}

.auth-card {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.auth-header p {
    color: var(--secondary-color);
}

.auth-form .form-group:last-child {
    margin-bottom: 1.5rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Gestion des mots de passe */
.password-input {
    position: relative;
}

.password-input input {
    padding-right: 2.5rem;
}

.toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--secondary-color);
    cursor: pointer;
    padding: 0.25rem;
}

.toggle-password:focus {
    outline: none;
}

/* Tableau de bord */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-card h3 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card p {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

/* Utilitaires */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
