/* Custom styles for GestionCaisse */
:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
}

/* Thème rouge pour MAISON DES ABAYA */
.theme-abaya {
    --primary-color: #dc2626;
    --primary-gradient: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    --primary-light: #fef2f2;
    --primary-dark: #991b1b;
}

.theme-abaya .bg-primary {
    background: var(--primary-gradient) !important;
}

.theme-abaya .btn-primary {
    background: var(--primary-gradient) !important;
    border-color: var(--primary-color) !important;
}

.theme-abaya .btn-primary:hover {
    background: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
}

.theme-abaya .stat-card {
    background: var(--primary-gradient) !important;
}

.theme-abaya .navbar-dark.bg-primary {
    background: var(--primary-gradient) !important;
}

.theme-abaya .sidebar {
    background: var(--primary-gradient) !important;
}


.theme-abaya .text-primary {
    color: var(--primary-color) !important;
}

/* ========================================
   OPTIMISATIONS DE PERFORMANCE ET RESPONSIVITÉ
   ======================================== */

/* Optimisation mobile : Améliorer les performances de rendu */
@media (max-width: 767.98px) {
    /* Désactiver les animations complexes sur mobile pour améliorer les performances */
    .card, .table, .btn {
        transition: none !important;
    }

    /* Optimiser les tableaux pour mobile */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling sur iOS */
    }

    /* Améliorer la lisibilité des textes sur mobile */
    body {
        font-size: 14px;
        line-height: 1.5;
    }

    /* Optimiser les formulaires pour mobile */
    .form-control, .form-select {
        font-size: 16px; /* Évite le zoom automatique sur iOS */
    }

    /* Améliorer la taille des boutons pour le tactile */
    .btn {
        min-height: 44px; /* Taille minimale recommandée pour le tactile */
        padding: 0.5rem 1rem;
    }

    /* Optimiser les cards pour mobile */
    .card {
        margin-bottom: 1rem;
    }

    .card-body {
        padding: 1rem;
    }
}

/* Optimisation : Lazy loading des images */
img[loading="lazy"] {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Optimisation : Améliorer les performances de scroll */
html {
    scroll-behavior: smooth;
}

/* Optimisation : Réduire les repaints avec will-change */
.card:hover, .btn:hover {
    will-change: transform;
}

/* Optimisation : Améliorer les performances des transitions */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Optimisation : Améliorer le rendu des textes */
body {
    text-rendering: optimizeLegibility;
}

/* Optimisation mobile : Améliorer la sidebar */
@media (max-width: 767.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1039;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

/* Optimisation : Réduire la taille des tableaux sur mobile */
@media (max-width: 767.98px) {
    .table {
        font-size: 0.875rem;
    }

    .table th, .table td {
        padding: 0.5rem 0.25rem;
    }
}

/* Optimisation : Améliorer les statistiques cards pour mobile */
@media (max-width: 767.98px) {
    .stat-card {
        margin-bottom: 0.75rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }
}

/* Optimisation : Améliorer les paginations pour mobile */
@media (max-width: 767.98px) {
    .pagination {
        justify-content: center;
        flex-wrap: wrap;
    }

    .pagination .page-link {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
    }
}

.theme-abaya .border-primary {
    border-color: var(--primary-color) !important;
}

.theme-abaya .bg-primary-light {
    background-color: var(--primary-light) !important;
}

.theme-abaya .alert-primary {
    background-color: var(--primary-light) !important;
    border-color: var(--primary-color) !important;
    color: var(--primary-dark) !important;
}

.theme-abaya .badge-primary {
    background-color: var(--primary-color) !important;
}

.theme-abaya .progress-bar {
    background-color: var(--primary-color) !important;
}

.theme-abaya .pagination .page-link {
    color: var(--primary-color) !important;
}

.theme-abaya .pagination .page-item.active .page-link {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.theme-abaya .form-control:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.25) !important;
}

.theme-abaya .form-check-input:checked {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.theme-abaya .dropdown-item:focus,
.theme-abaya .dropdown-item:hover {
    background-color: var(--primary-light) !important;
    color: var(--primary-dark) !important;
}

/* Gradient backgrounds for auth pages - Uniformized with Abaya theme */
.bg-gradient-primary {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.bg-gradient-info {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

/* Auth Page Styles - Modern Design with Blurred Background */
.auth-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 800"><defs><linearGradient id="bg" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="0%" style="stop-color:%23dc2626;stop-opacity:1" /><stop offset="100%" style="stop-color:%23b91c1c;stop-opacity:1" /></linearGradient></defs><rect width="100%" height="100%" fill="url(%23bg)"/><circle cx="200" cy="150" r="80" fill="rgba(255,255,255,0.1)"/><circle cx="1000" cy="200" r="120" fill="rgba(255,255,255,0.05)"/><circle cx="800" cy="600" r="100" fill="rgba(255,255,255,0.08)"/><circle cx="300" cy="700" r="60" fill="rgba(255,255,255,0.06)"/></svg>');
    background-size: cover;
    background-position: center;
    filter: blur(8px);
    transform: scale(1.1);
    z-index: -2;
}

.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: -1;
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo {
    font-size: 2rem;
    font-weight: 800;
    color: #dc2626;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.auth-form {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-control {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
}

.form-control:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
    background: white;
}

.form-control::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.auth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.form-check {
    display: flex;
    align-items: center;
}

.form-check-input {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    border-radius: 4px;
    border: 2px solid #d1d5db;
}

.form-check-input:checked {
    background-color: #dc2626;
    border-color: #dc2626;
}

.form-check-label {
    font-size: 14px;
    color: #6b7280;
    cursor: pointer;
}

.forgot-link {
    color: #dc2626;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: #b91c1c;
    text-decoration: underline;
}

.auth-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
}

.auth-footer p {
    color: #6b7280;
    font-size: 14px;
    margin: 0;
}

.auth-link {
    color: #dc2626;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-link:hover {
    color: #b91c1c;
    text-decoration: underline;
}

.demo-credentials {
    margin-top: 30px;
}

.demo-card {
    background: rgba(220, 38, 38, 0.05);
    border: 1px solid rgba(220, 38, 38, 0.1);
    border-radius: 12px;
    padding: 20px;
}

.demo-title {
    color: #dc2626;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
}

.demo-accounts {
    font-size: 12px;
    color: #6b7280;
}

.demo-account {
    margin-bottom: 8px;
    padding: 5px 0;
}

.demo-password {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(220, 38, 38, 0.1);
}

.brain-icon {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
    animation: float 3s ease-in-out infinite;
}

.brain-icon i {
    color: white;
    font-size: 20px;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8fafc;
}

.sidebar {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    min-height: 100vh;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    width: 230px;
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.9);
    padding: 12px 20px;
    border-radius: 8px;
    margin: 4px 0;
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: white;
    background-color: rgba(255,255,255,0.15);
    transform: translateX(5px);
}

