/* Palette de couleurs professionnelle */
:root {
    /* Couleur primaire - Bleu principal */
    --color-primary: #137af2;
    --color-primary-dark: #0d5fbf;
    --color-primary-light: #4a9ef5;
    --color-primary-lighter: #e6f2ff;
    
    /* Couleur secondaire - Orange/Ambre pour accents */
    --color-secondary: #f59e0b;
    --color-secondary-dark: #d97706;
    --color-secondary-light: #fef3c7;
    
    /* Success - Vert pour arrivées */
    --color-success: #10b981;
    --color-success-dark: #059669;
    --color-success-light: #c0f3db;
    --color-success-lighter: #f0fdf4;
    
    /* Danger - Rouge pour sorties */
    --color-danger: #e8b5b5;
    --color-danger-dark: #ea8585;
    --color-danger-light: #fef2f2;
    --color-danger-lighter: #fee2e2;
    
    /* Texte */
    --color-text-primary: #1a1d29;
    --color-text-secondary: #4b5563;
    --color-text-tertiary: #6b7280;
    --color-text-inverse: #ffffff;
    
    /* Backgrounds */
    --color-bg-primary: #ffffff;
    --color-bg-secondary: #f8f9fa;
    --color-bg-tertiary: #f5f7fa;
    --color-bg-sidebar: #ffffff;
    
    /* Bordures et séparateurs */
    --color-border: #e5e7eb;
    --color-border-light: #f3f4f6;
    --color-border-dark: #d1d5db;
    
    /* Ombres */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

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

html {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: var(--color-bg-tertiary);
    height: 100vh;
    padding: 0;
    margin: 0;
    color: var(--color-text-primary);
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--color-bg-sidebar);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    border-right: 2px solid var(--color-border);
    transition: width 0.3s ease;
}

.sidebar-toggle {
    position: absolute;
    top: 20px;
    right: -12px;
    width: 24px;
    height: 24px;
    background: var(--color-bg-sidebar);
    border: 2px solid var(--color-border);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    transition: all 0.3s ease;
    color: var(--color-text-secondary);
    box-shadow: var(--shadow-sm);
}

.sidebar-toggle:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-text-inverse);
    transform: scale(1.1);
}

.sidebar.collapsed,
html.sidebar-collapsed .sidebar {
    width: 80px;
}

.sidebar.collapsed .sidebar-header,
html.sidebar-collapsed .sidebar .sidebar-header {
    padding: 24px 10px;
}

.sidebar.collapsed .logo-text,
html.sidebar-collapsed .sidebar .logo-text {
    font-size: 1.5em;
    letter-spacing: 2px;
}

.sidebar.collapsed .sidebar-nav a,
html.sidebar-collapsed .sidebar .sidebar-nav a {
    padding: 14px 10px;
    justify-content: center;
    font-size: 0;
    line-height: 0;
    color: transparent;
}

.sidebar.collapsed .sidebar-nav a .nav-icon,
html.sidebar-collapsed .sidebar .sidebar-nav a .nav-icon {
    margin-right: 0;
    font-size: 1px;
    display: inline-flex;
    width: 20px;
    height: 20px;
    color: var(--color-text-secondary);
}

.sidebar.collapsed .sidebar-nav a:hover .nav-icon,
.sidebar.collapsed .sidebar-nav a.active .nav-icon,
html.sidebar-collapsed .sidebar .sidebar-nav a:hover .nav-icon,
html.sidebar-collapsed .sidebar .sidebar-nav a.active .nav-icon {
    color: var(--color-primary);
}

.sidebar.collapsed .sidebar-nav a .nav-icon svg,
html.sidebar-collapsed .sidebar .sidebar-nav a .nav-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

.sidebar.collapsed .sidebar-toggle {
    right: -12px;
    transform: rotate(180deg);
}

.sidebar.collapsed .sidebar-toggle:hover {
    transform: rotate(180deg) scale(1.1);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--color-border);
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo img {
    max-width: 100%;
    height: auto;
    max-height: 60px;
}

.logo-text {
    font-size: 2.2em;
    text-align: center;
    letter-spacing: 4px;
    color: var(--color-text-primary);
    display: block;
    line-height: 1.2;
}

.logo-text a {
    color: inherit;
    text-decoration: none;
    display: block;
    transition: transform 0.2s ease;
}

.logo-text a:hover {
    transform: scale(1.05);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin: 5px 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 14px 24px;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    font-size: 0.95em;
    font-weight: 500;
}

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-right: 12px;
    color: var(--color-text-secondary);
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.nav-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
}

.sidebar-nav a:hover .nav-icon,
.sidebar-nav a.active .nav-icon {
    color: var(--color-primary);
}

.sidebar-nav a:hover {
    background: var(--color-bg-tertiary);
    border-left-color: var(--color-primary);
    color: var(--color-text-primary);
}

.sidebar-nav a.active {
    background: var(--color-bg-tertiary);
    border-left-color: var(--color-primary);
    color: var(--color-text-primary);
    font-weight: 600;
}

/* Footer de la sidebar */
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--color-border);
    margin-top: auto;
}

.user-info {
    margin-bottom: 12px;
}

.user-name {
    font-size: 0.9em;
    color: var(--color-text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--color-bg-secondary);
    border-radius: 6px;
}

.user-icon {
    color: var(--color-text-secondary);
    flex-shrink: 0;
}

.user-name-text {
    flex: 1;
}

