:root {
    --primary: #1a3a6c;
    --primary-dark: #0f2a4f;
    --primary-light: #2c5282;
    --accent: #e74c3c;
    --light: #f8f9fa;
    --dark: #343a40;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-800: #343a40;
    --sidebar-width: 280px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    overflow-x: hidden;
}

/* Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1a3a6c 0%, #0f2a4f 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.sidebar-header .logo {
    font-size: 1.5rem;
    font-weight: bold;
}
.sidebar-header .logo i { margin-right: 8px; }
.sidebar-header .tagline {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 4px;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 1.5rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: 0.2s;
    font-size: 0.9rem;
}
.sidebar-nav a i { width: 24px; text-align: center; font-size: 1.1rem; }
.sidebar-nav a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}
.sidebar-nav a.active {
    background: rgba(255,255,255,0.15);
    color: white;
    border-right: 3px solid #ffc107;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.sidebar-footer .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
    font-size: 0.8rem;
}
.logout-sidebar {
    background: rgba(255,255,255,0.1);
    border: none;
    width: 100%;
    padding: 0.6rem;
    border-radius: 30px;
    color: white;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}
.logout-sidebar:hover { background: var(--accent); }

/* Contenu principal */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    background: #f0f2f5;
}

/* Top bar */
.top-bar {
    background: white;
    padding: 0.8rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 999;
}
.menu-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
    display: none;
}
.page-title { font-size: 1.2rem; font-weight: 600; color: var(--dark); }

/* Contenu */
.content { padding: 1.5rem; }

/* Cartes et formulaires */
.card {
    background: white;
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid var(--gray-200);
}
.form-group { margin-bottom: 1rem; }
.form-group label {
    font-weight: 500;
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
}
.form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 10px;
    font-size: 0.9rem;
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 30px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
    text-align: center;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--gray-300); color: var(--dark); }
.btn-danger { background: var(--accent); color: white; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.75rem; }

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.status {
    margin-top: 10px;
    padding: 8px;
    border-radius: 8px;
    text-align: center;
    font-size: 0.85rem;
}
.status-info { background: #d1ecf1; color: #0c5460; }
.status-success { background: #d4edda; color: #155724; }
.status-error { background: #f8d7da; color: #721c24; }

/* Overlay 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;
}
.sidebar-overlay.active { display: block; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 280px;
        transform: translateX(-100%);
        position: fixed;
        z-index: 1001;
    }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; width: 100%; }
    .menu-toggle { display: block; }
    .content { padding: 1rem; }
    .top-bar { padding: 0.8rem 1rem; }
}

/* Scrollbar */
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: rgba(255,255,255,0.1); }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 4px; }
