/* ===== VARIABLES GLOBALES ===== */
:root {
    /* Couleurs principales Bootstrap */
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --purple-color: #6f42c1;

    /* Couleurs spécifiques à l'application */
    --admin-color: #4e73df;
    --enterprise-color: #1cc88a;
    --user-color: #e74a3b;
    --revenue-color: #f6c23e;

    /* Dégradés */

    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --dark-bg: linear-gradient(135deg, #2e59d9 0%, #4e73df 100%);
    --bg-orange: linear-gradient(135deg, #ff8008 0%, #ffc837 100%);
    --bg-dark: linear-gradient(135deg, #232526 0%, #414345 100%);
    --bg-Vert: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --bg-sunset: linear-gradient(135deg, #ff5f6d 0%, #ffc371 100%);
    --bg-ocean: linear-gradient(135deg, #00c9ff 0%, #92fe9d 100%);
    --bg-galaxy: linear-gradient(135deg, #654ea3 0%, #eaafc8 100%);
    --bg-forest: linear-gradient(135deg, #a8e063 0%, #56ab2f 100%);
    --bg-volcano: linear-gradient(135deg, #f83600 0%, #f9d423 100%);



    /* Effets visuels */
    --card-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
    --border-radius: 12px;
}

/* ===== RÉINITIALISATION ET STYLES DE BASE ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

.container {
    max-width: 97%;
    padding: 20px;
    margin: 0 auto;
}

/* ===== TYPOGRAPHIE ===== */
h1, h2, h3, h4, h5, h6 {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
    color: rgba(14, 4, 4, 0.8);
}

.text-uppercase {
    letter-spacing: 0.5px;
}

/* ===== LAYOUT ET STRUCTURE ===== */
.dashboard-header {
    background: linear-gradient(135deg, var(--danger-color) 0%, #2a3e9d 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 15px;
    margin-top: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    /*overflow: hidden;*/
}
.dashboard-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(30deg);
}

.dashboard-section {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
}
.dashboard-section h4 {
    color: #2e3a59;
    font-weight: 600;
}


.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
}

.section-title i {
    margin-right: 10px;
    color: var(--enterprise-color);
}

/* ===== COMPOSANTS D'EN-TÊTE ===== */
.company-logo {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: linear-gradient(45deg, #2ecc71, #3498db);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.user-avatar {
    width: 45px;
    height: 45px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
}

.user-avatar-sm {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary-color) 0%, #2e59d9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
}

.breadcrumb {
    margin-bottom: 0;
    background: transparent;
}

.breadcrumb-item a {
    color: rgba(14, 4, 4, 0.8);
    text-decoration: none;
}

.breadcrumb-item.active {
    color: rgba(255, 255, 255, 0.6);
}

.date-badge {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 0.5rem 1rem;
}
.subscription-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}
.text-white {
    padding: 0;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}
.text-white-50 {
    margin-right: 10px;
}

/* ===== NAVIGATION ===== */
.admin-navbar {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
    margin-top: 1.5rem;
}

.admin-navbar .nav-link {
    border-radius: 8px;
    padding: 0.7rem 1.2rem;
    margin: 0 0.3rem;
    color: var(--dark-color);
    font-weight: 500;
    transition: all 0.3s ease;
}

.admin-navbar .nav-link:hover,
.admin-navbar .nav-link.active {
    animation: pulse 1.5s infinite;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}


.admin-navbar .nav-link i {
    margin-right: 0.5rem;
}

/*!* Navigation pills *!*/
/*.nav-pills .nav-link {*/
/*    color: #4e4e4e;*/
/*    border-radius: 30px;*/
/*    padding: 8px 20px;*/
/*    margin: 0 5px;*/
/*    font-weight: 600;*/
/*    transition: all 0.3s;*/
/*    border: 1px solid #dee2e6;*/
/*}*/

/*.nav-pills .nav-link.active {*/
/*    background: linear-gradient(135deg, var(--dark-bg) 0%, #172b4d 100%);*/
/*    color: white;*/
/*    border-color: transparent;*/
/*}*/

/* ===== CARTES ET STATISTIQUES ===== */

.stat-card.warning { border-left-color: var(--warning-color); }
.stat-card.danger { border-left-color: var(--danger-color); }
.stat-card.success { border-left-color: var(--secondary-color); }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stats-card {
    background: white;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    border: none;
    position: relative;
    overflow: hidden;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Styles de bordure pour les cartes de stats */
.stats-card-primary { border-left: 4px solid var(--primary-color); }
.stats-card-secondary { border-left: 4px solid var(--secondary-color); }
.stats-card-success { border-left: 4px solid var(--success-color); }
.stats-card-warning { border-left: 4px solid var(--warning-color); }
.stats-card-info { border-left: 4px solid var(--info-color); }
.stats-admin { border-top: 4px solid var(--admin-color); }
.stats-enterprise { border-top: 4px solid var(--enterprise-color); }
.stats-user { border-top: 4px solid var(--user-color); }
.stats-revenue { border-top: 4px solid var(--revenue-color); }

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}
.stats-card-success::before { background-color: var(--success-color); }
.stats-card-primary::before { background-color: var(--primary-color); }
.stats-card-secondary::before { background-color: var(--secondary-color); }
.stats-card-warning::before { background-color: var(--warning-color); }
.stats-card-danger::before { background-color: var(--danger-color); }
.stats-card-info::before { background-color: var(--info-color); }
.stats-card-purple::before { background-color: var(--purple-color); }


.stats-admin {
    border-top: 4px solid var(--admin-color);
}

.stats-enterprise {
    border-top: 4px solid var(--enterprise-color);
}

.stats-user {
    border-top: 4px solid var(--user-color);
}

.stats-revenue {
    border-top: 4px solid var(--revenue-color);
}


.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.stat-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    opacity: 0.2;
    color: var(--primary-color);
}
.stats-card {
    background: white;
    border: none;
    border-radius: 15px; /* Priorité au rayon le plus grand */
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease; /* Fusionne les transitions */
    animation: fadeIn 0.6s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.stat-trend {
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.trend-up { color: var(--success-color); }
.trend-down { color: var(--danger-color); }
.trend-neutral { color: var(--warning-color); }

/* Cartes d'actions rapides */
.quick-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: white;
    border: 1px solid #e3e6f0;
    border-radius: 0.5rem;
    text-decoration: none;
    color: var(--dark-color);
    transition: all 0.3s ease;
    box-shadow: 0 0.15rem 0.75rem rgba(0, 0, 0, 0.05);
}

.quick-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.quick-action-btn i {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.quick-action-card {
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    border-radius: 10px;
}

.quick-action-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    border-color: #4e73df;
}

/* Cartes génériques */
.card {
    border: none;
    border-radius: 12px;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.card-body {
    padding: 2rem 1.5rem;
}

.card .icon {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Cartes de détails */
.detail-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    margin-bottom: 1.5rem;
    border: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.detail-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.detail-card-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    color: #2c3e50;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-card-body {
    padding: 1.5rem;
}

/* Cartes d'entreprise */
.company-card {
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.company-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-color: #1cc88a;
}

.company-card-header {
    background: linear-gradient(135deg, #f8f9fc 0%, #eaecf4 100%);
    padding: 1rem;
    border-bottom: 1px solid #e3e6f0;
    position: relative;
}

.company-card-body {
    padding: 1.5rem;
}

/* Cartes d'utilisateur */
.user-card {
    text-align: center;
    padding: 20px;
    border-radius: var(--border-radius);
    background-color: white;
    box-shadow: var(--card-shadow);
    transition: all 0.3s;
}

.user-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* Cartes d'action */
.action-card {
    border-radius: 10px;
    transition: all 0.3s;
    height: 100%;
    box-shadow: var(--card-shadow);
    border: none;
    border-top: 4px solid transparent;
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.action-card-primary { border-top-color: var(--admin-color); }
.action-card-success { border-top-color: var(--enterprise-color); }
.action-card-warning { border-top-color: var(--revenue-color); }
.action-card-info { border-top-color: #36b9cc; }

.action-card .icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.action-card .icon-primary {
    background-color: rgba(78, 115, 223, 0.15);
    color: var(--admin-color);
}

.action-card .icon-success {
    background-color: rgba(28, 200, 138, 0.15);
    color: var(--enterprise-color);
}

.action-card .icon-warning {
    background-color: rgba(246, 194, 62, 0.15);
    color: var(--revenue-color);
}

.action-card .icon-info {
    background-color: rgba(54, 185, 204, 0.15);
    color: #36b9cc;
}

/* ===== TABLEAUX ===== */
.table-responsive {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.table th {
    background-color: #f8f9fa;
    border-top: none;
    font-weight: 600;
    color: var(--dark-color);
    padding: 1rem;
    vertical-align: middle;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
    border-color: #f1f3f9;
}

.table-hover tbody tr {
    transition: all 0.3s ease;
}

.table-hover tbody tr:hover {
    background-color: rgba(78, 115, 223, 0.05);
    transform: translateX(5px);
}

/* Tableaux spécifiques */
.user-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.user-table th {
    background: #f8f9fa;
    padding: 1rem;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.user-table td {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.user-table tr:last-child td {
    border-bottom: none;
}

.user-table tr:hover {
    background-color: rgba(67, 97, 238, 0.05);
}

.company-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.company-table th {
    background: #f8f9fa;
    padding: 12px 15px;
    font-weight: 600;
    color: #495057;
    border-top: 1px solid #e9ecef;
}

.company-table td {
    padding: 15px;
    background: white;
    border-top: 1px solid #e9ecef;
    vertical-align: middle;
}

.company-table tr {
    transition: all 0.2s;
    box-shadow: var(--card-shadow);
    border-radius: 8px;
}

.company-table tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

/* ===== BOUTONS ET ACTIONS ===== */
.btn {
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    font-weight: 500;
    transition: var(--transition);
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #0b5ed7;
    border-color: #0a58ca;
    transform: translateY(-2px);
    color: white;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

/* Boutons d'action */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.action-btn {
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: 1px solid transparent;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.action-btn.view {
    background-color: rgba(23, 162, 184, 0.1);
    color: #17a2b8;
    border: 1px solid rgba(23, 162, 184, 0.2);
}

.action-btn.edit {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.action-btn.toggle {
    background-color: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.2);
}

.action-btn.delete {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.action-btn.export {
    background-color: rgba(108, 117, 125, 0.1);
    color: #6c757d;
    border: 1px solid rgba(108, 117, 125, 0.2);
}

.export-btn {
    margin-left: 10px;
}

/* Icônes d'action */
.action-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    cursor: pointer;
    background-color: rgba(78, 115, 223, 0.1);
    color: var(--secondary-color);
}

.action-icon:hover {
    background-color: var(--secondary-color);
    color: white;
}

.action-icon.edit {
    background-color: rgba(28, 200, 138, 0.1);
    color: var(--primary-color);
}

.action-icon.edit:hover {
    background-color: var(--primary-color);
    color: white;
}

.action-icon.delete {
    background-color: rgba(231, 74, 59, 0.1);
    color: var(--danger-color);
}

.action-icon.delete:hover {
    background-color: var(--danger-color);
    color: white;
}

.action-icon.view {
    background-color: rgba(32, 201, 151, 0.1);
    color: #20c997;
}

.action-icon.view:hover {
    background-color: #20c997;
    color: white;
}

.action-critical { background-color: rgba(231, 74, 59, 0.1); color: #e74a3b; }
.action-warning { background-color: rgba(246, 194, 62, 0.1); color: #f6c23e; }
.action-success { background-color: rgba(28, 200, 138, 0.1); color: #1cc88a; }


/* ===== BADGES ET INDICATEURS ===== */
.badge {
    font-weight: 500;
    padding: 0.5rem 0.8rem;
    border-radius: 20px;
    display: inline-block;
}

.level-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
}

.status-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.role-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Styles de badges spécifiques */
.badge-security { background-color: rgba(231, 74, 59, 0.15); color: #e74a3b; }
.badge-system { background-color: rgba(108, 117, 125, 0.15); color: #6c757d; }
.badge-company { background-color: rgba(28, 200, 138, 0.15); color: #1cc88a; }
.badge-subscription { background-color: rgba(246, 194, 62, 0.15); color: #f6c23e; }

.badge-admin { background-color: rgba(78, 115, 223, 0.15); color: var(--admin-color); }
.badge-enterprise { background-color: rgba(28, 200, 138, 0.15); color: var(--enterprise-color); }
.badge-user { background-color: rgba(231, 74, 59, 0.15); color: var(--user-color); }
.badge-basic { background-color: rgba(78, 115, 223, 0.15); color: #4e73df; }
.badge-standard { background-color: rgba(28, 200, 138, 0.15); color: #1cc88a; }
.badge-premium { background-color: rgba(231, 74, 59, 0.15); color: #e74a3b; }

.status-active { background-color: rgba(25, 135, 84, 0.15); color: var(--success-color); }
.status-pending { background-color: rgba(255, 193, 7, 0.15); color: #fd7e14; }
.status-inactive { background-color: rgba(108, 117, 125, 0.15); color: var(--secondary-color); }

.role-basic { background-color: rgba(108, 117, 125, 0.15); color: #6c757d; }
.role-premium { background-color: rgba(255, 193, 7, 0.15); color: #ffc107; }
.role-enterprise { background-color: rgba(111, 66, 193, 0.15); color: #6f42c1; }
.role-admin { background-color: rgba(231, 74, 59, 0.15); color: var(--danger-color); }
.role-user { background-color: rgba(78, 115, 223, 0.15); color: var(--secondary-color); }
.role-employee { background-color: rgba(28, 200, 138, 0.15); color: var(--primary-color); }
.role-super-admin { background-color: rgba(108, 117, 125, 0.15); color: #6c757d; }
.role-client-admin { background-color: rgba(54, 185, 204, 0.15); color: var(--info-color); }

/* Indicateurs d'activité */
.activity-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}

.activity-active { background-color: var(--secondary-color); }
.activity-inactive { background-color: var(--danger-color); }

/* ===== FORMULAIRES ET FILTRES ===== */
.filter-section {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    margin-top: 1rem;
    box-shadow: var(--card-shadow);
}

.filter-section .form-control,
.filter-section .form-select {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 0.75rem;
}

.filter-section .form-control:focus,
.filter-section .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.filter-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
}

.filter-title {
    font-weight: 600;
    margin-bottom: 15px;
    color: #4e4e4e;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-label {
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: #6c757d;
}

/* Barre de recherche */
.search-container {
    position: relative;
    margin-bottom: 20px;
}

.search-container i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.search-container input {
    padding-left: 40px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    width: 100%;
}

/* Curseur de plage */
.range-slider {
    width: 100%;
    margin: 10px 0;
}

/* Interrupteur pour filtres avancés */
.filter-toggle {
    cursor: pointer;
    color: var(--primary-color);
    font-weight: 500;
}

.advanced-filters {
    display: none;
    margin-top: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ===== MODAUX ===== */
.modal-content {
    border-radius: 15px;
    border: none;
}

.modal-header {
    background: var(--bg-gradient);
    color: white;
    border-radius: 15px 15px 0 0;
    padding: 1.5rem;
}

.modal-title {
    display: flex;
    align-items: center;
}

.modal-title i {
    margin-right: 0.5rem;
}

.btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.modal-footer {
    border-top: 1px solid #f1f3f9;
    padding: 1.5rem;
}

/* Modals spécifiques */
.logout-modal .modal-content {
    border-radius: 12px;
    overflow: hidden;
}

.logout-modal .modal-header {
    background: linear-gradient(135deg, var(--dark-bg) 0%, #172b4d 100%);
    color: white;
    border-bottom: none;
}

.logout-modal .modal-footer {
    border-top: none;
}

.logout-modal .btn-confirm {
    background: linear-gradient(135deg, var(--enterprise-color) 0%, #17a673 100%);
    border: none;
    color: white;
}

.logout-modal .btn-confirm:hover {
    background: linear-gradient(135deg, #17a673 0%, var(--enterprise-color) 100%);
    color: white;
}

/* ===== MESSAGES FLASH ===== */
.flash-messages-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
}

.flash-message {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.5s ease;
    position: relative;
    overflow: hidden;
}
.flash-message::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
}

 .flash-message.success {
    background: #f0f9f0;
    color: #0f5132;
}

.flash-message.success::before {
    background: var(--success-color);
}

.flash-message.danger {
    background: #fdf3f2;
    color: #842029;
}

.flash-message.danger::before {
    background: var(--danger-color);
}

.flash-message.warning {
    background: #fffbf0;
    color: #664d03;
}

.flash-message.warning::before {
    background: var(--warning-color);
}

.flash-icon {
    margin-right: 1rem;
    font-size: 1.5rem;
}


@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.flash-content {
    flex: 1;
}

.flash-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 1rem;
    opacity: 0.7;
    transition: var(--transition);
}

.flash-close:hover {
    opacity: 1;
}

/* ===== ÉTATS VIDES ET ERREURS ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--secondary-color);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h5 {
    margin-bottom: 0.5rem;
    color: #495057;
}

.empty-state p {
    margin-bottom: 1.5rem;
}

.error-container {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: var(--card-shadow);
    text-align: center;
    border-left: 4px solid var(--danger-color);
}

.error-icon {
    font-size: 4rem;
    color: var(--danger-color);
    margin-bottom: 1rem;
}

/* ===== PAGINATION ===== */
.pagination {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.page-link {
    border-radius: 8px;
    margin: 0 0.2rem;
    border: 1px solid #e2e8f0;
    color: var(--secondary-color);
    padding: 0.5rem 0.75rem;
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.pagination-container {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-top: 2rem;
    box-shadow: var(--card-shadow);
}

/* ===== LOGS ===== */

.audit-log-card {
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s;
    height: 100%;
    box-shadow: var(--card-shadow);
    border: none;
    margin-bottom: 15px;
}

.audit-log-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.audit-log-header {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.audit-log-body {
    padding: 0;
}

.audit-log-footer {
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-top: 1px solid #f0f0f0;
    font-size: 0.85rem;
}

.log-action {
    font-weight: 600;
    margin-bottom: 5px;
}

.log-details {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 10px;
}

.log-timestamp {
    font-size: 0.85rem;
    color: #6c757d;
}

.log-user {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    margin-right: 10px;
}


.log-ip {
    font-size: 0.85rem;
    background-color: #e9ecef;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}



.log-type-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}


.timeline {
    position: relative;
    padding-left: 30px;
    margin-top: 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #e9ecef;
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -30px;
    top: 5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: white;
    border: 2px solid var(--admin-color);
    z-index: 1;
}

.timeline-item.security::before { border-color: #e74a3b; }
.timeline-item.user::before { border-color: #4e73df; }
.timeline-item.system::before { border-color: #6c757d; }
.timeline-item.company::before { border-color: #1cc88a; }
.timeline-item.subscription::before { border-color: #f6c23e; }


/* ===== INDICATEURS DE CHARGEMENT ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes cardAppear {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes highlightActivity {
    0% { background-color: rgba(78, 115, 223, 0.1); }
    100% { background-color: transparent; }
}

.animated-item {
    animation: fadeIn 0.5s ease forwards;
}

.animated-card {
    animation: cardAppear 0.6s ease forwards;
    opacity: 0;
    transform: translateY(-2px);
}

.new-activity {
    animation: highlightActivity 2s ease;
}

/* Délais d'animation pour les cartes de statistiques */
.stats-card:nth-child(2) { animation-delay: 0.1s; }
.stats-card:nth-child(3) { animation-delay: 0.2s; }
.stats-card:nth-child(4) { animation-delay: 0.3s; }

/* ===== COMPOSANTS D'INTERFACE ===== */
/* Barre de progression */
.progress {
    background-color: #e9ecef;
    border-radius: 10px;
    height: 1rem;
    overflow: hidden;
}

.progress-bar {
    border-radius: 10px;
    height: 100%;
    transition: width 0.3s ease;
}

.progress-thin {
    height: 6px;
    margin: 0.5rem 0;
}

/* Conteneurs de graphiques */
.chart-container {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
    height: 100%;
}

.chart-placeholder {
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border-radius: 0.25rem;
    color: #6c757d;
}

/* Éléments d'activité */
.activity-item {
    border-left: 4px solid #4e73df;
    transition: all 0.3s ease;
    padding: 1rem;
    margin-bottom: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
}

.activity-item:hover {
    background-color: #f8f9fc;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    margin-right: 1rem;
}

.activity-icon i {
    font-size: 1.1rem;
}

/* Cartes de métriques */
.metric-card {
    background: linear-gradient(135deg, #f8f9fc 0%, #e9ecef 100%);
    border-radius: var(--border-radius);
    padding: 1rem;
    text-align: center;
    height: 100%;
}

.metric-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--dark-color);
}

.metric-label {
    font-size: 0.85rem;
    color: #6c757d;
    text-transform: uppercase;
}

/* Conteneurs d'onglets */
.tab-content {
    padding: 1.5rem;
    background: white;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: var(--card-shadow);
}

.nav-tabs {
    border-bottom: 1px solid #dee2e6;
}

.nav-tabs .nav-link {
    border: none;
    padding: 1rem 1.5rem;
    font-weight: 500;
    color: #6c757d;
    border-radius: 0;
}

.nav-tabs .nav-link.active {
    background: white;
    border-bottom: 3px solid var(--primary-color);
    color: var(--primary-color);
}

/* ===== COMPOSANTS D'ENTREPRISE ===== */
.company-avatar-sm {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 0.9rem;
}

.company-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    margin-bottom: 2rem;
}

.company-info {
    flex-grow: 1;
}

.company-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.company-selection-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px;
    background: white;
}

.company-selection-list .form-check {
    padding: 8px 12px;
    border-radius: 5px;
    transition: background-color 0.2s;
    margin-bottom: 5px;
}

.company-selection-list .form-check:hover {
    background-color: #f8f9fa;
}

.company-selection-list .form-check:last-child {
    margin-bottom: 0;
}

/* ===== INFORMATIONS STRUCTURÉES ===== */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.info-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.info-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e9ecef;
}

.info-section-header i {
    color: #3498db;
    font-size: 1.25rem;
}

.info-section-header h4 {
    margin: 0;
    color: #2c3e50;
    font-weight: 600;
}

.info-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f8f9fa;
    align-items: start;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: #6c757d;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    color: #2c3e50;
    font-weight: 500;
}

.info-value a {
    color: #3498db;
    text-decoration: none;
}

.info-value a:hover {
    text-decoration: underline;
}

/* ===== COMPOSANTS DE SYSTÈME ===== */
/* Indicateurs de santé du système */
.system-health-indicator {
    height: 8px;
    border-radius: 4px;
    background-color: #e9ecef;
    overflow: hidden;
    margin-top: 10px;
}

.health-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1s ease;
}

.health-good {
    background: var(--success-color);
}

.health-warning {
    background: var(--warning-color);
}

.health-danger {
    background: var(--danger-color);
}

.health-critical { background-color: #e74a3b; }


.system-health-card {
    position: relative;
    overflow: hidden;
}

.health-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background: linear-gradient(90deg, rgba(28, 200, 138, 0.15) 0%, rgba(28, 200, 138, 0.05) 100%);
    opacity: 0.6;
}

/* Cartes d'alerte */
.alert-card {
    border-left: 4px solid;
    border-radius: 0 6px 6px 0;
    margin-bottom: 15px;
    transition: all 0.3s;
    padding: 1rem;
    background: white;
    box-shadow: var(--card-shadow);
}

.alert-high {
    border-left-color: #e74a3b;
    background: rgba(231, 74, 59, 0.05);
}

.alert-medium {
    border-left-color: #f6c23e;
    background: rgba(246, 194, 62, 0.05);
}

.alert-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

/* Avertissement d'usurpation d'identité */
.impersonation-warning {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 10px 15px;
    margin-bottom: 20px;
    border-radius: 6px;
    color: #856404;
}

/* ===== COMPOSANTS D'UTILISATEUR ===== */
.logout-container {
    display: flex;
    align-items: center;
    margin-left: 15px;
    position: relative;
}

.user-info {
    margin-right: 15px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.user-info i {
    margin-right: 5px;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    transition: all 0.3s;
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.logout-btn i {
    margin-right: 8px;
}

/* Sélecteur de langue */
.language-selector {
    position: relative;
    display: inline-block;
    margin: 1rem;
    z-index: 1000; /* Z-index très élevé */
}

.language-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.language-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
}

.language-btn i {
    margin-right: 8px;
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #e1e7ff;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    padding: 0.75rem;
    min-width: 160px;
    z-index: 1001; /* Encore plus élevé que le conteneur */
    display: none;
    margin-top: 0.5rem;
    animation: fadeIn 0.3s ease;
}


.language-dropdown.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

.lang-option {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s ease;
    color: #333;
}

.lang-option:hover {
            background: #f8f9fa;
        }

.lang-option.active {
    background: #e6f7ff;
    color: var(--admin-color);
    font-weight: 600;
}

.lang-flag {
    width: 20px;
    height: 15px;
    margin-right: 10px;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

footer {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 2rem 0;
    margin-top: 3rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #6c757d;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

footer h6 {
    font-size: 1rem;
    font-weight: 600;
    color: #343a40;
    margin-bottom: 0.5rem;
}

footer p {
    font-size: 0.875rem;
    margin-bottom: 0;
}

footer .text-md-end {
    text-align: right;
}
/* ===== BARRE DE DÉFILEMENT PERSONNALISÉE ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ===== IMPRESSION ===== */
@media print {
    .btn, .admin-navbar, .filter-section, .flash-messages-container,
    .action-buttons, .logout-container, .language-selector {
        display: none !important;
    }

    .container {
        width: 100%;
        max-width: none;
    }

    .stats-card, .dashboard-section {
        break-inside: avoid;
    }
}

/* ===== DESIGN RESPONSIVE ===== */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 15px;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 992px) {
    .info-grid {
        grid-template-columns: 1fr;
    }

    .info-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .company-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .company-actions {
        flex-direction: column;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        padding: 1rem;
    }

    .dashboard-section {
        padding: 1.5rem;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-actions {
        margin-top: 1rem;
        width: 100%;
        justify-content: space-between;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions {
        flex-direction: column;
    }

    .action-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }

    .action-btn {
        width: 100%;
        justify-content: flex-start;
    }

    .logout-container {
        margin-top: 15px;
        margin-left: 0;
        flex-direction: column;
        align-items: flex-start;
    }

    .language-selector {
        margin-left: 0;
        margin-top: 10px;
    }

    .admin-navbar .nav-link {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
        margin: 0.1rem;
    }

    .table-responsive {
        font-size: 0.9rem;
    }

    .company-table {
        font-size: 0.85rem;
    }

    .action-icon {
        width: 30px;
        height: 30px;
    }

    .action-card .icon {
        width: 50px;
        height: 50px;
    }

    .section-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .flash-messages-container {
        left: 20px;
        right: 20px;
        max-width: none;
    }
}

@media (max-width: 576px) {
    .logout-container .btn {
        margin-top: 0.5rem;
        margin-left: 0 !important;
    }

    .admin-navbar .nav-link {
        font-size: 0.8rem;
        padding: 0.5rem;
    }

    .admin-navbar .nav-link i {
        margin-right: 0.3rem;
    }

    .filter-section .col-md-3,
    .filter-section .col-md-2 {
        margin-bottom: 0.5rem;
    }

    .stats-card .icon {
        width: 40px;
        height: 40px;
    }

    .user-table {
        font-size: 0.875rem;
    }

    .activity-item .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .activity-item .text-end {
        margin-top: 10px;
        align-self: flex-end;
    }
}