.logout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgb(244, 55, 55);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: var(--color-danger-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.logout-btn:active {
    transform: translateY(0);
}

.logout-btn svg {
    width: 18px;
    height: 18px;
}

/* Styles pour sidebar collapsed */
.sidebar.collapsed .sidebar-footer,
html.sidebar-collapsed .sidebar .sidebar-footer {
    padding: 20px 10px;
}

.sidebar.collapsed .user-name,
html.sidebar-collapsed .sidebar .user-name {
    font-size: 0;
    padding: 8px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.sidebar.collapsed .user-name::before,
html.sidebar-collapsed .sidebar .user-name::before {
    content: attr(data-initial);
    font-size: 14px;
    color: var(--color-text-secondary);
}

.sidebar.collapsed .logout-btn span,
html.sidebar-collapsed .sidebar .logout-btn span {
    display: none;
}

.sidebar.collapsed .logout-btn,
html.sidebar-collapsed .sidebar .logout-btn {
    padding: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin: 0 auto;
}

/* Contenu principal */
.main-content {
    flex: 1;
    margin-left: 260px;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 30px;
    overflow-y: auto;
    overflow-x: hidden;
    background: 
        /* Pattern de points très subtil */
        radial-gradient(circle at 1px 1px, rgba(0, 0, 0, 0.03) 1px, transparent 0),
        /* Dégradé principal professionnel */
        linear-gradient(135deg, #f5f7fa 0%, #e8edf2 50%, #f0f4f8 100%);
    background-size: 40px 40px, 100% 100%;
    position: relative;
    transition: margin-left 0.3s ease;
}

/* Effet de profondeur avec des formes géométriques discrètes */
.main-content::before {
    content: '';
    position: fixed;
    top: 0;
    left: 260px;
    right: 0;
    bottom: 0;
    background: 
        /* Formes circulaires très subtiles pour la profondeur */
        radial-gradient(circle at 20% 30%, rgba(19, 122, 242, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(19, 122, 242, 0.015) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(19, 122, 242, 0.01) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
    transition: left 0.3s ease;
}

.sidebar.collapsed ~ .main-content::before,
html.sidebar-collapsed .main-content::before {
    left: 80px;
}


.main-content > * {
    position: relative;
    z-index: 1;
}

.sidebar.collapsed ~ .main-content,
html.sidebar-collapsed .main-content {
    margin-left: 80px;
}

.container {
    border-radius: 0;
    padding: 0;
    text-align: left;
    max-width: 100%;
    width: 100%;
    background: transparent;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    color: #151515;
    font-size: 3.5em;
    margin-bottom: 20px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    color: #666;
    font-size: 1.3em;
    margin-bottom: 60px;
    line-height: 1.6;
}

.highlight {
    color: #151515;
    font-weight: 600;
}

/* Statistiques */
/* Dashboard professionnel */

.dashboard-header {
    margin-bottom: 48px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--color-border);
}

.dashboard-header h1 {
    font-size: 2.4em;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    background: #151515;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dashboard-subtitle {
    color: var(--color-text-secondary);
    font-size: 1.05em;
    margin: 0;
    font-weight: 400;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin: 48px 0;
    width: 100%;
    max-width: 100%;
    justify-items: center;
}

.dashboard-card {
    background: linear-gradient(135deg, var(--color-bg-primary) 0%, var(--color-bg-tertiary) 100%);
    border-radius: 12px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 100%;
}


.card-header {
    background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg-tertiary) 100%);
    padding: 24px 28px;
    border-bottom: 1px solid var(--color-border);
}

.card-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Centrer les titres des cartes du dashboard */
#arrivalStats .card-header-content,
#departureStats .card-header-content,
#macStats .card-header-content,
#iphoneStats .card-header-content {
    justify-content: center;
}

.card-header h2 {
    font-size: 1.5em;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
    letter-spacing: -0.3px;
    background: #151515;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#arrivalSection .card-header h2 {
    background: linear-gradient(135deg, var(--color-text-primary) 0%, green 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#departureSection .card-header h2 {
    background: linear-gradient(135deg, var(--color-text-primary) 0%, red 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.arrival-badge {
    background: rgb(154, 241, 212);
    color: var(--color-success-dark);
}

.departure-badge {
    background: rgb(253, 216, 216);
    color: var(--color-danger-dark);
}

.type-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-content {
    padding: 28px;
}

/* Centrer le contenu de toutes les cartes du dashboard */
#arrivalStats .card-content,
#departureStats .card-content,
#macStats .card-content,
#iphoneStats .card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Centrer le stats-ratio dans les cartes Mac et iPhone */
#macStats .stats-ratio,
#iphoneStats .stats-ratio {
    justify-content: center;
}

/* Aligner la légende avec les chiffres */
#macStats .card-content .stat-label,
#iphoneStats .card-content .stat-label {
    margin-top: 8px;
    text-align: center;
    width: 100%;
}

/* Désactiver les effets hover sur les cartes Mac et iPhone */
#macStats .stats-recover:hover,
#macStats .stats-deliver:hover,
#iphoneStats .stats-recover:hover,
#iphoneStats .stats-deliver:hover {
    background-color: transparent;
    transform: none;
}

#macStats .stats-recover:hover::after,
#macStats .stats-recover:hover::before,
#macStats .stats-deliver:hover::after,
#macStats .stats-deliver:hover::before,
#iphoneStats .stats-recover:hover::after,
#iphoneStats .stats-recover:hover::before,
#iphoneStats .stats-deliver:hover::after,
#iphoneStats .stats-deliver:hover::before {
    opacity: 0;
    pointer-events: none;
}

/* Liste des utilisateurs */
.users-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 8px;
}

.user-card {
    background: linear-gradient(135deg, #ffffff 0%, var(--color-bg-tertiary) 100%);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-primary);
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.user-card-arrival {
    background: linear-gradient(135deg, var(--color-success-light) 0%, var(--color-success-lighter) 100%);
    border-left: 3px solid var(--color-success);
}

.user-card-arrival:hover {
    background: linear-gradient(135deg, var(--color-success-light) 0%, var(--color-success) 100%);
    border-left-color: var(--color-success-dark);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.user-card-departure {
    background: linear-gradient(135deg, var(--color-danger-light) 0%, var(--color-danger-lighter) 100%);
    border-left: 3px solid var(--color-danger);
}

.user-card-departure:hover {
    background: linear-gradient(135deg, var(--color-danger) 0%, var(--color-danger-dark) 100%);
    border-left-color: var(--color-danger-dark);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.user-card:hover {
    transform: translateY(-2px);
}

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

.user-name {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
}

.user-date-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-date {
    font-size: 0.9em;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.days-indicator {
    font-size: 0.75em;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.days-indicator.days-ahead {
    background: #dbeafe;
    color: #1e40af;
}

.days-indicator.days-behind {
    background: var(--color-danger-light)2e2;
    color: #991b1b;
}

.days-indicator.days-today {
    background: #fef3c7;
    color: #92400e;
}

.user-card-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-detail {
    font-size: 0.9em;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.user-detail strong {
    color: var(--color-text-primary);
    font-weight: 600;
    margin-right: 8px;
}

.no-users {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-style: italic;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.stat-category {
    margin-bottom: 32px;
}

.stat-category:last-child {
    margin-bottom: 0;
}

.stat-category-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.stat-category-title {
    font-size: 0.9em;
    font-weight: 600;
    color: #34495e;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 0;
}

.stat-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg-primary) 100%);
    border-radius: 6px;
    border-left: 3px solid #cbd5e0;
    transition: all 0.2s ease;
}

.stat-item:hover {
    background: linear-gradient(135deg, var(--color-bg-tertiary) 0%, var(--color-bg-secondary) 100%);
    border-left-color: var(--color-primary);
    box-shadow: 0 2px 6px rgba(74, 144, 226, 0.1);
}

.stat-item.clickable-stat {
    cursor: pointer;
}

.stat-item.clickable-stat:hover {
    background: #f0f4f8;
    border-left-color: var(--color-primary);
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.2);
}

.stat-item-label {
    font-size: 0.9em;
    color: var(--color-text-secondary);
    font-weight: 500;
    flex: 1;
}

.stat-item-value {
    font-size: 1.15em;
    font-weight: 600;
    color: var(--color-text-primary);
    min-width: 45px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.dashboard-action {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--color-border);
    text-align: center;
}

.action-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: #2c3e50;
    color: var(--color-text-inverse);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 0.95em;
    letter-spacing: 0.3px;
}

.action-link:hover {
    background: #34495e;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(44, 62, 80, 0.25);
}

.action-icon {
    font-size: 1.1em;
    transition: transform 0.2s ease;
}

.action-link:hover .action-icon {
    transform: translateX(3px);
}

.action-text {
    color: var(--color-text-inverse);
}

/* Styles pour les stat-items avec indicateurs de statut */
.stat-item.stat-not-ready {
    border-left-color: var(--color-danger);
}

.stat-item.stat-ready-not-delivered {
    border-left-color: #f39c12;
}

.stat-item.stat-ready-delivered {
    border-left-color: #27ae60;
}

.stat-item.stat-trained {
    border-left-color: #27ae60;
}

.stat-item.stat-not-trained {
    border-left-color: var(--color-danger);
}

.stat-item.stat-not-recovered {
    border-left-color: var(--color-danger);
}

.stat-item.stat-reinstalled-on-site {
    border-left-color: #f39c12;
}

.stat-item.stat-sold {
    border-left-color: #27ae60;
}

.stat-item.stat-recovered-reinstalled {
    border-left-color: #27ae60;
}

.stat-item.stat-deleted {
    border-left-color: #27ae60;
}

.stat-item.stat-not-deleted {
    border-left-color: var(--color-danger);
}

.stat-content {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.stat-number {
    font-size: 2.2em;
    font-weight: 800;
    color: #151515;
    margin-bottom: 8px;
    line-height: 1;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.05);
}

.stat-label {
    font-size: 0.95em;
    color: #555;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Popup d'information */
.info-popup {
    background: var(--color-bg-secondary);
    border-radius: 15px;
    padding: 30px;
    margin-top: 30px;
    border-left: 5px solid #151515;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.popup-header {
    margin-bottom: 15px;
}

.popup-header h2 {
    color: #151515;
    font-size: 1.8em;
    margin: 0;
    font-weight: 600;
}

.popup-content {
    color: #555;
    line-height: 1.8;
    font-size: 1.1em;
}

.popup-link {
    display: inline-block;
    margin-top: 15px;
    color: #151515;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.popup-link:hover {
    color: #333;
    text-decoration: underline;
}

/* Styles pour la page liste - override pour la page liste */
.page-header {
    margin-bottom: 40px;
}

.page-header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.page-header h1 {
    font-size: 2.2em;
    font-weight: 600;
    margin-bottom: 8px;
    background: #151515;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    color: var(--color-text-secondary);
    font-size: 1em;
    margin: 0;
}

.add-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--color-primary);
    color: var(--color-text-inverse);
    border: 1px solid var(--color-primary);
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: var(--shadow-sm);
}

.add-user-btn:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.add-user-icon {
    font-size: 1.3em;
    font-weight: 300;
    line-height: 1;
}

/* Section de calendrier */
.calendar-section {
    margin-bottom: 50px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fb 100%);
    border-radius: 8px;
    border: 1px solid var(--color-border-dark);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.1);
    padding: 30px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
    flex-wrap: wrap;
    gap: 20px;
}

