/* Global Styles - Modern Design */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #1f2937;
    --accent-color: #06b6d4;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --light-color: #ffffff;
    --bg-light: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border-color: #e5e7eb;
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --box-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --box-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
}

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

/* Prévention du défilement horizontal */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
    width: 100%;
}

/* Conteneurs principaux */
.home-section,
.card,
.container,
.dashboard-grid,
.stats-grid,
.quick-actions {
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Tables responsives */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    max-width: 100%;
    width: auto;
    table-layout: auto;
}

/* Formulaires responsifs */
.form-group,
.admin-form {
    max-width: 100%;
    overflow: hidden;
}

.form-control,
input,
select,
textarea {
    max-width: 100%;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    color: var(--text-primary);
    background: var(--bg-light);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Modern Components */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

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

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

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

.card-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: var(--spacing-xs);
}

/* Harmonisation boutons navigation semaine et pause personnalisée */
.calendar-nav .btn,
#add-custom-pause {
    font-weight: 500; /* Poids de police normal */
    padding: 0.5rem 1rem; /* Consistance du padding */
    border-radius: var(--border-radius); /* Utilisation de la variable globale */
    font-size: 0.875rem; /* Taille de police standard des boutons */
    line-height: 1.5;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
}

.calendar-nav .btn:hover,
#add-custom-pause:hover {
    background: var(--bg-light);
    border-color: var(--text-muted);
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    border-radius: var(--border-radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    gap: 0.5rem;
}

.btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

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

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

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-light);
    border-color: var(--text-muted);
}

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

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* Modern Forms */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: white;
    transition: var(--transition);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-control:disabled {
    background: var(--bg-light);
    color: var(--text-muted);
}

/* Modern Tables - Responsive with Auto-adjusting Team Columns */
.table-container {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    overflow-x: auto;
    overflow-y: visible;
    margin-bottom: var(--spacing-xl);
    width: 100%;
    position: relative;
    /* Enhanced horizontal scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-light);
}

/* Enhanced webkit scrollbar styling for horizontal scroll */
.table-container::-webkit-scrollbar {
    height: 14px;
}

.table-container::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 7px;
    margin: 0 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, var(--border-color), var(--text-muted));
    border-radius: 7px;
    border: 2px solid var(--bg-light);
    box-shadow: inset 0 0 2px rgba(0,0,0,0.1);
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, var(--text-muted), var(--text-secondary));
}

.table-container::-webkit-scrollbar-corner {
    background: var(--bg-light);
}

.table {
    width: 100%;
    min-width: max-content; /* Dynamic minimum width based on content */
    border-collapse: collapse;
    table-layout: auto; /* Auto layout for content-based column sizing */
}

/* All columns auto-adjust to content */
.table th, .table td {
    width: auto;
    min-width: max-content;
    white-space: nowrap;
    padding: 1rem 0.75rem;
}

/* Specific minimum widths only where needed */
.table th:nth-child(1), .table td:nth-child(1) {
    min-width: 80px;
} /* Statut */

.table th:nth-child(2), .table td:nth-child(2) {
    min-width: 60px;
} /* SSO */

.table th:nth-child(3), .table td:nth-child(3) {
    min-width: 180px;
} /* Utilisateur */

.table th:nth-child(4), .table td:nth-child(4) {
    min-width: 180px;
} /* Contact */

.table th:nth-child(5), .table td:nth-child(5) {
    min-width: 90px;
} /* Arrivée */

.table th:nth-child(6), .table td:nth-child(6) {
    min-width: 90px;
} /* Départ */

.table th:nth-child(7), .table td:nth-child(7) {
    min-width: 120px;
} /* Équipe */

.table th:nth-child(8), .table td:nth-child(8) {
    min-width: 70px;
} /* Licence */

.table th:nth-child(9), .table td:nth-child(9) {
    min-width: 120px;
} /* PC Assigné */

.table th:nth-child(10), .table td:nth-child(10) {
    min-width: 140px;
} /* Téléphone */