.sidebar .nav-link i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.topbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-bottom: 1px solid #e2e8f0;
}

.main-content {
    background-color: #f8fafc;
    min-height: 100vh;
    padding: 20px;
}

.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1);
}

.stat-card {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-card .stat-label {
    opacity: 0.9;
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.table thead th {
    background-color: #f8fafc;
    border: none;
    font-weight: 600;
    color: #374151;
    padding: 15px;
}

.table tbody td {
    border: none;
    padding: 15px;
    border-bottom: 1px solid #f1f5f9;
}

.badge {
    border-radius: 20px;
    padding: 6px 12px;
    font-weight: 500;
}

.badge-success {
    background-color: #dc2626;
    color: white;
}

.badge-danger {
    background-color: #ef4444;
    color: white;
}

.badge-warning {
    background-color: #dc2626;
    color: white;
}

.badge-info {
    background-color: #dc2626;
    color: white;
}

/* ===== RESPONSIVE DESIGN COMPLET ===== */

/* Mobile First Approach */
@media (max-width: 576px) {
    /* Navigation mobile */
    .navbar-toggler {
        border: none;
        padding: 4px 8px;
    }

    .navbar-collapse {
        background: white;
        border-radius: 8px;
        margin-top: 10px;
        padding: 10px;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }

    .navbar-nav .nav-link {
        padding: 8px 12px;
        margin: 2px 0;
        border-radius: 6px;
        color: #374151;
    }

    .navbar-nav .nav-link:hover {
        background-color: #f3f4f6;
    }

    /* Cards responsive */
    .card {
        margin-bottom: 15px;
        border-radius: 8px;
    }

    .card-body {
        padding: 15px;
    }

    .card-header {
        padding: 12px 15px;
        font-size: 0.9rem;
    }

    /* Tables responsive */
    .table-responsive {
        border-radius: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        font-size: 0.85rem;
        min-width: 600px; /* Force horizontal scroll on very small screens */
    }

    .table thead th {
        padding: 10px 8px;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    .table tbody td {
        padding: 10px 8px;
        white-space: nowrap;
    }

    /* Make tables more compact on mobile */
    .table-sm td,
    .table-sm th {
        padding: 5px;
    }

    /* Buttons responsive */
    .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
        border-radius: 6px;
    }

    .btn-sm {
        padding: 4px 8px;
        font-size: 0.8rem;
    }

    /* Button groups responsive */
    .btn-group-responsive {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

    .btn-group-responsive .btn {
        width: 100%;
    }

    /* Dropdown actions on mobile */
    .dropdown-toggle::after {
        display: none;
    }

    .dropdown-menu {
        right: 0;
        left: auto;
        min-width: 160px;
    }

    /* Forms responsive */
    .form-control {
        padding: 10px 12px;
        font-size: 0.9rem;
        border-radius: 6px;
        width: 100%;
    }

    .form-label {
        font-size: 0.9rem;
        margin-bottom: 5px;
    }

    .input-group {
        flex-wrap: wrap;
    }

    .input-group .form-control {
        margin-bottom: 5px;
    }

    /* Statistics cards */
    .stat-card {
        padding: 15px;
        margin-bottom: 15px;
    }

    .stat-card .stat-value {
        font-size: 1.5rem;
    }

    .stat-card .stat-label {
        font-size: 0.8rem;
    }

    /* Optimisation des icônes dans les stat-cards sur mobile */
    .stat-card .fa-2x {
        font-size: 1.5rem !important;
    }

    .stat-card .ms-3 {
        margin-left: 0.75rem !important;
    }

    /* Espacement entre les éléments des stat-cards */
    .stat-card .d-flex {
        flex-wrap: wrap;
    }

    .stat-card .flex-grow-1 {
        min-width: 60%;
    }

    /* Dashboard responsive */
    .row {
        margin: 0 -5px;
    }

    .col-md-3, .col-md-4, .col-md-6, .col-md-8, .col-md-12 {
        padding: 0 5px;
        margin-bottom: 10px;
    }

    /* Stat-cards en 2 colonnes sur mobile */
    .row .col-md-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .row .col-md-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    @media (max-width: 400px) {
        /* Une colonne sur très petit écran */
        .row .col-md-3 {
            flex: 0 0 100%;
            max-width: 100%;
        }

        .row .col-md-4 {
            flex: 0 0 100%;
            max-width: 100%;
        }
    }

    /* POS Interface mobile */
    .pos-container {
        padding: 10px;
    }

    .pos-products {
        max-height: 300px;
        overflow-y: auto;
    }

    .pos-cart {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid #e5e7eb;
        padding: 15px;
        z-index: 1000;
        max-height: 50vh;
        overflow-y: auto;
    }

    /* Améliorations pour les cartes statistiques */
    .card .card-header h5 {
        font-size: 0.9rem;
        margin-bottom: 0;
    }

    /* Responsive pour les badges */
    .badge-sm {
        font-size: 0.65rem;
        padding: 3px 6px;
    }

    /* Améliorations boutons groupes */
    .btn-group-vertical .btn {
        margin-bottom: 5px;
    }

    /* Espacements optimisés pour mobile */
    .mb-mobile {
        margin-bottom: 10px !important;
    }

    .mt-mobile {
        margin-top: 10px !important;
    }

    /* Lignes séparatrices responsives */
    .divider-mobile {
        margin: 10px 0;
    }

    /* Modals responsive */
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }

    .modal-content {
        border-radius: 8px;
    }

    .modal-header {
        padding: 15px;
    }

    .modal-body {
        padding: 15px;
    }

    /* Alerts responsive */
    .alert {
        padding: 10px 15px;
        margin-bottom: 15px;
        border-radius: 6px;
        font-size: 0.9rem;
    }

    /* Pagination responsive */
    .pagination {
        justify-content: center;
        flex-wrap: wrap;
    }

    .page-link {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

        /* Topbar responsive */
    .topbar {
        padding: 10px 15px;
    }

    .topbar h1 {
        font-size: 1.1rem;
    }

    .topbar .dropdown-menu {
        max-width: calc(100vw - 20px);
    }

    /* User menu responsive */
    .topbar .dropdown .btn-link {
        padding: 5px 8px;
        font-size: 0.85rem;
    }

    .topbar .dropdown .btn-link .fw-bold {
        font-size: 0.9rem;
    }

    .topbar .dropdown .btn-link small {
        font-size: 0.75rem;
    }

    /* Cacher nom utilisateur sur très petit écran */
    @media (max-width: 400px) {
        .topbar .btn-link .text-start {
            display: none;
        }
    }

    /* Hide some elements on mobile */
    .d-mobile-none {
        display: none !important;
    }

    /* Badge responsive */
    .badge {
        font-size: 0.75rem;
        padding: 4px 8px;
    }

    /* Text alignment for mobile */
    .text-center-mobile {
        text-align: center;
    }

    /* Stack elements vertically on mobile */
    .stack-mobile {
        flex-direction: column;
    }

    .stack-mobile > * {
        width: 100%;
        margin-bottom: 10px;
    }

    /* Titres responsive */
    h1, .h1 {
        font-size: 1.5rem;
    }

    h2, .h2 {
        font-size: 1.3rem;
    }

    h3, .h3 {
        font-size: 1.1rem;
    }

    h4, .h4 {
        font-size: 1rem;
    }

    /* Headers dans les cards */
    .card-header h3,
    .card-header h4,
    .card-header h5 {
        font-size: 1rem;
        line-height: 1.5;
    }

    /* Container responsive */
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Input groups responsive */
    .input-group-text {
        font-size: 0.85rem;
        padding: 6px 10px;
    }

    /* Breadcrumb responsive */
    .breadcrumb {
        font-size: 0.8rem;
        padding: 8px 10px;
    }

    /* Dropdown responsive */
    .dropdown-item {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    /* Responsive Design Auth */
    .auth-card {
        padding: 30px 20px;
        margin: 10px;
    }

    .auth-logo {
        font-size: 1.5rem;
    }

    .auth-title {
        font-size: 1.25rem;
    }

    .brain-icon {
        width: 40px;
        height: 40px;
        bottom: 20px;
        right: 20px;
    }

    .brain-icon i {
        font-size: 16px;
    }
}

/* Sidebar responsive mobile */
@media (max-width: 768px) {
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -280px !important;
        width: 280px !important;
        z-index: 1050 !important;
        transition: left 0.3s ease !important;
        height: 100vh !important;
        overflow-y: auto !important;
        box-shadow: 2px 0 15px rgba(0,0,0,0.3) !important;
        display: block !important;
    }

    .sidebar.show {
        left: 0 !important;
    }

    .sidebar-overlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background: rgba(0, 0, 0, 0.5) !important;
        z-index: 1040 !important;
        display: none !important;
        transition: opacity 0.3s ease !important;
    }

    .sidebar-overlay.show {
        display: block !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 15px !important;
    }

    .navbar-brand {
        font-size: 1.1rem !important;
    }

    #sidebarToggle {
        border: none !important;
        background: none !important;
        font-size: 1.5rem !important;
        cursor: pointer !important;
        padding: 8px !important;
    }

    #sidebarToggle:focus {
        outline: none !important;
        box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.3) !important;
        border-radius: 4px !important;
    }
}