.calendar-header h2 {
    font-size: 1.5em;
    color: var(--color-text-primary);
    margin: 0;
    font-weight: 600;
}

.calendar-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.calendar-nav-btn {
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border-dark);
    border-radius: 6px;
    width: 38px;
    height: 38px;
    font-size: 1.3em;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.calendar-nav-btn:hover {
    background: var(--color-bg-secondary);
    border-color: var(--color-border-dark);
    color: var(--color-text-primary);
    box-shadow: var(--shadow-md);
}

.clear-filter-btn {
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border-dark);
    border-radius: 6px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-weight: 500;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-secondary);
    display: inline-flex;
    align-items: center;
    margin-left: 16px;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

.clear-filter-btn::before {
    content: '✕';
    font-size: 1.1em;
    font-weight: 600;
}

.clear-filter-btn:hover {
    background: var(--color-danger-light);
    border-color: var(--color-danger);
    color: var(--color-danger);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.2);
}

/* Formulaire d'ajout d'utilisateur */
.add-user-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 0;
    width: 100%;
}

.add-user-form .form-group.full-width {
    grid-column: 1 / -1;
}

.status-selectors-group {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.875em;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="date"],
.form-group input[type="month"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--color-border-dark);
    border-radius: 6px;
    font-size: 0.95em;
    color: var(--color-text-primary);
    background: var(--color-bg-primary);
    transition: all 0.15s ease;
    font-family: inherit;
    box-sizing: border-box;
    resize: none;
    min-height: 44px;
    max-height: 44px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.form-group textarea {
    min-height: 100px;
    max-height: 100px;
    line-height: 1.5;
    overflow-y: auto;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #9ca3af;
    opacity: 1;
}

.form-group input::-webkit-input-placeholder,
.form-group textarea::-webkit-input-placeholder {
    color: #9ca3af;
    opacity: 1;
}

.form-group input::-moz-placeholder,
.form-group textarea::-moz-placeholder {
    color: #9ca3af;
    opacity: 1;
}

.form-group input:-ms-input-placeholder,
.form-group textarea:-ms-input-placeholder {
    color: #9ca3af;
    opacity: 1;
}

.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231a1d29' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 12px;
    padding-right: 40px;
    cursor: pointer;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="date"]:focus,
.form-group input[type="month"]:focus,
.form-group input[type="number"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    background-color: var(--color-text-inverse);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15);
}

.form-group select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231a1d29' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 12px;
}

.form-group input[type="text"]:required,
.form-group input[type="email"]:required,
.form-group input[type="date"]:required,
.form-group input[type="month"]:required,
.form-group input[type="number"]:required,
.form-group select:required {
    border-left: 3px solid var(--color-text-primary);
}

.form-group select:hover {
    border-color: var(--color-border-dark);
    background-color: #f8f9fa;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231a1d29' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 12px;
}

.month-year-selector {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.month-year-selector select {
    flex: 1;
    min-width: 0;
}

.month-year-selector select:first-child {
    flex: 1.5;
}

.month-year-selector select:last-child {
    flex: 1;
    min-width: 120px;
    max-width: 140px;
}


.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
}

.btn-cancel,
.btn-submit {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: 120px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-cancel {
    background: var(--color-bg-secondary);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border-dark);
    box-shadow: var(--shadow-sm);
}

.btn-cancel:hover {
    background: var(--color-border-dark);
    border-color: var(--color-border-dark);
    color: var(--color-text-primary);
    box-shadow: var(--shadow-md);
}

.btn-submit {
    background: var(--color-primary);
    color: var(--color-text-inverse);
    border: 1px solid var(--color-primary);
    box-shadow: var(--shadow-sm);
}

.btn-submit:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Boutons d'action dans le modal utilisateur */
.modal-actions {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-edit,
.btn-delete,
.task-edit-btn,
.task-delete-btn {
    padding: 10px 20px;
    border: 1px solid var(--color-border-dark);
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.15s ease;
    background: var(--color-bg-secondary);
    color: var(--color-text-secondary);
    box-shadow: var(--shadow-sm);
}

.btn-edit:hover,
.task-edit-btn:hover {
    background: var(--color-bg-primary);
    border-color: var(--color-border-dark);
    color: var(--color-text-primary);
    box-shadow: var(--shadow-md);
}

.btn-delete:hover,
.task-delete-btn:hover {
    background: var(--color-danger-light);
    border-color: var(--color-danger);
    color: var(--color-danger);
}

.calendar-month-year-container {
    position: relative;
}

.calendar-month-year {
    font-size: 1.2em;
    font-weight: 600;
    color: #2c3e50;
    min-width: 120px;
    text-align: center;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.calendar-month-year:hover {
    background: var(--color-bg-secondary);
    color: #34495e;
}

.calendar-date-picker {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-bg-secondary);
    border: 2px solid #d1d5db;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    padding: 20px;
    z-index: 1000;
    margin-top: 10px;
    min-width: 280px;
}

.calendar-date-picker.active {
    display: block;
}

.date-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.date-picker-year {
    font-size: 1.2em;
    font-weight: 700;
    color: #333;
}

.date-picker-nav {
    background: var(--color-bg-secondary);
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    width: 35px;
    height: 35px;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.date-picker-nav:hover {
    background: var(--color-border);
    border-color: #151515;
}

.date-picker-months {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.date-picker-month {
    padding: 12px 8px;
    text-align: center;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
    font-weight: 500;
    color: #333;
    background: var(--color-bg-primary);
    position: relative;
}

.date-picker-month:hover {
    background: #f0f0f0;
    border-color: #151515;
}

.date-picker-month.active {
    background: #151515;
    color: white;
    border-color: #151515;
    font-weight: 600;
}

/* Indicateurs de statut pour les mois */
.date-picker-month.status-red {
    background: #ffe0e0;
    border-color: #ffcccc;
}

.date-picker-month.status-red:hover {
    background: #ffcccc;
    border-color: #dc3545;
}

.date-picker-month.status-red.active {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.date-picker-month.status-orange {
    background: #fff4e0;
    border-color: #ffe0b3;
}

.date-picker-month.status-orange:hover {
    background: #ffe0b3;
    border-color: #ff9800;
}

.date-picker-month.status-orange.active {
    background: #ff9800;
    color: white;
    border-color: #ff9800;
}

.date-picker-month.status-green {
    background: #e0f5e0;
    border-color: #b3e6b3;
}

.date-picker-month.status-green:hover {
    background: #b3e6b3;
    border-color: #4caf50;
}

.date-picker-month.status-green.active {
    background: #4caf50;
    color: white;
    border-color: #4caf50;
}

.calendar-wrapper {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    overflow-x: auto;
}

/* Navigation avec flèches à côté des mois */
.months-navigation,
.tasks-navigation {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
}

.months-navigation .calendar-nav-btn,
.tasks-navigation .calendar-nav-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    padding: 0;
}

/* Grille avec 5 mois (mois actuel au centre, 2 avant, 2 après) */
.months-grid-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    flex: 1;
    align-items: stretch;
}

@media (max-width: 1200px) {
    .months-grid-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .months-grid-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Tous les mois ont la même hauteur */
.month-column {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    overflow: hidden;
}

.month-content-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
    background: var(--color-bg-primary);
    border-radius: 8px;
    border: 1px solid var(--color-border);
    min-height: 200px;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}

/* Délimitation entre les années (décembre -> janvier) */
.month-column.year-break {
    position: relative;
    border-left: 3px solid #9ca3af;
    padding-left: 12px;
    margin-left: 6px;
}

.year-break-header {
    position: absolute;
    top: 5%;
    left: -1.5px;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--color-bg-primary);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75em;
    color: var(--color-text-primary);
    font-weight: 600;
    white-space: nowrap;
    z-index: 10;
    border: 2px solid #9ca3af;
}

.year-label {
    color: var(--color-text-secondary);
}

.year-separator {
    color: #9ca3af;
    margin: 0 2px;
    font-weight: 400;
}

.months-header-row::-webkit-scrollbar {
    height: 8px;
}

.months-header-row::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 4px;
}