.table th {
    background: var(--bg-light);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
    vertical-align: top;
    /* Allow text wrapping within fixed width columns */
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.table tbody tr {
    /* Remove white-space: nowrap to allow content wrapping within columns */
}

.table tbody tr:hover {
    background: var(--bg-light);
}

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

/* Enhanced team badges display for auto-adjusting columns */
.table td .d-flex.flex-wrap {
    width: 100%;
    overflow: visible;
    gap: 4px;
    flex-wrap: nowrap; /* Force single line display */
    white-space: nowrap;
    justify-content: flex-start;
    align-items: center;
    display: inline-flex;
}

.table td .badge {
    margin: 0;
    white-space: nowrap;
    font-size: 0.7rem;
    padding: 0.3rem 0.7rem;
    flex-shrink: 0; /* Prevent badges from shrinking */
    border-radius: 16px; /* More rounded for team badges */
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}

/* Ensure the team column expands to fit all badges */
.table th:nth-child(7), .table td:nth-child(7) {
    overflow: visible;
    white-space: nowrap;
}

/* Override white-space for content that should wrap */
.table td .text-muted {
    white-space: normal;
}

/* User info column styling */
.table td .d-flex.align-items-center {
    gap: 0.5rem;
}

.table td .fw-medium {
    font-weight: 600;
    line-height: 1.2;
}

.table td .text-muted.small {
    font-size: 0.75rem;
    line-height: 1.2;
}

/* Responsive behavior for smaller screens */
@media (max-width: 768px) {
    .table {
        min-width: max-content; /* Maintain auto-sizing */
    }
    
    .table th, .table td {
        padding: 0.75rem;
        font-size: 0.8rem;
    }
    
    .users-page .home-section {
        padding-left: var(--spacing-lg);
        padding-right: var(--spacing-lg);
    }
}

@media (max-width: 480px) {
    .table {
        min-width: max-content; /* Maintain auto-sizing for mobile */
    }
    
    .table th, .table td {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    .table td .badge {
        font-size: 0.65rem;
        padding: 0.15rem 0.3rem;
    }
    
    .users-page .home-section {
        padding-left: var(--spacing-md);
        padding-right: var(--spacing-md);
    }
    
    /* Reduce column minimum widths for mobile while maintaining auto-adjustment */
    .table th:nth-child(1), .table td:nth-child(1) { min-width: 70px; } /* Statut */
    .table th:nth-child(2), .table td:nth-child(2) { min-width: 50px; } /* SSO */
    .table th:nth-child(3), .table td:nth-child(3) { min-width: 150px; } /* Utilisateur */
    .table th:nth-child(4), .table td:nth-child(4) { min-width: 150px; } /* Contact */
    .table th:nth-child(5), .table td:nth-child(5) { min-width: 80px; } /* Arrivée */
    .table th:nth-child(6), .table td:nth-child(6) { min-width: 80px; } /* Départ */
    .table th:nth-child(7), .table td:nth-child(7) { min-width: 100px; } /* Équipe */
    .table th:nth-child(8), .table td:nth-child(8) { min-width: 60px; } /* Licence */
    .table th:nth-child(9), .table td:nth-child(9) { min-width: 100px; } /* PC Assigné */
    .table th:nth-child(10), .table td:nth-child(10) { min-width: 120px; } /* Téléphone */
}

/* Additional table enhancements */
.table-container {
    /* Smooth scrolling behavior */
    scroll-behavior: smooth;
}

/* Ensure table maintains proper layout */
.table tbody tr {
    min-height: 60px;
}

/* Sticky header enhancement for better UX */
.table thead {
    position: sticky;
    top: 0;
    z-index: 100;
}

.table th {
    box-shadow: inset 0 -1px 0 var(--border-color);
}

/* Status Badges - More Rounded */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 20px; /* More rounded */
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.badge-primary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary-color); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.text-danger { color: var(--danger-color); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mt-5 { margin-top: var(--spacing-xl); }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.gap-2 { gap: var(--spacing-sm); }
.gap-3 { gap: var(--spacing-md); }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* Responsive Grid */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.75rem;
}

.col {
    flex: 1;
    padding: 0 0.75rem;
}

.col-12 { flex: 0 0 100%; }
.col-6 { flex: 0 0 50%; }
.col-4 { flex: 0 0 33.333333%; }
.col-3 { flex: 0 0 25%; }

@media (max-width: 768px) {
    .col-sm-12 { flex: 0 0 100%; }
    .col-sm-6 { flex: 0 0 50%; }
}

/* Loading States */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modern Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-lg);
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
}

