:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    /* Couleurs du drapeau tchadien */
    --tchad-blue: #002664;
    --tchad-blue-light: #003d8f;
    --tchad-blue-dark: #001a42;
    --tchad-yellow: #FECB00;
    --tchad-yellow-light: #FFD633;
    --tchad-yellow-dark: #E6B800;
    --tchad-red: #C8102E;
    --tchad-red-light: #E01E3C;
    --tchad-red-dark: #A00D25;
    /* Thème global */
    --app-bg: #f5f7fb;
    --app-surface: #ffffff;
    --app-text: #1f2937;
    --app-muted: #6b7280;
    --app-border: #e5e7eb;
    --app-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--app-bg);
    color: var(--app-text);
}

a {
    color: var(--tchad-blue);
}

a:hover {
    color: var(--tchad-blue-light);
}

.navbar {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    background: var(--app-surface) !important;
    border-bottom: 1px solid var(--app-border);
}

.navbar .navbar-brand {
    color: var(--tchad-blue);
    font-weight: 700;
}

.navbar .nav-link {
    color: #374151;
    font-weight: 600;
}

.navbar .nav-link:hover {
    color: var(--tchad-blue);
}

.dropdown-menu {
    border-radius: 12px;
    border: 1px solid var(--app-border);
    box-shadow: var(--app-shadow);
}

.dropdown-item:focus,
.dropdown-item:hover {
    background-color: #eef2ff;
}

.card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 12px;
    box-shadow: var(--app-shadow);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.stat-card {
    background: var(--app-surface);
    border-radius: 12px;
    border-left: 4px solid var(--tchad-yellow);
    color: var(--tchad-blue-dark);
}

.stat-card.success {
    border-left-color: #38ef7d;
}

.stat-card.warning {
    border-left-color: #f5576c;
}

.stat-card.info {
    border-left-color: #4facfe;
}

.stat-card.danger {
    border-left-color: #dc3545;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--tchad-blue);
}

.btn-primary {
    background-color: var(--tchad-blue);
    border-color: var(--tchad-blue);
}

.btn-primary:hover {
    background-color: var(--tchad-blue-light);
    border-color: var(--tchad-blue-light);
}

.btn-outline-primary {
    color: var(--tchad-blue);
    border-color: var(--tchad-blue);
}

.btn-outline-primary:hover {
    background-color: var(--tchad-blue);
    border-color: var(--tchad-blue);
}

.form-control,
.form-select {
    border-radius: 10px;
    border-color: var(--app-border);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--tchad-blue-light);
    box-shadow: 0 0 0 0.2rem rgba(0, 61, 143, 0.15);
}

.table {
    background: var(--app-surface);
}

.table thead th {
    background: #f1f5f9;
    color: #475569;
    font-weight: 600;
}

.table tbody tr:hover {
    background: #f8fafc;
}

.alert {
    border-radius: 12px;
    border: 1px solid var(--app-border);
    box-shadow: var(--app-shadow);
}

/* Menu latéral de gestion */
.system-menu {
    position: fixed;
    top: 56px;
    left: 0;
    width: 280px;
    height: calc(100vh - 56px);
    background: var(--app-surface);
    border-right: 1px solid var(--app-border);
    box-shadow: 2px 0 12px rgba(15, 23, 42, 0.06);
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.system-menu.collapsed {
    transform: translateX(-100%);
}

.system-menu-header {
    padding: 20px;
    background: #f8fafc;
    border-bottom: 1px solid var(--app-border);
    color: var(--tchad-blue-dark);
    font-weight: 600;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.system-menu-header .flag-mini {
    display: inline-flex;
    height: 24px;
    width: 36px;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.system-menu-header .flag-mini .stripe {
    flex: 1;
    height: 100%;
}

.system-menu-header .flag-mini .stripe.blue {
    background: var(--tchad-blue);
}

.system-menu-header .flag-mini .stripe.yellow {
    background: var(--tchad-yellow);
}

.system-menu-header .flag-mini .stripe.red {
    background: var(--tchad-red);
}

.menu-section {
    margin: 15px 0;
}

.menu-section-title {
    padding: 10px 20px;
    color: var(--tchad-blue);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--app-border);
    margin-bottom: 5px;
}

.menu-section-title.admin-title {
    color: var(--tchad-red);
    border-bottom-color: rgba(200, 16, 46, 0.2);
}

.admin-section {
    background: rgba(200, 16, 46, 0.06);
    border-left: 3px solid var(--tchad-red);
    margin: 20px 12px;
    border-radius: 12px;
    padding-bottom: 6px;
}

.admin-section .menu-section-title {
    padding: 12px 16px;
}

.admin-section .menu-item {
    margin: 0 8px 6px;
    border-radius: 10px;
    border-left-color: transparent;
}

.admin-section .menu-item:hover {
    background: rgba(200, 16, 46, 0.12);
    color: var(--tchad-red-dark);
    border-left-color: var(--tchad-red);
}

.admin-section .menu-item.active {
    background: rgba(200, 16, 46, 0.18);
    color: var(--tchad-red-dark);
    border-left-color: var(--tchad-red);
}

.menu-item {
    display: block;
    padding: 12px 20px;
    color: #1f2937;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    position: relative;
}

.menu-item:hover {
    background: #f1f5f9;
    color: var(--tchad-blue);
    border-left-color: var(--tchad-blue);
    padding-left: 25px;
}

.menu-item.active {
    background: #e0e7ff;
    color: var(--tchad-blue-dark);
    font-weight: 600;
    border-left-color: var(--tchad-yellow);
}

.menu-item i {
    width: 20px;
    margin-right: 12px;
    font-size: 18px;
}

.menu-toggle-btn {
    position: fixed;
    top: 70px;
    left: 10px;
    z-index: 1001;
    background: var(--tchad-blue);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    transition: all 0.3s ease;
}

.menu-toggle-btn:hover {
    background: var(--tchad-yellow);
    color: var(--tchad-blue-dark);
    transform: scale(1.1);
}

.menu-toggle-btn.menu-open {
    left: 290px;
}

.main-content {
    margin-left: 280px;
    transition: margin-left 0.3s ease;
    padding: 20px;
    min-height: calc(100vh - 56px);
}

.main-content.menu-collapsed {
    margin-left: 0;
}

@media (max-width: 768px) {
    .system-menu {
        transform: translateX(-100%);
    }
    
    .system-menu.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle-btn {
        display: flex;
    }
}

/* Scrollbar personnalisée pour le menu */
.system-menu::-webkit-scrollbar {
    width: 6px;
}

.system-menu::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.system-menu::-webkit-scrollbar-thumb {
    background: #cbd5f5;
    border-radius: 3px;
}

.system-menu::-webkit-scrollbar-thumb:hover {
    background: #a5b4fc;
}
