/* Variables CSS */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --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('../../Bg/bg8.png') no-repeat center top fixed;
    background-size: cover;
    overflow-x: visible;
    width: 100%;
    max-width: 100%;
}

html {
    overflow-x: visible;
    width: 100%;
    max-width: 100%;
}

/* 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;
    overflow-x: visible;
    width: 100%;
}

/* 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, #2563eb 0%, #1e40af 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: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    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(37, 99, 235, 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(37, 99, 235, 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);
    display: flex;
    flex-direction: column;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    position: relative;
    width: 100%;
    max-width: 100%;
    -ms-overflow-style: auto;
    scrollbar-width: thin; /* Scrollbar fine sur Firefox */
}

/* Scrollbar fine et discrète sur desktop - visible seulement si nécessaire */
.table-container::-webkit-scrollbar {
    height: 6px;
    -webkit-appearance: none;
}

.table-container::-webkit-scrollbar-track {
    background: transparent;
}

.table-container::-webkit-scrollbar-thumb {
    background: rgba(136, 136, 136, 0.3);
    border-radius: 3px;
    transition: background 0.2s;
}

.table-container:hover::-webkit-scrollbar-thumb {
    background: rgba(136, 136, 136, 0.6);
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: rgba(136, 136, 136, 0.8);
}

.table-container .table-header {
    flex-shrink: 0;
    position: relative;
    background: var(--card-bg);
    z-index: 2;
    border-bottom: 1px solid var(--border-color);
    overflow: visible;
    width: 100%;
}

/* Solution principale: permettre le scroll horizontal pour les tables */
.table-container > table.table {
    display: table;
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

/* Garder la pagination fixe lors du scroll horizontal */
.table-container > div:last-child:not(.table-header):not(.table) {
    position: sticky;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--card-bg);
    z-index: 2;
    overflow: visible;
}

/* Wrapper pour le scroll horizontal de la table */
.table-scroll-wrapper {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
}

/* Pour les tables dans un wrapper */
.table-wrapper {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
}

.table-wrapper .table {
    width: 100%;
    min-width: max-content;
}

.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-layout: auto;
}

.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);
}