.months-header-row::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.months-header-row::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Colonne pour chaque mois */
.month-column {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* En-tête de chaque mois */
.month-header-item {
    width: 100%;
    padding: 10px 8px;
    background: linear-gradient(135deg, var(--color-bg-primary) 0%, var(--color-bg-tertiary) 100%);
    border: 1px solid var(--color-border-dark);
    border-radius: 4px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    margin-bottom: 8px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.month-title-small {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
    text-align: center;
    word-break: break-word;
}

/* Conteneur pour le contenu de chaque mois */
.month-content-group {
    width: 100%;
    padding: 12px;
    background: #fafbfc;
    border-radius: 4px;
    border: 1px solid var(--color-border);
    overflow: visible;
}

/* Pas de scrollbar - contenu visible */

/* Styles compacts pour les éléments dans les colonnes */
.month-users-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.month-date-group {
    padding: 12px;
    margin-bottom: 12px;
    background: var(--color-bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--color-border);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.month-date-header {
    font-size: 0.8em;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--color-border);
    text-align: center;
}

.month-date-number {
    font-size: 0.9em;
    font-weight: 600;
}

.month-date-full {
    font-size: 0.75em;
    color: var(--color-text-secondary);
    display: block;
    text-align: center;
}

.month-user-item {
    padding: 10px 12px;
    font-size: 0.9em;
    margin-bottom: 6px;
    border-radius: 6px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: center;
}

.month-user-name {
    font-size: 0.85em;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
    text-align: center;
}

/* Styles pour les tâches compactes */
.month-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-item-small {
    padding: 8px;
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 0.8em;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.task-item-header-small {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.task-title-small {
    font-size: 0.85em;
    font-weight: 500;
    margin: 0;
    flex: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.3;
}

.clickable-task {
    cursor: pointer;
    transition: all 0.2s ease;
}

.clickable-task:hover {
    background: #f0f4f8;
    border-color: var(--color-primary);
    transform: translateX(2px);
}

.task-status-small {
    font-size: 0.75em;
    padding: 4px 8px;
    border-radius: 3px;
    display: inline-block;
    flex-shrink: 0;
}

.no-tasks-small {
    font-size: 0.75em;
    color: #9ca3af;
    text-align: center;
    padding: 12px;
}

/* Modal de détails de tâche */
.task-details-content {
    margin: 20px 0;
}

.task-detail-row {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
}

.task-detail-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.task-detail-row strong {
    display: block;
    margin-bottom: 6px;
    color: var(--color-text-secondary);
    font-size: 0.9em;
}

.task-detail-row p {
    margin: 0;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.task-detail-row span {
    color: var(--color-text-secondary);
}

/* Conteneur pour les tâches - mois en ligne horizontale */
.year-list-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 20px 0;
}

.year-month {
    break-inside: avoid;
    page-break-inside: avoid;
}

.month-group {
    break-inside: avoid;
    page-break-inside: avoid;
}

.month-title {
    font-size: 1em;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 12px;
    text-align: center;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-primary);
}

.month-users-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.month-date-group {
    background: linear-gradient(135deg, var(--color-bg-primary) 0%, var(--color-bg-tertiary) 100%);
    border-radius: 6px;
    padding: 12px;
    border: 1px solid var(--color-border-dark);
    border-left: 3px solid #cbd5e0;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.month-date-group:hover {
    border-left-color: var(--color-primary);
    box-shadow: 0 2px 6px rgba(74, 144, 226, 0.1);
}

.month-date-group.today {
    border-color: #3498db;
    box-shadow: 0 1px 4px rgba(52, 152, 219, 0.1);
}

.month-date-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.month-date-header:first-child {
    margin-top: 0;
}

.month-date-number {
    font-size: 1.1em;
    font-weight: 600;
    color: #2c3e50;
    min-width: 30px;
}

.month-date-full {
    font-size: 0.8em;
    color: #7f8c8d;
    background: var(--color-bg-secondary);
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.month-date-users {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.month-user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--color-border-dark);
    background: linear-gradient(135deg, var(--color-bg-primary) 0%, var(--color-bg-tertiary) 100%);
    min-width: 0;
    overflow: visible;
    box-sizing: border-box;
    position: relative;
}

.month-user-item:hover {
    background: linear-gradient(135deg, #f8f9fb 0%, #f0f4f8 100%);
    border-color: var(--color-primary);
    box-shadow: 0 2px 6px rgba(74, 144, 226, 0.12);
    transform: translateX(2px);
}

.month-user-item.user-arrival {
    border-left: 3px solid var(--color-success);
}

.month-user-item.user-arrival.completed {
    border-left: 3px solid var(--color-success-dark);
    background: linear-gradient(135deg, var(--color-success-light) 0%, var(--color-success-lighter) 100%);
}

.month-user-item.user-departure {
    border-left: 3px solid var(--color-danger);
}

.month-user-item.user-departure.completed {
    border-left: 3px solid var(--color-danger-dark);
    background: linear-gradient(135deg, var(--color-danger-light) 0%, var(--color-danger-lighter) 100%);
}

.month-user-name-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    gap: 4px;
    min-width: 0;
    width: 100%;
}

.month-user-name {
    font-weight: 500;
    color: var(--color-text-primary);
    font-size: 0.95em;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    width: 100%;
}

.status-badges-container {
    display: flex;
    gap: 3px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 100%;
    overflow: visible;
    position: relative;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 9px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
}

.status-badge.status-icon {
    border-radius: 4px;
    background-color: transparent;
    width: auto;
    height: auto;
    padding: 2px;
    cursor: pointer;
    position: relative;
}

.status-badge.status-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

/* Tooltip personnalisé */
.status-badge.status-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10000;
    font-weight: normal;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.status-badge.status-icon::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 3px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10001;
}

.status-badge.status-icon:hover::after,
.status-badge.status-icon:hover::before {
    opacity: 1;
}

.status-badge.status-icon:hover::after {
    transform: translateX(-50%) translateY(-4px);
}

.status-badge.status-icon:hover::before {
    transform: translateX(-50%) translateY(-4px);
}

.month-user-info {
    color: var(--color-text-secondary);
    font-size: 0.85em;
    margin-left: 15px;
    font-style: italic;
}

.month-no-users {
    text-align: center;
    color: #bdc3c7;
    padding: 30px;
    font-style: italic;
    font-size: 0.9em;
}

.completed-checkmark {
    color: #27ae60;
    font-weight: bold;
    margin-left: 6px;
    font-size: 1em;
}

.month-user-item.user-departure.completed .completed-checkmark {
    color: #c0392b;
}

.calendar {
    width: 100%;
}

.calendar-grid {
    width: 100%;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 10px;
}

.calendar-weekday {
    text-align: center;
    font-weight: 600;
    color: #666;
    padding: 10px;
    font-size: 0.9em;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-day {
    min-height: 100px;
    max-height: 300px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 8px;
    background: #fafafa;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
}

.calendar-day:hover {
    background: #f0f0f0;
    border-color: #000;
}

.calendar-day.empty {
    background: transparent;
    border: none;
    cursor: default;
}

.calendar-day.today {
    background: #e3f2fd;
    border-color: #2196f3;
    border-width: 2px;
}

.calendar-day.has-users {
    background: var(--color-bg-primary);
    border-color: #4caf50;
}

.calendar-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    gap: 5px;
}

.calendar-day-number {
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
    flex-shrink: 0;
}

.calendar-day-date {
    font-size: 0.7em;
    color: #666;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.calendar-users {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 250px;
    overflow-y: auto;
    overflow-x: hidden;
}

.calendar-user {
    color: white;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 0.75em;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.calendar-user.user-arrival {
    background: #28a745;
}

.calendar-user.user-arrival:hover {
    background: #218838;
    transform: scale(1.05);
}

.calendar-user.user-arrival.completed {
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #155724;
    font-weight: 600;
    position: relative;
}

.calendar-user.user-arrival.completed::after {
    content: '✓';
    position: absolute;
    right: 4px;
    top: 2px;
    font-size: 0.9em;
    color: #fff;
    font-weight: bold;
}

.calendar-user.user-departure {
    background: #dc3545;
}

.calendar-user.user-departure:hover {
    background: #c82333;
    transform: scale(1.05);
}

.calendar-user.user-departure.completed {
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #721c24;
    font-weight: 600;
    position: relative;
}

.calendar-user.user-departure.completed::after {
    content: '✓';
    position: absolute;
    right: 4px;
    top: 2px;
    font-size: 0.9em;
    color: #fff;
    font-weight: bold;
}

.calendar-user-more {
    background: #666;
    color: white;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 0.75em;
    text-align: center;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.calendar-user-more:hover {
    background: #555;
    transform: scale(1.05);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 29, 41, 0.7);
    overflow: auto;
    backdrop-filter: blur(3px);
}

.modal-content {
    background: linear-gradient(135deg, var(--color-bg-primary) 0%, var(--color-bg-tertiary) 100%);
    margin: 2% auto;
    padding: 32px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(74, 144, 226, 0.2);
    position: relative;
    border: 1px solid var(--color-border);
}

.modal-content.modal-large {
    max-width: 1000px;
    width: 95%;
    margin: 2% auto;
}

.modal-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--color-border);
}

.modal-close {
    font-size: 1.8em;
    font-weight: 300;
    color: #6c757d;
    cursor: pointer;
    transition: color 0.15s ease;
    padding: 0;
    background: none;
    border: none;
    line-height: 1;
}

.modal-close:hover {
    color: #212529;
}

.modal-action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-icon-edit,
.btn-icon-delete {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon-edit:hover {
    background: var(--color-primary-lighter);
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-1px);
}

.btn-icon-delete:hover {
    background: var(--color-danger-lighter);
    border-color: var(--color-danger);
    color: var(--color-danger);
    transform: translateY(-1px);
}

.btn-icon-edit svg,
.btn-icon-delete svg {
    width: 18px;
    height: 18px;
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 24px;
    color: var(--color-text-primary);
    font-size: 1.3em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--color-border);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5em;
    color: var(--color-text-primary);
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}

