/* ==================== VARIABLES ET RESET ==================== */
:root {
    /* Couleurs principales */
    --primary-color: #ff6b8b;
    --primary-dark: #ff3b68;
    --primary-light: #ff9eb2;
    --secondary-color: #6a11cb;
    --secondary-dark: #4d0c9a;
    --secondary-light: #9d4edd;
    
    /* Couleurs de statut */
    --success-color: #4CAF50;
    --success-light: #d4edda;
    --warning-color: #FF9800;
    --warning-light: #fff3cd;
    --danger-color: #F44336;
    --danger-light: #f8d7da;
    --info-color: #2196F3;
    --info-light: #d1ecf1;
    
    /* Couleurs neutres */
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    
    /* Ombres */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.1);
    
    /* Bordures */
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--gray-800);
    min-height: 100vh;
    line-height: 1.6;
}

/* ==================== TYPOGRAPHIE ==================== */
h1, h2, h3, h4, h5, h6 {
    color: var(--dark-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

/* ==================== LAYOUT ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: -10px;
}

.col {
    flex: 1;
    padding: 10px;
    min-width: 300px;
}

/* ==================== CARTES ==================== */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    border: 1px solid var(--gray-200);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-200);
}

.card-title {
    font-size: 1.25rem;
    color: var(--dark-color);
    margin: 0;
}

.card-body {
    padding: 0;
}

/* ==================== BOUTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    gap: 0.5rem;
}

.btn i {
    font-size: 1.1em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--secondary-dark) 0%, var(--secondary-color) 100%);
    transform: translateY(-2px);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #d32f2f;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==================== FORMULAIRES ==================== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    transition: border-color var(--transition-fast);
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 139, 0.1);
}

.form-control.is-invalid {
    border-color: var(--danger-color);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.1);
}

.invalid-feedback {
    display: block;
    margin-top: 0.5rem;
    color: var(--danger-color);
    font-size: 0.875rem;
}

.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    background: white;
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* ==================== TABLEAUX ==================== */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    background-color: var(--gray-100);
    font-weight: 600;
    color: var(--gray-700);
}

.table tbody tr:hover {
    background-color: var(--gray-100);
}

.table-striped tbody tr:nth-child(odd) {
    background-color: var(--gray-50);
}

/* ==================== BADGES ==================== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 50px;
    text-align: center;
    white-space: nowrap;
}

.badge-primary {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

.badge-secondary {
    background-color: var(--secondary-light);
    color: var(--secondary-dark);
}

.badge-success {
    background-color: var(--success-light);
    color: var(--success-color);
}

.badge-warning {
    background-color: var(--warning-light);
    color: var(--warning-color);
}

.badge-danger {
    background-color: var(--danger-light);
    color: var(--danger-color);
}

.badge-info {
    background-color: var(--info-light);
    color: var(--info-color);
}

/* Badges de sévérité */
.badge-severity-low {
    background-color: #d4edda;
    color: #155724;
}

.badge-severity-medium {
    background-color: #fff3cd;
    color: #856404;
}

.badge-severity-high {
    background-color: #f8d7da;
    color: #721c24;
}

/* ==================== ALERTES ==================== */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
}

.alert-success {
    background-color: var(--success-light);
    border-color: #c3e6cb;
    color: var(--success-color);
}

.alert-warning {
    background-color: var(--warning-light);
    border-color: #ffeeba;
    color: var(--warning-color);
}

.alert-danger {
    background-color: var(--danger-light);
    border-color: #f5c6cb;
    color: var(--danger-color);
}

.alert-info {
    background-color: var(--info-light);
    border-color: #bee5eb;
    color: var(--info-color);
}

/* ==================== NAVIGATION ==================== */
.navbar {
    background: white;
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.navbar-brand i {
    margin-right: 0.5rem;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--primary-color);
    background-color: var(--gray-100);
}

.nav-link.active {
    color: var(--primary-color);
    background-color: var(--primary-light);
}

/* Hamburger caché sur desktop */
.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Version mobile */
@media (max-width: 768px) {

    .hamburger {
        display: block;
        margin-right: 1rem;
    }

    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        height: 100%;
        width: 260px;
        transition: left 0.3s ease;
        z-index: 1000;
    }

    .sidebar.open {
        left: 0;
    }
}


/* ==================== SIDEBAR ==================== */
.sidebar {
    width: 250px;
    background: white;
    min-height: calc(100vh - 70px);
    box-shadow: var(--shadow-md);
    position: fixed;
    left: 0;
    top: 70px;
    padding: 2rem 0;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-item {
    margin-bottom: 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: all var(--transition-fast);
    border-left: 4px solid transparent;
}

.sidebar-link:hover {
    background-color: var(--gray-100);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.sidebar-link.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.sidebar-link i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

/* ==================== CONTENU PRINCIPAL ==================== */
.main-content {
    margin-left: 250px;
    padding: 2rem;
    min-height: calc(100vh - 70px);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-200);
}

/* ==================== STATISTIQUES ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1.5rem;
    font-size: 1.5rem;
}

.stat-icon-primary {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    color: white;
}

.stat-icon-success {
    background: linear-gradient(135deg, #a8e6cf 0%, var(--success-color) 100%);
    color: white;
}

.stat-icon-warning {
    background: linear-gradient(135deg, #ffd3b6 0%, var(--warning-color) 100%);
    color: white;
}

.stat-icon-danger {
    background: linear-gradient(135deg, #ffaaa5 0%, var(--danger-color) 100%);
    color: white;
}

.stat-content h3 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
    color: var(--dark-color);
}

.stat-content p {
    color: var(--gray-600);
    margin: 0;
}

/* ==================== RÈGLES ==================== */
.rule-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.rule-card:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.rule-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.rule-title {
    font-size: 1.25rem;
    color: var(--dark-color);
    margin: 0;
}

.rule-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--gray-100);
    color: var(--gray-700);
    border-radius: 50px;
    font-size: 0.875rem;
    margin-left: 1rem;
}

.rule-description {
    color: var(--gray-600);
    margin-bottom: 1rem;
}

.rule-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

/* ==================== VIOLATIONS ==================== */
.violation-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid;
    box-shadow: var(--shadow-sm);
}

.violation-card.severity-low {
    border-left-color: var(--success-color);
}

.violation-card.severity-medium {
    border-left-color: var(--warning-color);
}

.violation-card.severity-high {
    border-left-color: var(--danger-color);
}

.violation-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.violator-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-sm {
    width: 30px;
    height: 30px;
}

.avatar-lg {
    width: 60px;
    height: 60px;
}

/* ==================== FILTRES ==================== */
.filter-bar {
    background: white;
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ==================== UTILITAIRES ==================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }

.hidden { display: none; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 992px) {
    .sidebar {
        width: 200px;
    }
    
    .main-content {
        margin-left: 200px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .navbar-menu {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 15px;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    .card {
        padding: 1rem;
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
}