/* 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 - Tablettes */
@media (max-width: 968px) {
    .container {
        padding: 1.5rem;
    }
    
    .header {
        padding: 1rem 1.5rem;
        flex-wrap: wrap;
    }
    
    .logo-text h1 {
        font-size: 1.25rem;
    }
    
    .logo-text p {
        font-size: 0.75rem;
    }
    
    .welcome-text {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .modules-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .table-container {
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x;
        -ms-overflow-style: -ms-autohiding-scrollbar;
    }
    
    .table {
        min-width: 800px;
        width: max-content;
    }
    
    .table-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    .modal {
        max-width: 90%;
        margin: 1rem;
    }
    
    .modal-overlay {
        padding: 1rem;
    }
    
    .pagination {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .pagination-info {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .pagination-controls {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab {
        white-space: nowrap;
        padding: 0.75rem 1rem;
    }
}

/* Responsive - Téléphones */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .header {
        padding: 0.75rem 1rem;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .logo-container {
        width: 100%;
        justify-content: space-between;
    }
    
    .logo {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .logo-text h1 {
        font-size: 1.1rem;
    }
    
    .logo-text p {
        font-size: 0.7rem;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
        gap: 0.5rem;
    }
    
    .user-menu-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card-content .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .modules-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .module-card {
        padding: 1.25rem;
    }
    
    .module-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }
    
    .module-card h3 {
        font-size: 1rem;
    }
    
    .module-card p {
        font-size: 0.85rem;
    }
    
    .dashboard-header h1 {
        font-size: 1.5rem;
    }
    
    .container {
        overflow-x: visible !important;
        padding: 1rem;
        max-width: 100%;
    }
    
    .table-container {
        overflow-x: scroll !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-x !important;
        -ms-overflow-style: -ms-autohiding-scrollbar;
        scrollbar-width: thin;
        position: relative;
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        display: block !important;
    }
    
    .table-container::-webkit-scrollbar {
        height: 10px;
        -webkit-appearance: none;
        display: block;
    }
    
    .table-container::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }
    
    .table-container::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 4px;
    }
    
    .table-container::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
    
    .table {
        min-width: 700px !important;
        width: max-content !important;
        font-size: 0.8rem;
        display: table !important;
        table-layout: auto;
        border-collapse: collapse;
    }
    
    .table-container > table.table {
        min-width: 700px !important;
        width: max-content !important;
        display: table !important;
    }
    
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
    }
    
    .table-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .table-header h3 {
        font-size: 1.1rem;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    .search-box input {
        font-size: 0.875rem;
        padding: 0.5rem 0.5rem 0.5rem 2rem;
    }
    
    .modal {
        max-width: 95%;
        max-height: 95vh;
        margin: 0.5rem;
        border-radius: 8px;
    }
    
    .modal-overlay {
        padding: 0.5rem;
        align-items: flex-start;
        padding-top: 2rem;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
    
    .modal-header p {
        font-size: 0.8rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 1rem;
        flex-direction: column-reverse;
        gap: 0.75rem;
    }
    
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
    
    .form-group {
        margin-bottom: 1.25rem;
    }
    
    .form-group label {
        font-size: 0.8rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.625rem;
        font-size: 0.875rem;
    }
    
    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
    
    .btn-sm {
        padding: 0.375rem 0.625rem;
        font-size: 0.75rem;
    }
    
    .pagination {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .pagination-info {
        justify-content: center;
        text-align: center;
        font-size: 0.8rem;
        flex-wrap: wrap;
    }
    
    .pagination-controls {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .pagination-numbers {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0.25rem;
    }
    
    .tab {
        padding: 0.625rem 1rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }
    
    .back-btn {
        font-size: 0.8rem;
        margin-bottom: 0.75rem;
    }
    
    .badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.6rem;
    }
    
    .items-section {
        padding: 1rem;
    }
    
    .item-row {
        padding: 0.75rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .item-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .receipt-header {
        padding: 1rem;
    }
    
    .receipt-content {
        padding: 1rem;
    }
    
    .receipt-info-row {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .receipt-table {
        font-size: 0.8rem;
    }
    
    .receipt-table th,
    .receipt-table td {
        padding: 0.5rem 0.25rem;
    }
}

/* Responsive - Petits téléphones */
@media (max-width: 480px) {
    .container {
        padding: 0.75rem;
    }
    
    .header {
        padding: 0.5rem 0.75rem;
    }
    
    .logo {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    .logo-text h1 {
        font-size: 1rem;
    }
    
    .logo-text p {
        display: none;
    }
    
    .stats-grid {
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 0.875rem;
    }
    
    .stat-card-content .stat-value {
        font-size: 1.25rem;
    }
    
    .stat-icon {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    .modules-grid {
        gap: 0.75rem;
    }
    
    .module-card {
        padding: 1rem;
    }
    
    .module-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .container {
        overflow-x: visible !important;
        padding: 0.75rem;
        max-width: 100%;
    }
    
    .table-container {
        overflow-x: scroll !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-x !important;
        -ms-overflow-style: -ms-autohiding-scrollbar;
        scrollbar-width: thin;
        position: relative;
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        display: block !important;
    }
    
    .table-container::-webkit-scrollbar {
        height: 10px;
        -webkit-appearance: none;
        display: block;
    }
    
    .table-container::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 3px;
    }
    
    .table-container::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 3px;
    }
    
    .table-container::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
    
    .table {
        min-width: 600px !important;
        width: max-content !important;
        font-size: 0.75rem;
        display: table !important;
        table-layout: auto;
        border-collapse: collapse;
    }
    
    .table-container > table.table {
        min-width: 600px !important;
        width: max-content !important;
        display: table !important;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.375rem;
    }
    
    .modal {
        max-width: 100%;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
    }
    
    .modal-overlay {
        padding: 0;
        align-items: stretch;
    }
    
    .modal-header {
        padding: 0.875rem;
    }
    
    .modal-header h2 {
        font-size: 1.1rem;
    }
    
    .modal-body {
        padding: 0.875rem;
    }
    
    .modal-footer {
        padding: 0.875rem;
    }
    
    .btn {
        padding: 0.625rem 0.875rem;
        font-size: 0.8rem;
    }
    
    .pagination-info {
        font-size: 0.75rem;
    }
    
    .tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .action-menu-dropdown {
        right: auto;
        left: 0;
    }
    
    .user-menu-dropdown {
        right: 0;
        left: auto;
        min-width: 180px;
    }
}

/* 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;
}

/* Classes utilitaires pour les headers de modules */
.module-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.module-header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.module-header-title {
    margin: 0;
    font-size: 1.75rem;
}

.module-header-subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.module-header-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Responsive pour les headers de modules */
@media (max-width: 768px) {
    .module-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .module-header-content {
        width: 100%;
    }
    
    .module-header-title {
        font-size: 1.5rem;
    }
    
    .module-header-subtitle {
        font-size: 0.8rem;
    }
    
    .module-header-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .module-header-actions .btn {
        flex: 1;
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .module-header-title {
        font-size: 1.25rem;
    }
    
    .module-header-actions {
        flex-direction: column;
    }
    
    .module-header-actions .btn {
        width: 100%;
    }
}