.modal-header .modal-close {
    position: static;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: color 0.2s ease;
    background: none;
    border: none;
    padding: 0;
    width: auto;
    height: auto;
}

.modal-header .modal-close:hover {
    color: var(--color-text-primary);
}

.account-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px 0;
}

.account-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.account-form .form-group label {
    font-size: 0.95em;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 4px;
    text-transform: none;
    letter-spacing: 0;
}

.account-form .form-group input[type="text"],
.account-form .form-group input[type="password"] {
    padding: 14px 16px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-size: 1em;
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
    min-height: 48px;
    max-height: 48px;
}

.account-form .form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(19, 122, 242, 0.1);
    background: var(--color-bg-primary);
}

.account-form .form-group input::placeholder {
    color: var(--color-text-tertiary);
    opacity: 0.7;
}

.account-form .form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 8px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}

.modal-content p {
    margin: 10px 0;
    color: #555;
}

/* Section produits dans le modal */
.modal-products-section {
    margin: 24px 0;
    padding: 20px 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.modal-section-title {
    font-size: 0.875em;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.products-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Conteneur compact pour les produits */
.products-container-compact {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.product-group-compact {
    background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg-primary) 100%);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-primary);
    border-radius: 6px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.product-header-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #dee2e6;
}

.product-header-compact h4 {
    margin: 0;
    font-size: 0.9em;
    font-weight: 600;
    color: var(--color-text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-edit-btn-compact {
    padding: 4px 8px;
    border: 1px solid var(--color-border-dark);
    border-radius: 4px;
    background: var(--color-bg-primary);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.product-edit-btn-compact:hover {
    background: var(--color-bg-secondary);
    border-color: var(--color-primary);
    color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

.product-edit-btn-compact svg {
    width: 14px;
    height: 14px;
}

.product-details-compact {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85em;
}

.product-details-compact .product-detail-row {
    font-size: 0.85em;
    line-height: 1.4;
}

.product-details-compact .product-detail-row strong {
    font-size: 0.9em;
    margin-right: 6px;
}

.product-group {
    background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg-primary) 100%);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-primary);
    border-radius: 4px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #dee2e6;
}

.product-header h4 {
    margin: 0;
    font-size: 1em;
    font-weight: 600;
    color: var(--color-text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-edit-btn {
    padding: 6px 12px;
    border: 1px solid var(--color-border-dark);
    border-radius: 4px;
    background: var(--color-bg-primary);
    color: var(--color-text-secondary);
    font-size: 0.8em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.product-edit-btn:hover {
    background: var(--color-bg-secondary);
    border-color: var(--color-border-dark);
    color: var(--color-text-primary);
    box-shadow: var(--shadow-md);
}

.product-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-detail-row {
    font-size: 0.9em;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.product-detail-row strong {
    color: var(--color-text-primary);
    font-weight: 600;
    margin-right: 8px;
}

.product-detail-empty {
    font-size: 0.85em;
    color: #6c757d;
    font-style: italic;
    padding: 8px 0;
}

.modal-statuses {
    margin-top: 20px;
}

.modal-status-title {
    font-size: 1em;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-selectors-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.modal-status-group-compact {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-status-group-compact label {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-select-compact {
    padding: 8px 12px;
    border: 1px solid var(--color-border-dark);
    border-radius: 6px;
    font-size: 0.9em;
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 38px;
}

.status-select-compact:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15);
}

.modal-info-row {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.95em;
}

/* Grille compacte pour les informations utilisateur */
.modal-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.modal-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    background: var(--color-bg-secondary);
    border-radius: 6px;
    font-size: 0.9em;
}

.modal-info-label {
    font-weight: 600;
    color: var(--color-text-secondary);
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-info-value {
    color: var(--color-text-primary);
    font-size: 0.95em;
}

.modal-info-row:last-child {
    border-bottom: none;
}

.modal-info-row {
    color: #cbd5e0;
}

.modal-info-row {
    color: var(--color-text-secondary);
}

.modal-info-row strong {
    color: var(--color-text-primary);
    font-weight: 600;
    display: inline-block;
    min-width: 140px;
}

.modal-status-group {
    margin-bottom: 20px;
    padding: 16px;
    background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg-primary) 100%);
    border-radius: 6px;
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.modal-status-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--color-text-secondary);
    font-size: 0.9em;
}

.status-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border-dark);
    border-radius: 4px;
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.15s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231a1d29' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 12px;
    padding-right: 36px;
}

.status-select:hover {
    border-color: var(--color-border-dark);
}

.status-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.modal-status-group h4 {
    margin: 0 0 16px 0;
    color: var(--color-text-primary);
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-option {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.status-option:hover {
    background: var(--color-bg-secondary);
    border-color: #bdc3c7;
}

.status-option input[type="radio"] {
    margin-right: 10px;
    cursor: pointer;
}

.status-option span {
    color: #34495e;
    font-size: 0.9em;
    font-weight: 500;
}

/* Modal liste utilisateurs d'une date */
.date-users-list {
    max-height: 60vh;
    overflow-y: auto;
    margin-top: 20px;
}

.date-users-group {
    margin-bottom: 25px;
}

.date-users-group-title {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.2em;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-border);
}

.date-user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
}

.date-user-item:hover {
    background: var(--color-border);
    transform: translateX(5px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.date-user-item.user-arrival {
    border-left: 4px solid #28a745;
}

.date-user-item.user-arrival.completed {
    border-left: 6px solid #155724;
    background: #d4edda;
}

.date-user-item.user-departure {
    border-left: 4px solid #dc3545;
}

.date-user-item.user-departure.completed {
    border-left: 6px solid #721c24;
    background: #f8d7da;
}

.completed-checkmark {
    color: #28a745;
    font-weight: bold;
    margin-left: 5px;
    font-size: 1.1em;
}

.date-user-item.user-departure.completed .completed-checkmark {
    color: #dc3545;
}

.date-user-name {
    font-weight: 600;
    color: #333;
    flex: 1;
}

.date-user-info {
    color: #666;
    font-size: 0.85em;
    margin-left: 15px;
    font-style: italic;
}

/* Contrôles du tableau */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.search-box {
    flex: 1;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #151515;
}

.table-info {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

/* Wrapper du tableau */
.table-wrapper {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Tableau */
.users-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-bg-primary);
    font-size: 14px;
}

.users-table thead {
    background: var(--color-bg-secondary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.users-table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
    white-space: nowrap;
}

.users-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    color: #555;
}

.users-table tbody tr {
    transition: background-color 0.2s ease;
}

.users-table tbody tr:hover {
    background-color: #f8f9fa;
}

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

/* Badge de statut (ancien - pour compatibilité) */
.status-badge.active {
    background-color: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background-color: #f8d7da;
    color: #721c24;
}

/* Messages d'état */
.loading,
.error,
.no-data {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

.error {
    color: #dc3545;
}

.no-data {
    color: #999;
}

/* Statut dans le tableau */
.status-cell {
    position: relative;
    padding: 8px !important;
    min-width: 150px;
}

.users-table .sub-header {
    background: var(--color-border);
}

.users-table .sub-header th {
    padding: 10px 8px;
    font-size: 0.85em;
    font-weight: 600;
    text-align: center;
    border-bottom: 2px solid #dee2e6;
}

.status-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    min-width: 40px;
    text-align: center;
}

.status-badge.status-none {
    background: var(--color-border);
    color: #6c757d;
}

/* Statuts Arrivée */
.status-badge.status-not_ready {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.status-ready_not_delivered {
    background: #fff3cd;
    color: #856404;
}

.status-badge.status-ready_delivered {
    background: #d4edda;
    color: #155724;
}

.status-badge.status-not_applicable {
    background: var(--color-border);
    color: #6c757d;
}

/* Statuts Formation */
.status-badge.status-trained {
    background: #d4edda;
    color: #155724;
}

.status-badge.status-not_trained {
    background: #f8d7da;
    color: #721c24;
}

/* Statuts Sortie */
.status-badge.status-not_recovered {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.status-reinstalled_on_site {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.status-sold {
    background: #fff3cd;
    color: #856404;
}

.status-badge.status-recovered_reinstalled {
    background: #d4edda;
    color: #155724;
}

/* Statuts Accès */
.status-badge.status-deleted {
    background: #d4edda;
    color: #155724;
}

.status-badge.status-not_deleted {
    background: #f8d7da;
    color: #721c24;
}

.status-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    font-size: 1.2em;
    transition: transform 0.2s ease;
    opacity: 0.6;
}

.status-toggle-btn:hover {
    transform: rotate(90deg);
    opacity: 1;
}

.status-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border-dark);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 10px;
    min-width: 180px;
    z-index: 100;
    display: none;
    margin-top: 5px;
}

.status-dropdown.show {
    display: block;
}

.status-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-option {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.status-option:hover {
    background: var(--color-bg-secondary);
    border-color: #bdc3c7;
}

.status-option input[type="radio"] {
    margin-right: 10px;
    cursor: pointer;
}

.status-option span {
    color: #34495e;
    font-size: 0.9em;
    font-weight: 500;
}

/* Afficher le dropdown au survol aussi */
.status-cell:hover .status-dropdown {
    display: block;
}

.status-cell:hover .status-toggle-btn {
    opacity: 1;
}

/* S'assurer que le dropdown reste visible quand on survole dedans */
.status-dropdown:hover {
    display: block !important;
}

/* Styles pour la page des tâches */
.tasks-section {
    background: linear-gradient(135deg, var(--color-bg-primary) 0%, var(--color-bg-tertiary) 100%);
    border-radius: 8px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border-dark);
}

.tasks-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
}

.tasks-header h2 {
    font-size: 1.5em;
    color: var(--color-text-primary);
    margin: 0;
    background: linear-gradient(135deg, var(--color-text-primary) 0%, var(--color-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.months-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
}

.calendar {
    display: flex;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    padding: 10px 0;
}

.calendar::-webkit-scrollbar {
    height: 8px;
}

.calendar::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 4px;
}

.calendar::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.calendar::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.calendar-wrapper {
    width: 100%;
    overflow-x: auto;
}

.tasks-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.month-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.task-item {
    background: linear-gradient(135deg, var(--color-bg-primary) 0%, var(--color-bg-tertiary) 100%);
    border: 1px solid var(--color-border-dark);
    border-radius: 6px;
    padding: 16px;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.task-item:hover {
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.15);
    border-left-color: #151515;
    transform: translateX(2px);
}

.task-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f3f5;
    gap: 16px;
}

.task-title {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
    flex: 1;
}

.task-item-actions {
    display: flex;
    gap: 8px;
}


.task-item-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-description {
    color: #6c757d;
    font-size: 0.9em;
    line-height: 1.5;
    margin: 0;
}

.task-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
    width: fit-content;
}

.task-status.clickable-status {
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.task-status.clickable-status:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-sm);
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-in-progress {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.status-in-progress.clickable-status:hover {
    background: linear-gradient(135deg, #bfdbfe 0%, #93c5fd 100%);
    border-color: #60a5fa;
}

.status-completed {
    background: linear-gradient(135deg, var(--color-success-light) 0%, var(--color-success) 100%);
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.status-completed.clickable-status:hover {
    background: linear-gradient(135deg, #a7f3d0 0%, #6ee7b7 100%);
    border-color: #34d399;
}

.no-tasks {
    padding: 24px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

/* Responsive */
@media (max-width: 1200px) {
    .stats-sections-row {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .stats-container {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 30px;
    }
}

/* Responsive pour le dashboard */
@media (max-width: 1200px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 30px 20px;
        max-width: 100%;
    }
    
    .dashboard-header h1 {
        font-size: 1.8em;
    }
    
    .dashboard-stats {
        gap: 20px;
    }
    
    .card-header {
        padding: 20px;
    }
    
    .card-header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .card-content {
        padding: 20px;
    }
    
    .stat-item {
        padding: 10px 12px;
    }
    
    .stat-category {
        margin-bottom: 24px;
    }
    
    .action-link {
        width: 100%;
        justify-content: center;
    }
    
    h1 {
        font-size: 2.5em;
    }
    
    .subtitle {
        font-size: 1.1em;
        margin-bottom: 40px;
    }
    
    .stats-section {
        margin: 40px 0;
    }
    
    .stats-section h2 {
        font-size: 2em;
        margin-bottom: 30px;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
        gap: 25px;
        margin: 30px 0;
    }
    
    .stat-group {
        padding: 25px;
    }
    
    .stat-group h3 {
        font-size: 1.3em;
        margin-bottom: 20px;
    }
    
    .stat-card {
        padding: 20px;
        margin-bottom: 15px;
    }
    
    .stat-number {
        font-size: 2.5em;
    }
    
    .stat-label {
        font-size: 1em;
    }
    
    .table-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .users-table {
        font-size: 12px;
    }
    
    .users-table th,
    .users-table td {
        padding: 8px;
    }
}

/* Page Statistiques */
.stats-page-section {
    margin-bottom: 50px;
}

.stats-total-section {
    margin-bottom: 32px;
}

.stats-total-card {
    background: linear-gradient(135deg, var(--color-bg-primary) 0%, var(--color-bg-tertiary) 100%);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 24px;
}

.stats-total-card h2 {
    font-size: 1.8em;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0 0 20px 0;
    background: linear-gradient(135deg, #151515 0%, var(--color-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stats-total-content {
    display: flex;
    gap: 40px;
    align-items: center;
    justify-content: center;
}

.stats-legend-section {
    margin-bottom: 24px;
    padding: 16px;
    background: var(--color-bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--color-border);
}

.stats-legend {
    display: flex;
    gap: 24px;
    align-items: center;
    justify-content: center;
}

.legend-item {
    display: flex;
    gap: 8px;
    align-items: center;
}

.legend-label {
    font-weight: 600;
    color: var(--color-text-primary);
}

.legend-value {
    color: var(--color-text-secondary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 24px;
    width: 100%;
    max-width: 100%;
}

.stats-zone-card {
    background: linear-gradient(135deg, var(--color-bg-primary) 0%, var(--color-bg-tertiary) 100%);
    border-radius: 12px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: all 0.3s ease;
}

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

.stats-zone-header {
    background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg-tertiary) 100%);
    padding: 20px 24px;
    border-bottom: 2px solid var(--color-primary);
}

.stats-zone-header h2 {
    font-size: 1.5em;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
}

.stats-zone-content {
    padding: 24px;
    display: flex;
    gap: 40px;
    align-items: center;
    justify-content: center;
}

.stats-device {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.stats-device svg {
    color: var(--color-primary);
}

.stats-icon-emoji {
    font-size: 32px;
    line-height: 1;
    display: inline-block;
}

.stats-icon-image {
    width: 48px;
    height: 48px;
    object-fit: contain;
    display: block;
}

.stats-ratio {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.stats-recover {
    color: #dc3545; /* Rouge pour "À récupérer" */
    font-weight: 600;
    position: relative;
}

.stats-deliver {
    color: #28a745; /* Vert pour "Livré" */
    font-weight: 600;
    position: relative;
}

.stats-recover.clickable,
.stats-deliver.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 2px 4px;
    border-radius: 4px;
}

.stats-recover.clickable:hover {
    background-color: rgba(220, 53, 69, 0.1);
    transform: scale(1.1);
}

.stats-deliver.clickable:hover {
    background-color: rgba(40, 167, 69, 0.1);
    transform: scale(1.1);
}

/* Tooltip personnalisé pour les stats */
.stats-recover::after,
.stats-deliver::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background-color: #333;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s ease, transform 0.1s ease;
    z-index: 1000;
    font-weight: normal;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.stats-recover::before,
.stats-deliver::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-2px);
    border: 5px solid transparent;
    border-top-color: #333;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s ease, transform 0.1s ease;
    z-index: 1001;
}

.stats-recover:hover::after,
.stats-deliver:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-12px);
}

.stats-recover:hover::before,
.stats-deliver:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(-2px);
}

.stats-separator {
    color: var(--color-text-secondary);
    opacity: 0.6;
}

.stats-category {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stats-category h3 {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
}

.stats-subcategory {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stats-subcategory h4 {
    font-size: 1em;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin: 0;
}

.stats-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-separator {
    height: 1px;
    background: var(--color-border);
    margin: 8px 0;
    width: 100%;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--color-bg-secondary);
    border-radius: 6px;
    border-left: 3px solid var(--color-border);
    transition: all 0.2s ease;
}

.stat-item:hover {
    background: var(--color-bg-tertiary);
    border-left-color: var(--color-primary);
}

.stat-item.stat-total {
    background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg-tertiary) 100%);
    border-left: 3px solid var(--color-primary);
    font-weight: 600;
    margin-top: 4px;
}

.stat-label {
    font-size: 0.9em;
    color: var(--color-text-primary);
}

.stat-value {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--color-text-primary);
}

