/* Variables CSS */
:root {
    --primary-color: #E10006;
    --primary-dark: #C00005;
    --primary-light: #FF1A1A;
    --secondary-color: #f59e0b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f0f9ff;
    --card-bg: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    background: #e9f3ff url('../E-transit.png') no-repeat center top fixed;
    background-size: cover;
}

/* Header et Navigation */
.header {
    background: var(--card-bg);
    box-shadow: var(--shadow);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.logo-text h1 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin: 0;
}

.logo-text p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.welcome-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Menu utilisateur */
.user-menu {
    position: relative;
}

.user-menu-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-menu-btn:hover {
    background: var(--bg-color);
    border-color: var(--primary-color);
}

.user-menu-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 1000;
    overflow: hidden;
}

.user-menu-dropdown.show {
    display: block;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s;
    border-bottom: 1px solid var(--border-color);
}

.user-menu-item:last-child {
    border-bottom: none;
}

.user-menu-item:hover {
    background: var(--bg-color);
}

.user-menu-item span:first-child {
    font-size: 1.25rem;
}

.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #d97706;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* Container principal */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Page de connexion - Design moderne */
.login-wrapper {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #f8fafc;
}

.login-branding {
    background: linear-gradient(135deg, #001F3F 0%, #000E1D 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.login-branding::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: movePattern 20s linear infinite;
}

@keyframes movePattern {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.login-branding-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
    max-width: 500px;
}

.login-logo {
    height: 200px;
    width: auto;
    object-fit: contain;
    margin-bottom: 2rem;
    background: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.login-logo-placeholder {
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    margin: 0 auto 2rem;
    backdrop-filter: blur(10px);
}

.login-brand-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: white;
}

.login-brand-subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: 3rem;
    color: rgba(255, 255, 255, 0.9);
}

.login-features {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 3rem;
}

.login-feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.feature-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.login-form-section {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: white;
}

.login-card {
    width: 100%;
    max-width: 450px;
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.login-error {
    background: #FBD9DA;
    border: 2px solid #E10006;
    color: #E10006;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.login-form {
    margin-bottom: 2rem;
}

.form-group-login {
    margin-bottom: 1.5rem;
}

.form-group-login label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.875rem;
}

.input-icon {
    font-size: 1.125rem;
}

.form-group-login input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9375rem;
    transition: all 0.2s;
    background: white;
}

.form-group-login input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(225, 0, 6, 0.1);
}

.form-group-login input::placeholder {
    color: #9ca3af;
}

.btn-login {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-login:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(225, 0, 6, 0.3);
}

.btn-login:active {
    transform: translateY(0);
}