.alert-info {
    background: rgba(6, 182, 212, 0.1);
    border-color: rgba(6, 182, 212, 0.2);
    color: var(--accent-color);
}

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

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

ul {
    list-style: none;
}

.hidden {
    display: none !important;
}

/* Home Section Styles */
.home-section {
    margin-left: 240px;
    width: calc(100% - 240px);
    padding: var(--spacing-xl);
    min-height: 100vh;
    transition: var(--transition);
    overflow-x: hidden; /* Prevent page-level horizontal scroll */
}

.sidebar.open ~ .home-section {
    margin-left: 78px;
    width: calc(100% - 78px);
}

/* Ensure cards accommodate full-width tables */
.home-section .card {
    width: 100%;
    box-sizing: border-box;
}

/* Special handling for users page with responsive table */
.users-page .card {
    overflow: visible; /* Allow table to manage its own overflow */
    max-width: none; /* Remove width constraints */
    width: 100%;
}

.users-page .table-container {
    /* Equal spacing margins for visual balance */
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    border-radius: var(--border-radius-lg);
    /* Ensure proper spacing between sidebar and table */
    position: relative;
}

/* Ensure balanced spacing with sidebar */
.users-page .home-section {
    padding-left: var(--spacing-xl);
    padding-right: var(--spacing-xl);
}

.home-section h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
}

.home-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    margin-top: var(--spacing-xl);
}

.home-section p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    line-height: 1.6;
}

/* Dashboard Cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.dashboard-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

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

.dashboard-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-md);
    font-size: 1.5rem;
}

.dashboard-card-icon.primary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.dashboard-card-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.dashboard-card-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.dashboard-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.dashboard-card-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-color);
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .home-section {
        margin-left: 0;
        padding: var(--spacing-lg);
    }
    
    .sidebar.open ~ .home-section {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .home-section {
        padding: var(--spacing-md);
    }
    
    .home-section h1 {
        font-size: 1.75rem;
    }
    
    .dashboard-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .row .col-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

header h1 {
    font-size: 2.1rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--primary-color);
    margin: 0;
}

.services-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 1.2rem;
    gap: 1.5rem;
}

.services-header h2 {
    color: var(--primary-color);
    font-family: var(--font-family);
    font-weight: 700;
    font-size: 2rem;
    margin: 0;
}

.team-selector {
    position: absolute;
    top: 0.5rem;
    right: 2.5rem;
    z-index: 10;
    background: none;
    padding: 0;
    margin: 0;
    box-shadow: none;
    display: flex;
    align-items: center;
}

.team-selector select {
    padding: 12px 18px;
    border-radius: var(--border-radius);
    border: 2px solid var(--primary-color);
    background-color: #fff;
    color: var(--text-dark);
    font-family: var(--font-family);
    font-size: 1rem;
    min-width: 220px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 8L10 13L15 8' stroke='%23f97216' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 22px;
    box-shadow: var(--box-shadow);
    transition: border 0.2s;
}

.team-selector select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px #ff914d33;
}

.team-selector select option {
    background-color: #fff;
    color: var(--text-dark);
}

/* Améliorer l'espacement dans les formulaires des modales */
.modal-body .form-group {
    margin-bottom: 1rem; /* Ajoute un espace en bas de chaque groupe de formulaire */
}

.modal-body .form-group:last-child {
    margin-bottom: 0; /* Supprime l'espace pour le dernier élément */
}

nav ul {
    display: flex;
    gap: 2rem;
}

nav a {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 1.08rem;
    padding: 0.5rem 1.2rem;
    border-radius: 10px;
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
}

nav a.active, nav a:hover {
    background: var(--accent-color);
    color: #fff;
}



/* Panels & Cards */
.admin-panel, .categories-container, .signature-container {
    background: rgba(255,255,255,0.92);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2.5rem 2rem;
    margin-top: 2.5rem;
    display: flex;
    gap: 4rem;
}

