:root {
    /* Couleurs principales */
    --primary-color: #1a237e;
    --primary-light: #534bae;
    --primary-dark: #000051;
    --primary-alpha: rgba(26, 35, 126, 0.9);
    
    /* Couleurs secondaires */
    --secondary-color: #f5f5f5;
    --secondary-light: #ffffff;
    --secondary-dark: #e0e0e0;
    
    /* Couleurs de texte */
    --text-color: #ffffff;
    --text-dark: #333333;
    --text-light: #757575;
    --text-on-primary: #ffffff;
    
    /* Couleurs d'état */
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --danger-color: #f44336;
    --info-color: #2196f3;
    
    /* Espacements */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    
    /* Bordures */
    --border-radius: 0.375rem;
    --border-radius-lg: 0.5rem;
    --border-width: 1px;
    --border-color: rgba(0, 0, 0, 0.1);
    
    /* Ombres */
    --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);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

*::before,
*::after {
    box-sizing: inherit;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--secondary-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

/* Sidebar amélioré */
.sidebar {
    width: 280px;
    background-color: var(--primary-color);
    color: var(--text-color);
    height: 100vh;
    position: fixed;
    transition: transform var(--transition-normal);
    z-index: 1000;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: var(--space-lg);
    background-color: var(--primary-dark);
    border-bottom: var(--border-width) solid rgba(255, 255, 255, 0.1);
}

.sidebar-menu {
    list-style: none;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    color: rgba(255, 255, 255, 0.9);
    transition: all var(--transition-normal);
    border-left: 4px solid transparent;
}

.sidebar-menu li a:hover {
    background-color: var(--primary-light);
    color: var(--text-color);
}

.sidebar-menu li a.active {
    background-color: var(--primary-dark);
    border-left-color: var(--info-color);
    color: var(--text-color);
    font-weight: 500;
}

.sidebar-menu li a i {
    margin-right: var(--space-md);
    width: 24px;
    text-align: center;
    font-size: 1.1rem;
}

/* Contenu principal */
.content {
    flex: 1;
    margin-left: 280px;
    padding: var(--space-lg);
    transition: margin var(--transition-normal);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
}

/* Cartes améliorées */
.card {
    background-color: var(--secondary-light);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    border: var(--border-width) solid var(--border-color);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: var(--border-width) solid var(--border-color);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin: 0;
}

/* Boutons améliorés */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: var(--border-width) solid transparent;
}

.btn i {
    margin-right: var(--space-xs);
}

.btn-sm {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.75rem;
}

.btn-lg {
    padding: var(--space-md) var(--space-lg);
    font-size: 1rem;
}

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

.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-on-primary);
    border-color: var(--primary-dark);
}

.btn-primary:hover {
    background-color: var(--primary-light);
    transform: translateY(-1px);
}

.btn-outline-primary {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: var(--text-on-primary);
}

/* Formulaires améliorés */
.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    margin-bottom: var(--space-xs);
    font-weight: 500;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    transition: border-color var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.1);
}

.select-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23333'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.25rem;
}

/* Dashboard Cards */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-card {
    background: var(--secondary-light);
    border-radius: var(--border-radius-lg);
    padding: 1.75rem;
    text-align: center;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow);
    border: var(--border-width) solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-color);
}

.dashboard-card i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    background: rgba(26, 35, 126, 0.1);
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.dashboard-card h3 {
    font-size: 2.25rem;
    font-weight: 700;
    margin: 0.5rem 0;
    color: var(--primary-dark);
    line-height: 1;
}

.dashboard-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0;
}

/* Cartes spécifiques avec couleurs différentes */
.dashboard-card:nth-child(1) i { /* Services */
    color: var(--success-color);
    background: rgba(76, 175, 80, 0.1);
}

.dashboard-card:nth-child(1)::before {
    background: var(--success-color);
}

.dashboard-card:nth-child(2) i { /* Factures */
    color: var(--warning-color);
    background: rgba(255, 152, 0, 0.1);
}

.dashboard-card:nth-child(2)::before {
    background: var(--warning-color);
}

.dashboard-card:nth-child(3) i { /* Tickets */
    color: var(--info-color);
    background: rgba(33, 150, 243, 0.1);
}

.dashboard-card:nth-child(3)::before {
    background: var(--info-color);
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
    
    .dashboard-card {
        padding: 1.5rem;
    }
    
    .dashboard-card i {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .dashboard-card h3 {
        font-size: 2rem;
    }
}

/* Animation pour le chargement */
@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-card {
    animation: cardEntrance 0.6s ease-out;
    animation-fill-mode: backwards;
}

.dashboard-card:nth-child(1) {
    animation-delay: 0.1s;
}

.dashboard-card:nth-child(2) {
    animation-delay: 0.2s;
}

.dashboard-card:nth-child(3) {
    animation-delay: 0.3s;
}

/* Tableaux améliorés */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th {
    background-color: var(--primary-color);
    color: var(--text-on-primary);
    padding: var(--space-md);
    text-align: left;
    font-weight: 500;
}

.table td {
    padding: var(--space-md);
    border-bottom: var(--border-width) solid var(--border-color);
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Badges */
.badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 10rem;
}

.badge-success {
    background-color: var(--success-color);
    color: white;
}

.badge-warning {
    background-color: var(--warning-color);
    color: white;
}

.badge-danger {
    background-color: var(--danger-color);
    color: white;
}

.badge-info {
    background-color: var(--info-color);
    color: white;
}

/* Alertes */
.alert {
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    border-radius: var(--border-radius);
    border: var(--border-width) solid transparent;
}

.alert-success {
    background-color: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.alert-danger {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .content {
        margin-left: 0;
    }
    
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn var(--transition-normal) forwards;
}



/* Utilitaires */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-light); }
.mt-1 { margin-top: var(--space-xs); }
.mt-2 { margin-top: var(--space-sm); }
.mt-3 { margin-top: var(--space-md); }
.mt-4 { margin-top: var(--space-lg); }
.mt-5 { margin-top: var(--space-xl); }