.login-footer {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.login-help {
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.login-help p {
    margin: 0.25rem 0;
}

.login-help code {
    background: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* Responsive pour la page de connexion */
@media (max-width: 968px) {
    .login-wrapper {
        grid-template-columns: 1fr;
    }
    
    .login-branding {
        display: none;
    }
    
    .login-form-section {
        padding: 2rem 1.5rem;
    }
}

/* Formulaires */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.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(37, 99, 235, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Dashboard */
.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.dashboard-header p {
    color: var(--text-secondary);
}

/* Cartes de statistiques */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-card-content h3 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-card-content .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-card-content .stat-change {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-change.positive {
    color: var(--success-color);
}

.stat-change.negative {
    color: var(--warning-color);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.blue {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.stat-icon.orange {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

/* Modules Grid */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.75rem;
    margin-bottom: 2rem;
}

.module-card {
    position: relative;
    background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(241,245,255,0.92));
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow: 0 25px 45px rgba(15, 23, 42, 0.08);
    text-align: left;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(37, 99, 235, 0.08);
    overflow: hidden;
}

.module-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 35px 60px rgba(15, 23, 42, 0.12);
}

.module-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.module-icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    font-size: 1.5rem;
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25), 0 12px 24px rgba(30, 64, 175, 0.25);
    background: linear-gradient(135deg, #2563eb, #1e40af);
}

.module-icon svg {
    width: 28px;
    height: 28px;
    display: block;
}

.module-icon--caisse {
    background: linear-gradient(135deg, #f97316, #ea580c);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25), 0 12px 24px rgba(234, 88, 12, 0.3);
}

.module-icon--stock {
    background: linear-gradient(135deg, #facc15, #eab308);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.3), 0 12px 24px rgba(234,179,8,0.3);
}

.module-icon--patients {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25), 0 12px 24px rgba(220,38,38,0.3);
}

.module-icon--rh {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25), 0 12px 24px rgba(124,58,237,0.3);
}

.module-icon--param {
    background: linear-gradient(135deg, #0ea5e9, #0369a1);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25), 0 12px 24px rgba(3,105,161,0.3);
}

.module-icon--stats {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25), 0 12px 24px rgba(22,163,74,0.3);
}

.module-card h3 {
    margin-bottom: 0.35rem;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.module-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.tab {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab:hover {
    color: var(--primary-color);
}

.tab.orange.active {
    color: var(--secondary-color);
    border-bottom-color: var(--secondary-color);
}

.tab.orange:hover {
    color: var(--secondary-color);
}

/* Table */
.table-container {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden; /* Maintient les bordures arrondies */
}

/* Le wrapper gère le scroll à l'intérieur du container */
.table-container .table-wrapper {
    margin: 0;
    border-radius: 0;
}

.table-wrapper {
    /* Propriétés de base pour tous les navigateurs */
    overflow-x: auto;
    overflow-y: visible;
    width: 100%;
    position: relative;
    display: block;
    
    /* Optimisation pour iOS Safari */
    -webkit-overflow-scrolling: touch;
    
    /* Support pour IE/Edge */
    -ms-overflow-style: -ms-autohiding-scrollbar;
    
    /* Support pour Firefox */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
    
    /* Assurer que le contenu peut dépasser */
    min-width: 0;
    max-width: 100%;
}

/* Style de la scrollbar pour Chrome, Safari, Edge */
.table-wrapper::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
}

.table-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box input {
    width: 100%;
    padding: 0.625rem 0.625rem 0.625rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
}

.search-box::before {
    content: '🔍';
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: var(--bg-color);
}

.table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.table tbody tr:hover {
    background: var(--bg-color);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-blue {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.badge-orange {
    background: rgba(245, 158, 11, 0.1);
    color: var(--secondary-color);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.badge-info {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--card-bg);
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: start;
}

.modal-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.modal-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Items dans le formulaire */
.items-section {
    background: var(--bg-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.items-section h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.items-list {
    margin-top: 1rem;
}

.item-row {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-info {
    flex: 1;
}

.item-info strong {
    display: block;
    margin-bottom: 0.25rem;
}

.item-info span {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.item-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* Utilitaires */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.back-btn:hover {
    color: var(--primary-color);
}

/* Styles pour le reçu dans le modal */
.receipt-header {
    background: var(--primary-color);
    color: white;
    padding: 1.5rem;
    border-radius: 8px 8px 0 0;
}

.receipt-content {
    padding: 1.5rem;
}

.receipt-info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.receipt-info-row:last-child {
    border-bottom: none;
}

.receipt-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.receipt-table thead {
    border-bottom: 2px solid var(--border-color);
}

.receipt-table th {
    padding: 0.75rem 0;
    text-align: left;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
}

.receipt-table th.center {
    text-align: center;
}

.receipt-table th.right {
    text-align: right;
}

.receipt-table td {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.receipt-table td.center {
    text-align: center;
}

.receipt-table td.right {
    text-align: right;
}

.receipt-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
    margin-top: 1rem;
}

.receipt-footer {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    margin-top: 1.5rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-numbers {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .modules-grid {
        grid-template-columns: 1fr;
    }
    
    .table-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    .pagination {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .pagination-info {
        justify-content: center;
    }
    
    .pagination-controls {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    /* Amélioration du scroll sur mobile pour tous les navigateurs */
    .table-wrapper {
        /* Force le scroll horizontal sur mobile */
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch; /* iOS Safari smooth scrolling */
        -ms-overflow-style: -ms-autohiding-scrollbar; /* IE/Edge */
        scrollbar-width: thin; /* Firefox */
        scrollbar-color: rgba(0, 0, 0, 0.3) transparent; /* Firefox */
        width: 100%;
        max-width: 100%;
        position: relative;
        display: block;
        /* Support pour les anciens navigateurs */
        overflow-scrolling: touch;
    }
    
    /* Style de la scrollbar pour Chrome, Safari, Edge sur mobile */
    .table-wrapper::-webkit-scrollbar {
        height: 6px;
        width: 6px;
    }
    
    .table-wrapper::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.05);
        border-radius: 3px;
    }
    
    .table-wrapper::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.3);
        border-radius: 3px;
    }
    
    .table-wrapper::-webkit-scrollbar-thumb:hover {
        background: rgba(0, 0, 0, 0.5);
    }
    
    /* Assurer que les tableaux peuvent être scrollés */
    .table {
        min-width: 600px;
        width: 100%;
        table-layout: auto;
    }
    
    /* Permettre aux cellules de conserver leur largeur minimale */
    .table th,
    .table td {
        min-width: 100px;
    }
}

/* Styles pour les boutons d'action avec icônes */
.btn-action-edit,
.btn-action-delete,
.btn-action-warning,
.btn-action-success {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-action-edit {
    color: var(--primary-color);
}

.btn-action-edit:hover {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-dark);
}

.btn-action-delete {
    color: var(--danger-color);
}

.btn-action-delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.btn-action-warning {
    color: var(--warning-color);
}

.btn-action-warning:hover {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.btn-action-success {
    color: var(--success-color);
}

.btn-action-success:hover {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.btn-action-edit svg,
.btn-action-delete svg,
.btn-action-warning svg,
.btn-action-success svg {
    flex-shrink: 0;
}

/* Styles pour les checkboxes de modules */
.checkbox-module {
    user-select: none;
}

.checkbox-module:hover {
    background: #f0f9ff !important;
    border-color: var(--primary-color) !important;
}

.checkbox-module input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-module input[type="checkbox"]:checked + span {
    color: var(--primary-color);
    font-weight: 500;
}

.checkbox-module:has(input:checked) {
    background: #eff6ff !important;
    border-color: var(--primary-color) !important;
}