.admin-sidebar, .categories-sidebar {
    background: var(--bg-light);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 12px #0001;
    padding: 2rem 1.5rem;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    height: fit-content;
}

.admin-sidebar ul, .categories-sidebar ul {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.admin-nav-btn {
    background: transparent;
    color: var(--primary-color);
    border: none;
    border-radius: var(--border-radius);
    padding: 0.8rem 1.2rem;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: background 0.2s, color 0.2s;
}

.admin-nav-btn.active,
.admin-nav-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

.admin-content, .services-container, .signature-form, .signature-preview {
    flex: 1;
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2rem 2.5rem 2.5rem 2.5rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.admin-form, .form-group, .form-actions {
    background: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
}

/* Footer modern collé en bas */
footer {
    background: var(--secondary-color);
    color: #fff;
    text-align: center;
    padding: 1.2rem 0;
    font-size: 1rem;
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
    box-shadow: 0 -2px 12px #0001;
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100vw;
    z-index: 100;
}

/* Main Content Styles */
main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-family: var(--font-family);
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.form-actions {
    margin-top: 1.8rem;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    padding: 1rem;
    border-radius: var(--border-radius);
    background-color: white;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

/* Index Page Styles */
.categories-container {
    display: flex;
    gap: 2rem;
}

.categories-sidebar {
    width: 280px;
    background-color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.categories-sidebar h2 {
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    color: var(--secondary-color);
}

.categories-sidebar ul {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.categories-sidebar li {
    padding: 0.8rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.categories-sidebar li:hover,
.categories-sidebar li.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.25);
}

.services-container {
    flex: 1;
    background-color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    position: relative;
}

.services-container h2 {
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    color: var(--secondary-color);
}

#services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.service-card {
    background-color: var(--light-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid #eee;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow);
    border-color: var(--primary-color);
}

.service-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-name {
    font-weight: 600;
    color: var(--dark-color);
}

/* Admin Page Styles */
.admin-panel {
    display: flex;
    gap: 0;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

.admin-sidebar {
    width: 280px;
    background: var(--primary-color);
    padding: 1.5rem 1rem;
}

.admin-sidebar ul {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.admin-nav-btn {
    width: 100%;
    text-align: left;
    padding: 1rem 1.2rem;
    background: none;
    border: none;
    color: var(--light-color);
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-family: var(--font-family);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-nav-btn:hover,
.admin-nav-btn.active {
    background-color: rgba(255, 255, 255, 0.1);
}

.admin-nav-btn.active {
    background-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.25);
}

.admin-content {
    flex: 1;
    padding: 2rem;
}

.admin-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.admin-section h2 {
    margin-bottom: 0.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--primary-color);
    font-weight: 600;
    color: var(--secondary-color);
}

.admin-form {
    background-color: var(--light-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.admin-list {
    background-color: var(--light-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.admin-list h3 {
    margin-bottom: 1.2rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.admin-list ul {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.admin-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.2rem;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.admin-list-item:hover {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.admin-list-item-actions {
    display: flex;
    gap: 0.8rem;
}

.admin-list-item-actions button {
    padding: 6px 12px;
    font-size: 13px;
}

/* Signature Page Styles */
.signature-generator {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.signature-container {
    display: flex;
    gap: 2rem;
}

.signature-form {
    flex: 1;
    background-color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.signature-form h2 {
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--primary-color);
    font-weight: 600;
    color: var(--secondary-color);
}

.signature-preview {
    flex: 1;
    background-color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.signature-preview h2 {
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--primary-color);
    font-weight: 600;
    color: var(--secondary-color);
}

.signature-preview-container {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    min-height: 200px;
    background: var(--bg-light);
}

.signature-preview-container.has-content {
    background: white;
}

#signature-preview-container {
    min-height: 200px;
    padding: 1.5rem;
    border: 1px dashed #ddd;
    margin-bottom: 1.5rem;
    border-radius: var(--border-radius);
    background-color: var(--light-color);
}

.placeholder-text {
    color: #999;
    text-align: center;
    padding: 2rem 0;
    font-style: italic;
}

.signature-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.signature-instructions {
    background-color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.signature-instructions h3 {
    margin-bottom: 1.2rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.signature-instructions ol {
    padding-left: 1.5rem;
}

.signature-instructions li {
    margin-bottom: 0.8rem;
    position: relative;
}

/* Email Signature Templates */
.signature-template {
    font-family: Arial, sans-serif;
    color: #333;
    line-height: 1.4;
}

.signature-template.standard {
    border-left: 3px solid var(--primary-color);
    padding-left: 15px;
}

.signature-template.compact {
    font-size: 0.95em;
}

.signature-template.modern {
    border-top: 2px solid var(--primary-color);
    padding-top: 15px;
}

.signature-name {
    font-weight: bold;
    font-size: 1.2em;
    color: var(--primary-color);
}

.signature-position {
    font-style: italic;
    margin-bottom: 8px;
}

.signature-contact {
    margin-top: 8px;
}

.signature-team {
    margin-top: 8px;
    color: var(--secondary-color);
    font-weight: 500;
}

/* Context Menu Styles */
.context-menu {
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
    z-index: 1000;
    min-width: 180px;
    display: none;
}

.context-menu ul {
    padding: var(--spacing-sm) 0;
    margin: 0;
}

.context-menu li {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.context-menu li:hover {
    background: var(--bg-light);
}

.context-menu li i {
    color: var(--text-secondary);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--bg-card);
    margin: 5% auto;
    padding: 0;
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 600px;
    box-shadow: var(--box-shadow-lg);
    animation: modalSlideIn 0.3s ease-out;
}

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

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

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

.modal-body {
    padding: var(--spacing-lg);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

.close {
    color: var(--text-muted);
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    padding: var(--spacing-xs);
    border-radius: var(--border-radius);
}

.close:hover {
    color: var(--text-primary);
    background-color: var(--bg-light);
}

/* Search Results Styles */
.search-results {
    max-height: 300px;
    overflow-y: auto;
    margin-top: var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-light);
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: var(--primary-color);
    color: white;
}

.search-result-item img {
    margin-right: var(--spacing-md);
    border-radius: 50%;
}

.search-result-info {
    flex: 1;
}

.search-result-info .name {
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.search-result-info .email {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.search-result-item:hover .search-result-info .email {
    color: rgba(255, 255, 255, 0.8);
}

/* Enhanced Context Menu */
.context-menu {
    position: absolute;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
    z-index: 1000;
    min-width: 200px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.context-menu ul {
    list-style: none;
    margin: 0;
    padding: var(--spacing-xs) 0;
}

.context-menu li {
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    transition: var(--transition);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.context-menu li:hover {
    background-color: var(--primary-color);
    color: white;
}

.context-menu li i {
    font-size: 1rem;
    width: 16px;
    text-align: center;
}

/* Loading State */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    color: var(--text-muted);
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: var(--spacing-sm);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced form styles */
.form-group {
    margin-bottom: var(--spacing-md);
}

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

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

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

/* Enhanced badge styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 1rem;
    border-radius: 20px; /* More rounded */
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    gap: var(--spacing-xs);
}

.badge-primary {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.badge-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.badge-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

/* Les styles du calendrier sont maintenant gérés directement en ligne dans hours.php et via JavaScript */
/* Suppression des anciennes règles pour éviter les conflits */


/* Modal for hours */
.period-info {
    font-weight: 600;
    padding: var(--spacing-sm);
    background: var(--bg-light);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-md);
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--spacing-lg);
}

/* Styles spécifiques pour le modal d'historique */
.modal-lg {
    max-width: 800px;
}

.modal-lg .modal-content {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-lg .modal-body {
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--spacing-lg);
    flex: 1;
}

/* Style pour les listes d'historique */
.list-group {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list-group-item {
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
    border-bottom: none;
    background: white;
    transition: var(--transition);
}

.list-group-item:first-child {
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
}

.list-group-item:last-child {
    border-bottom: 1px solid var(--border-color);
    border-bottom-left-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
}

.list-group-item:hover {
    background: var(--bg-light);
}

.list-group-item strong {
    color: var(--primary-color);
    font-weight: 600;
}

.list-group-item .text-muted {
    font-size: 0.8rem;
    margin-top: var(--spacing-xs);
}

/* Scroll amélioré pour Webkit */
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