.stat-value.stat-red {
    color: var(--color-danger);
}

.stat-value.stat-orange {
    color: var(--color-warning, #f59e0b);
}

.stat-value.stat-green {
    color: var(--color-success);
}

.no-stats {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-secondary);
    font-size: 1.1em;
    font-style: italic;
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-total-content {
        flex-direction: column;
        gap: 24px;
    }
    
    .stats-zone-content {
        flex-direction: column;
        gap: 24px;
    }
    
    .stats-legend {
        flex-direction: column;
        gap: 12px;
    }
}

/* Modal de liste d'utilisateurs */
.users-list-modal-content {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 8px;
}

.users-list-modal-content .users-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-list-item {
    background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg-tertiary) 100%);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-primary);
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.user-list-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-left-color: var(--color-primary);
    background: linear-gradient(135deg, var(--color-bg-tertiary) 0%, var(--color-bg-secondary) 100%);
}

.user-list-item-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-list-item-name {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--color-text-primary);
}

.user-list-item-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.user-detail-badge {
    font-size: 0.85em;
    padding: 4px 10px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    color: var(--color-text-secondary);
}

/* Liste des concessions */
.concessions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.concession-item {
    background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg-tertiary) 100%);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-primary);
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.concession-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-left-color: var(--color-primary);
    background: linear-gradient(135deg, var(--color-bg-tertiary) 0%, var(--color-bg-secondary) 100%);
}