/* Tablets */
@media (min-width: 577px) and (max-width: 768px) {
    .main-content {
        padding: 15px;
    }

    .card {
        margin-bottom: 20px;
    }

    .table {
        font-size: 0.9rem;
    }

    .stat-card .stat-value {
        font-size: 1.8rem;
    }

    .btn {
        padding: 10px 18px;
    }

    /* 2 columns layout on tablets */
    .grid-2-col {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    /* Better spacing on tablets */
    .container-fluid {
        padding-left: 20px;
        padding-right: 20px;
    }

    /* Slightly larger text on tablets */
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    /* Titres */
    .h1 {
        font-size: 1.5rem;
    }

    .h2 {
        font-size: 1.3rem;
    }

    .h3 {
        font-size: 1.2rem;
    }

    .h4 {
        font-size: 1.1rem;
    }

    /* Topbar pour tablette */
    .topbar {
        padding: 12px 20px;
    }

    /* Sidebar pour tablette */
    .sidebar .nav-link {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    /* Cards responsive */
    .stat-card {
        padding: 18px;
    }

    /* Formes pour tablette */
    .form-control {
        padding: 12px 16px;
    }
}

/* Desktop small */
@media (min-width: 769px) and (max-width: 992px) {
    .main-content {
        padding: 20px;
    }

    .card {
        margin-bottom: 20px;
    }

    .stat-card .stat-value {
        font-size: 1.9rem;
    }

    /* Topbar */
    .topbar {
        padding: 15px 25px;
    }

    /* Sidebar */
    .sidebar {
        width: 220px !important;
    }

    .sidebar .nav-link {
        padding: 10px 18px;
        font-size: 0.95rem;
    }
}

/* Desktop large */
@media (min-width: 993px) {
    .main-content {
        padding: 30px;
    }

    .card {
        margin-bottom: 25px;
    }

    .stat-card .stat-value {
        font-size: 2rem;
    }

    /* Topbar */
    .topbar {
        padding: 15px 30px;
    }

    /* Sidebar */
    .sidebar {
        width: 250px !important;
    }

    .sidebar .nav-link {
        padding: 12px 20px;
        font-size: 1rem;
    }

    /* Container max-width pour lisibilité */
    .container-fluid {
        max-width: 1400px;
        margin: 0 auto;
    }
}

/* Print styles */
@media print {
    .navbar, .sidebar, .btn, .modal {
        display: none !important;
    }

    .main-content {
        margin: 0;
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .table {
        font-size: 12px;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000;
    }

    .btn {
        border: 2px solid #000;
    }

    .table {
        border: 2px solid #000;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --bs-body-bg: #1a1a1a;
        --bs-body-color: #ffffff;
    }

    .card {
        background-color: #2d2d2d;
        color: #ffffff;
    }

    .table {
        background-color: #2d2d2d;
        color: #ffffff;
    }

    .table thead th {
        background-color: #3d3d3d;
        color: #ffffff;
    }
}