.concession-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.concession-header h4 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--color-text-primary);
}

.concession-count {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--color-primary);
    padding: 4px 12px;
    background: rgba(19, 122, 242, 0.1);
    border-radius: 12px;
}

/* Page Gestion des utilisateurs */
.users-filters-section {
    margin-top: 24px;
    margin-bottom: 24px;
    padding: 20px;
    background: var(--color-bg-primary);
    border-radius: 8px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.search-bar-container {
    margin-bottom: 20px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: var(--color-text-secondary);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.95em;
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-lighter);
}

.filters-container {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
}

.filter-group label {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-select {
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.95em;
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-lighter);
}

.clear-filters-btn {
    padding: 10px 20px;
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.clear-filters-btn:hover {
    background: var(--color-bg-tertiary);
    border-color: var(--color-text-secondary);
    transform: translateY(-1px);
}

.users-management-section {
    margin-top: 24px;
}

.users-table-container {
    background: var(--color-bg-primary);
    border-radius: 8px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

.users-table thead {
    background: var(--color-bg-secondary);
    border-bottom: 2px solid var(--color-primary);
}

.users-table th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--color-text-primary);
    white-space: nowrap;
}

.users-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-primary);
}

.users-table td.empty-message,
.users-table td.error-message {
    text-align: center !important;
    padding: 60px 20px !important;
    border: none !important;
}

.users-table tbody tr:hover {
    background: var(--color-bg-secondary);
}

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

.actions-cell {
    white-space: nowrap;
}

.actions-cell button {
    padding: 6px 10px;
    margin: 0 4px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.actions-cell .btn-edit {
    background: var(--color-primary-lighter);
    color: var(--color-primary);
}

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

.actions-cell .btn-delete {
    background: var(--color-danger-lighter);
    color: var(--color-danger);
}

.actions-cell .btn-delete:hover {
    background: var(--color-danger-light);
    transform: translateY(-1px);
}

/* Cellules de date éditables */
.editable-date-cell {
    position: relative;
    cursor: pointer;
    padding: 14px 12px !important;
}

.editable-date-cell:hover .date-display {
    background: var(--color-primary-lighter);
    border-radius: 4px;
    padding: 4px 8px;
    transition: all 0.2s ease;
}

.date-display {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    user-select: none;
}

.date-input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid var(--color-primary);
    border-radius: 6px;
    font-size: 0.95em;
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    font-family: inherit;
    box-sizing: border-box;
}

.date-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-lighter);
}

.users-table td.error-message,
.users-table td.empty-message {
    text-align: center !important;
    padding: 60px 20px !important;
    color: var(--color-text-secondary) !important;
    font-style: italic;
    font-size: 1.1em !important;
    background: var(--color-bg-secondary) !important;
    border-radius: 8px;
    margin: 0 !important;
    min-height: 100px;
    border: none !important;
    width: 100% !important;
    vertical-align: middle !important;
    line-height: 1.8 !important;
    display: table-cell !important;
}

.users-table .empty-message {
    color: var(--color-text-tertiary);
}

.users-table .empty-message::before {
    font-size: 1.5em;
    opacity: 0.6;
    display: inline-block;
    margin-right: 8px;
}

.users-table .error-message {
    color: var(--color-danger);
}

.users-table .error-message::before {
    font-size: 1.5em;
    opacity: 0.6;
    display: inline-block;
    margin-right: 8px;
}

/* Styles généraux pour compatibilité */
.error-message,
.empty-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-secondary);
    font-style: italic;
    font-size: 1.1em;
    background: var(--color-bg-secondary);
    border-radius: 8px;
    margin: 20px 0;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.empty-message {
    color: var(--color-text-tertiary);
}

.empty-message::before {
    font-size: 1.5em;
    opacity: 0.6;
    display: inline-block;
    margin-right: 8px;
}

.error-message {
    color: var(--color-danger);
}

.error-message::before {
    font-size: 1.5em;
    opacity: 0.6;
    display: inline-block;
    margin-right: 8px;
}

@media (max-width: 1024px) {
    .users-table-container {
        overflow-x: auto;
    }
    
    .users-table {
        min-width: 800px;
    }
}


.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    width: 44px;
    height: 44px;
    background: var(--color-primary);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
}

/* Overlay pour fermer la sidebar sur 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;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
}

/* Tablette (max-width: 1024px) */
@media (max-width: 1024px) {
    .main-content {
        margin-left: 0 !important;
        padding: 20px;
        width: 100%;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        position: fixed;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .sidebar-overlay {
        display: block;
    }
    
    .sidebar-toggle {
        display: none;
    }
    
    html.sidebar-collapsed .main-content {
        margin-left: 0 !important;
    }
    
    .modal-content {
        width: 95%;
        max-width: 95%;
        padding: 24px;
        margin: 10% auto;
    }
    
    .modal-content.modal-large {
        max-width: 95%;
    }
    
    .modal-info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .products-container-compact {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .status-selectors-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
    .add-user-form {
        grid-template-columns: 1fr;
    }
    
    .status-selectors-group {
        grid-template-columns: 1fr;
    }
    
    body {
        font-size: 14px;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 15px;
    }
    
    .container {
        padding: 0;
    }
    
    .sidebar {
        width: 280px;
        transform: translateX(-100%);
        z-index: 1000;
        position: fixed;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .sidebar-overlay {
        display: block;
    }
    
    .sidebar-toggle {
        display: none;
    }
    
    html.sidebar-collapsed .main-content {
        margin-left: 0 !important;
    }
    
    .sidebar.collapsed ~ .main-content {
        margin-left: 0 !important;
    }
    
    /* Headers */
    .dashboard-header,
    .page-header {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .dashboard-header h1,
    .page-header h1 {
        font-size: 1.5em;
    }
    
    .page-header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    /* Grilles - 1 colonne sur mobile */
    .modal-info-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .products-container-compact {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .status-selectors-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stats-sections-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Cartes */
    .dashboard-card {
        padding: 20px;
    }
    
    .card-header {
        padding: 16px;
    }
    
    .card-content {
        padding: 16px;
    }
    
    /* Modals */
    .modal-content {
        width: 95%;
        max-width: 95%;
        padding: 20px;
        margin: 5% auto;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-content.modal-large {
        max-width: 95%;
    }
    
    .modal-header {
        padding-bottom: 12px;
        margin-bottom: 16px;
    }
    
    .modal-header h3 {
        font-size: 1.2em;
    }
    
    .modal-info-item {
        padding: 10px;
    }
    
    .product-group-compact {
        padding: 12px;
    }
    
    .product-header-compact h4 {
        font-size: 0.85em;
    }
    
    /* Tableaux */
    .users-table-container {
        border-radius: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .users-table {
        min-width: 600px;
        font-size: 0.85em;
    }
    
    .users-table th,
    .users-table td {
        padding: 10px 8px;
    }
    
    /* Filtres */
    .users-filters-section {
        padding: 16px;
    }
    
    .filters-container {
        flex-direction: column;
        gap: 12px;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .search-input-wrapper {
        width: 100%;
    }
    
    /* Boutons */
    .add-user-btn {
        width: 100%;
        justify-content: center;
    }
    
    .btn-cancel,
    .btn-submit {
        min-width: 100px;
        padding: 10px 20px;
        font-size: 0.85em;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn-cancel,
    .form-actions .btn-submit {
        width: 100%;
    }
    
    /* Calendrier */
    .calendar-section {
        padding: 20px;
        margin-bottom: 30px;
        overflow-x: auto;
    }
    
    .calendar-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .calendar-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .month-year-selector {
        flex-direction: column;
        width: 100%;
    }
    
    .month-year-selector select {
        width: 100%;
    }
    
    .months-navigation {
        flex-direction: row;
        gap: 10px;
        overflow-x: visible;
        padding-bottom: 10px;
        position: relative;
    }
    
    .calendar {
        width: 100%;
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        gap: 15px;
        padding: 10px 50px;
        scroll-padding: 0 50px;
    }
    
    .month-column {
        min-width: 85vw;
        max-width: 85vw;
        scroll-snap-align: center;
        flex-shrink: 0;
        overflow: hidden;
    }
    
    .month-content-group {
        padding: 12px;
        min-height: auto;
        width: 100%;
        box-sizing: border-box;
        min-width: 0;
        overflow: hidden;
    }
    
    .month-title {
        font-size: 1.1em;
        margin-bottom: 12px;
        padding: 8px;
    }
    
    .month-date-header {
        font-size: 0.85em;
        padding: 6px 8px;
        margin-bottom: 8px;
    }
    
    .month-date-group {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .month-user-item {
        padding: 8px 10px;
        font-size: 0.9em;
        margin-bottom: 6px;
        min-width: 0;
        overflow: hidden;
    }
    
    .month-user-name {
        font-size: 0.9em;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100%;
    }
    
    .month-user-name-wrapper {
        min-width: 0;
        overflow: hidden;
        width: 100%;
    }
    
    .status-badges-container {
        gap: 2px;
        flex-wrap: wrap;
        max-width: 100%;
        overflow: visible;
        position: relative;
    }
    
    .month-user-name-wrapper {
        overflow: visible;
    }
    
    .status-badge {
        width: 14px;
        height: 14px;
        font-size: 8px;
        flex-shrink: 0;
    }
    
    .status-badge.status-icon {
        padding: 1px;
    }
    
    .status-badge.status-icon svg {
        width: 14px;
        height: 14px;
    }
    
    .status-badge.status-icon::after {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .calendar-nav-btn {
        flex-shrink: 0;
        position: sticky;
        z-index: 10;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border: 1px solid var(--color-border);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .calendar-nav-btn:first-child {
        left: 0;
    }
    
    .calendar-nav-btn:last-child {
        right: 0;
    }
    
    .months-grid-container {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        gap: 15px;
        padding: 0;
    }
    
    /* Stats */
    .stats-total-card {
        padding: 20px;
    }
    
    .stats-total-card h2 {
        font-size: 1.5em;
    }
    
    .stats-total-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .stats-legend {
        flex-direction: column;
        gap: 12px;
    }
    
    /* Sidebar footer */
    .sidebar-footer {
        padding: 15px;
    }
    
    .user-name {
        font-size: 0.85em;
        padding: 6px 10px;
    }
    
    .logout-btn {
        padding: 10px;
        font-size: 0.85em;
    }
    
    /* Navigation */
    .sidebar-nav ul li a {
        padding: 12px 15px;
        font-size: 0.9em;
    }
    
    .nav-icon {
        width: 20px;
        height: 20px;
    }
}

/* Très petit mobile (max-width: 480px) */
@media (max-width: 480px) {
    .main-content {
        padding: 10px;
        margin-left: 0 !important;
    }
    
    .dashboard-header,
    .page-header {
        padding: 15px;
    }
    
    .dashboard-header h1,
    .page-header h1 {
        font-size: 1.3em;
    }
    
    .modal-content {
        padding: 15px;
    }
    
    .dashboard-card,
    .stats-total-card,
    .stats-zone-card {
        padding: 15px;
    }
    
    .card-header {
        padding: 12px;
    }
    
    .card-content {
        padding: 12px;
    }
    
    .users-table {
        min-width: 500px;
        font-size: 0.8em;
    }
    
    .users-table th,
    .users-table td {
        padding: 8px 6px;
    }
    
    .product-group-compact {
        padding: 10px;
    }
    
    .modal-info-item {
        padding: 8px;
        font-size: 0.85em;
    }
    
    .status-select-compact {
        font-size: 0.85em;
        padding: 6px 10px;
        min-height: 36px;
    }
}

/* Orientation paysage sur mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-content {
        max-height: 85vh;
    }
    
    .stats-total-content {
        flex-direction: row;
        gap: 30px;
    }
}
