/* Custom styles for GestionCaisse - Thème sobre et moderne */
:root {
    --primary-color: #475569;
    --primary-dark: #334155;
    --primary-light: #64748b;
    --secondary-color: #94a3b8;
    --success-color: #059669;
    --danger-color: #dc2626;
    --warning-color: #d97706;
    --info-color: #0284c7;
    --light-color: #f8fafc;
    --dark-color: #0f172a;
    --border-color: #e2e8f0;
    --text-primary: #0f172a; /* Plus foncé pour meilleure lisibilité */
    --text-secondary: #475569; /* Plus foncé que #64748b */
    --text-muted: #64748b; /* Contraste amélioré */
    --text-on-primary: #ffffff; /* Texte sur fond de couleur primaire */
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9;
    --primary-color-rgb: 71, 85, 105; /* Pour les rgba */
}

/* Thème rouge pour MAISON DES ABAYA - Conservé mais avec style sobre */
.theme-abaya {
    --primary-color: #dc2626;
    --primary-gradient: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    --primary-light: #fef2f2;
    --primary-dark: #991b1b;
    --text-primary: #0f172a;
    --text-secondary: #7f1d1d;
    --text-muted: #991b1b;
    --text-on-primary: #ffffff;
    --primary-color-rgb: 220, 38, 38;
}

.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;
}

/* Thème bleu */
.theme-blue {
    --primary-color: #2563eb;
    --primary-gradient: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    --primary-light: #eff6ff;
    --primary-dark: #1e40af;
    --text-primary: #0f172a;
    --text-secondary: #1e3a8a;
    --text-muted: #1e40af;
    --text-on-primary: #ffffff;
    --primary-color-rgb: 37, 99, 235;
}

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

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

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

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

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

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

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

/* Thème vert */
.theme-green {
    --primary-color: #059669;
    --primary-gradient: linear-gradient(135deg, #059669 0%, #047857 100%);
    --primary-light: #ecfdf5;
    --primary-dark: #065f46;
    --text-primary: #0f172a;
    --text-secondary: #064e3b;
    --text-muted: #065f46;
    --text-on-primary: #ffffff;
    --primary-color-rgb: 5, 150, 105;
}

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

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

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

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

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

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

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

/* Thème violet */
.theme-purple {
    --primary-color: #7c3aed;
    --primary-gradient: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    --primary-light: #f5f3ff;
    --primary-dark: #5b21b6;
    --text-primary: #0f172a;
    --text-secondary: #4c1d95;
    --text-muted: #5b21b6;
    --text-on-primary: #ffffff;
    --primary-color-rgb: 124, 58, 237;
}

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

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

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

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

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

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

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

/* Thème orange */
.theme-orange {
    --primary-color: #ea580c;
    --primary-gradient: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
    --primary-light: #fff7ed;
    --primary-dark: #9a3412;
    --text-primary: #0f172a;
    --text-secondary: #7c2d12;
    --text-muted: #9a3412;
    --text-on-primary: #ffffff;
    --primary-color-rgb: 234, 88, 12;
}

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

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

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

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

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

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

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

/* ========================================
   ADAPTATION DES TEXTES AU THÈME
   ======================================== */

/* Textes principaux - S'adaptent au thème avec bon contraste */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--text-primary, #0f172a) !important;
    font-weight: 600;
}

/* Amélioration de la lisibilité des textes dans les cartes */
.card {
    color: var(--text-primary, #0f172a) !important;
}

.card .text-muted {
    color: var(--text-secondary, #475569) !important;
    font-weight: 500 !important;
    opacity: 0.9 !important;
}

.card h6.text-muted {
    color: var(--text-secondary, #475569) !important;
    font-weight: 600 !important;
    opacity: 1 !important;
}

.card .fw-semibold,
.card .fw-bold {
    color: var(--text-primary, #0f172a) !important;
    font-weight: 600 !important;
}

.card small.text-muted {
    color: var(--text-secondary, #475569) !important;
    font-weight: 500 !important;
    opacity: 0.85 !important;
}

/* Amélioration des stat-cards pour tous les thèmes */
.stat-card {
    color: #ffffff !important;
}

.stat-card .stat-value {
    color: #ffffff !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

.stat-card .stat-label {
    color: rgba(255, 255, 255, 0.95) !important;
    font-weight: 500 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

.stat-card i {
    opacity: 0.9 !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Adaptation des textes selon les thèmes */
.theme-abaya .card .text-muted {
    color: #7f1d1d !important;
    font-weight: 500 !important;
}

.theme-abaya .card h6.text-muted {
    color: #991b1b !important;
    font-weight: 600 !important;
}

.theme-blue .card .text-muted {
    color: #1e3a8a !important;
    font-weight: 500 !important;
}

.theme-blue .card h6.text-muted {
    color: #1e40af !important;
    font-weight: 600 !important;
}

.theme-green .card .text-muted {
    color: #064e3b !important;
    font-weight: 500 !important;
}

.theme-green .card h6.text-muted {
    color: #065f46 !important;
    font-weight: 600 !important;
}

.theme-purple .card .text-muted {
    color: #4c1d95 !important;
    font-weight: 500 !important;
}

.theme-purple .card h6.text-muted {
    color: #5b21b6 !important;
    font-weight: 600 !important;
}

.theme-orange .card .text-muted {
    color: #7c2d12 !important;
    font-weight: 500 !important;
}

.theme-orange .card h6.text-muted {
    color: #9a3412 !important;
    font-weight: 600 !important;
}

/* Textes secondaires */
.text-secondary,
p.text-secondary,
small.text-secondary {
    color: var(--text-secondary, #475569) !important;
    font-weight: 500 !important;
}

/* Textes en sourdine - Amélioration du contraste */
.text-muted,
p.text-muted,
small.text-muted,
.text-gray-500,
.text-gray-600 {
    color: var(--text-secondary, #475569) !important;
    font-weight: 500 !important;
    opacity: 0.9 !important;
}

/* Labels de formulaire */
label,
.form-label {
    color: var(--text-primary, #0f172a) !important;
    font-weight: 500;
}

/* Liens */
a:not(.btn):not(.nav-link) {
    color: var(--primary-color, #475569) !important;
}

a:not(.btn):not(.nav-link):hover {
    color: var(--primary-dark, #334155) !important;
}

/* Textes dans les cards - Amélioration de la lisibilité */
.card-title,
.card-header h5,
.card-header h6 {
    color: var(--text-primary, #0f172a) !important;
    font-weight: 600 !important;
}

.card-body {
    color: var(--text-primary, #0f172a) !important;
}

.card-body .text-muted {
    color: var(--text-secondary, #475569) !important;
    font-weight: 500 !important;
    opacity: 0.9 !important;
}

.card-body h6.text-muted {
    color: var(--text-secondary, #475569) !important;
    font-weight: 600 !important;
    opacity: 1 !important;
}

.card-body .fw-semibold,
.card-body .fw-bold {
    color: var(--text-primary, #0f172a) !important;
    font-weight: 600 !important;
}

.card-body small.text-muted {
    color: var(--text-secondary, #475569) !important;
    font-weight: 500 !important;
    opacity: 0.85 !important;
}

.card-text,
.card-body p {
    color: var(--text-secondary, #475569) !important;
}

/* Textes dans les tableaux */
.table th {
    color: var(--text-primary, #0f172a) !important;
    font-weight: 600;
}

.table td {
    color: var(--text-secondary, #475569) !important;
}

/* Textes dans les badges */
.badge {
    color: var(--text-on-primary, #ffffff) !important;
}

.badge.bg-primary {
    background-color: var(--primary-color, #475569) !important;
}

/* Textes dans les boutons */
.btn-primary {
    color: var(--text-on-primary, #ffffff) !important;
}

.btn-outline-primary {
    color: var(--primary-color, #475569) !important;
    border-color: var(--primary-color, #475569) !important;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color, #475569) !important;
    color: var(--text-on-primary, #ffffff) !important;
}

/* Textes dans les alertes */
.alert-primary {
    background-color: var(--primary-light, #f1f5f9) !important;
    border-color: var(--primary-color, #475569) !important;
    color: var(--text-primary, #0f172a) !important;
}

.alert-primary .alert-heading {
    color: var(--primary-dark, #334155) !important;
}

/* Textes dans les breadcrumbs */
.breadcrumb-item.active {
    color: var(--text-muted, #64748b) !important;
}

.breadcrumb-item a {
    color: var(--primary-color, #475569) !important;
}

.breadcrumb-item a:hover {
    color: var(--primary-dark, #334155) !important;
}

/* Textes dans les dropdowns */
.dropdown-item {
    color: var(--text-primary, #0f172a) !important;
}

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

/* Textes dans les modals */
.modal-title {
    color: var(--text-primary, #0f172a) !important;
}

.modal-body {
    color: var(--text-secondary, #475569) !important;
}

/* Textes dans les tooltips */
.tooltip-inner {
    background-color: var(--primary-dark, #334155) !important;
    color: var(--text-on-primary, #ffffff) !important;
}

/* Textes dans les stat cards */
.stat-label {
    color: var(--text-secondary, #475569) !important;
}

.stat-value {
    color: var(--text-primary, #0f172a) !important;
}

/* Textes dans les listes */
.list-group-item {
    color: var(--text-secondary, #475569) !important;
}

.list-group-item.active {
    background-color: var(--primary-color, #475569) !important;
    border-color: var(--primary-color, #475569) !important;
    color: var(--text-on-primary, #ffffff) !important;
}

/* Textes dans les paginations */
.page-link {
    color: var(--primary-color, #475569) !important;
}

.page-link:hover {
    color: var(--primary-dark, #334155) !important;
}

.page-item.active .page-link {
    background-color: var(--primary-color, #475569) !important;
    border-color: var(--primary-color, #475569) !important;
    color: var(--text-on-primary, #ffffff) !important;
}

/* Textes dans les inputs */
.form-control,
.form-select {
    color: var(--text-primary, #0f172a) !important;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color, #475569) !important;
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-color-rgb, 71, 85, 105), 0.25) !important;
}

/* Amélioration du contraste pour les textes selon le thème */
.theme-blue .text-primary,
.theme-green .text-primary,
.theme-purple .text-primary,
.theme-orange .text-primary,
.theme-abaya .text-primary {
    color: var(--primary-color) !important;
}

/* Textes sur fonds colorés - Assurer la lisibilité */
.bg-primary,
.btn-primary,
.stat-card {
    color: var(--text-on-primary, #ffffff) !important;
}

/* Amélioration de la lisibilité des textes secondaires */
.theme-blue .text-secondary {
    color: var(--text-secondary, #1e3a8a) !important;
}

.theme-green .text-secondary {
    color: var(--text-secondary, #064e3b) !important;
}

.theme-purple .text-secondary {
    color: var(--text-secondary, #4c1d95) !important;
}

.theme-orange .text-secondary {
    color: var(--text-secondary, #7c2d12) !important;
}

.theme-abaya .text-secondary {
    color: var(--text-secondary, #7f1d1d) !important;
}

/* Textes dans les checkboxes et radio */
.form-check-label {
    color: var(--text-secondary, #475569) !important;
}

.form-check-input:checked {
    background-color: var(--primary-color, #475569) !important;
    border-color: var(--primary-color, #475569) !important;
}

/* Styles pour la page de sélection de boutique - Utilisation des variables de thème */
.boutique-selection-header {
    background: var(--primary-gradient, linear-gradient(135deg, var(--primary-color, #475569) 0%, var(--primary-dark, #334155) 100%)) !important;
}

.boutique-select-btn {
    background: var(--primary-gradient, linear-gradient(135deg, var(--primary-color, #475569) 0%, var(--primary-dark, #334155) 100%)) !important;
}

.boutique-select-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark, #334155) 0%, var(--primary-color, #475569) 100%) !important;
}

.boutique-card:hover {
    border-color: var(--primary-color, #475569) !important;
}

.boutique-title {
    color: var(--primary-color, #475569) !important;
}

.boutique-logo-placeholder {
    background: var(--primary-gradient, linear-gradient(135deg, var(--primary-color, #475569) 0%, var(--primary-dark, #334155) 100%)) !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 */
        display: block;
        width: 100%;
    }

    /* 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;
    }

    /* Améliorer les colonnes Bootstrap sur mobile - forcer l'empilement */
    [class*="col-"] {
        margin-bottom: 1rem;
    }

    /* Améliorer les groupes de boutons sur mobile */
    .btn-group {
        flex-wrap: wrap;
        width: 100%;
    }

    .btn-group .btn {
        flex: 1 1 auto;
        min-width: 0;
    }

    /* Améliorer les modals sur mobile */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    .modal-content {
        border-radius: 0.5rem;
    }

    /* Améliorer les dropdowns sur mobile */
    .dropdown-menu {
        max-width: calc(100vw - 2rem);
        left: auto !important;
        right: 0 !important;
    }

    /* Améliorer les headers avec actions sur mobile */
    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 1rem;
    }

    .d-flex.justify-content-between > * {
        width: 100%;
    }

    /* Améliorer les breadcrumbs sur mobile */
    .breadcrumb {
        font-size: 0.75rem;
        flex-wrap: wrap;
    }

    /* Améliorer les descriptions list (dl) sur mobile */
    dl.row dt {
        margin-bottom: 0.25rem;
    }

    dl.row dd {
        margin-bottom: 0.75rem;
    }

    /* Améliorer les badges dans les tableaux */
    .table .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }

    /* Améliorer les inputs groups */
    .input-group {
        flex-wrap: wrap;
    }

    .input-group > * {
        flex: 1 1 100%;
    }

    /* Améliorer les stats cards en grille */
    .row.g-3, .row.g-4 {
        --bs-gutter-y: 1rem;
    }

    /* Améliorer les filtres et formulaires de recherche */
    form .row.g-3 > [class*="col-"] {
        margin-bottom: 0.75rem;
    }

    /* Améliorer les paginations */
    .pagination {
        font-size: 0.875rem;
    }

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

    /* Améliorer les alertes */
    .alert {
        font-size: 0.875rem;
        padding: 0.75rem 1rem;
    }

    /* Améliorer les descriptions dans les cards */
    .card-header small {
        display: block;
        margin-top: 0.25rem;
    }
}

/* 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 - Thème sobre */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
}

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

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

.bg-gradient-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #0369a1 100%);
}

/* Auth Page Styles - Modern Design with Blurred Background */
.auth-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 50%, var(--primary-light) 100%);
    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(15, 23, 42, 0.3);
    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: var(--primary-dark);
    margin-bottom: 10px;
    letter-spacing: 2px;
    display: flex;
    justify-content: center;
    align-items: center;
}

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

.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: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(71, 85, 105, 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: var(--primary-color);
    border-color: var(--primary-color);
}

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

.forgot-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.auth-btn {
    width: 100%;
    padding: 15px;
    background: var(--primary-dark);
    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(15, 23, 42, 0.15);
}

.auth-btn:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.2);
}

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

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

.auth-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

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

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

.demo-title {
    color: var(--primary-dark);
    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(71, 85, 105, 0.1);
}

.brain-icon {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.2);
    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: var(--light-color);
    color: var(--text-primary);
    font-weight: 400;
    line-height: 1.6;
}

/* Amélioration de la lisibilité globale */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Textes par défaut plus lisibles */
p, span, div, td, th, li, label, small {
    color: var(--text-primary);
}

/* Textes secondaires avec meilleur contraste */
.text-muted, .text-secondary {
    color: var(--text-secondary) !important;
    font-weight: 500 !important;
    opacity: 0.9 !important;
}

/* Textes gris avec meilleur contraste */
.text-gray-500, .text-gray-600 {
    color: var(--text-secondary) !important;
}

.text-gray-400 {
    color: #64748b !important; /* Plus foncé que le gris 400 standard */
}

.text-gray-300 {
    color: #94a3b8 !important; /* Plus foncé que le gris 300 standard */
}

/* Opacités réduites pour meilleure lisibilité */
.opacity-75, .opacity-90 {
    opacity: 1 !important;
    color: var(--text-secondary) !important;
}

.opacity-50 {
    opacity: 0.85 !important;
    color: var(--text-secondary) !important;
}

.sidebar {
    background: var(--primary-dark);
    min-height: 100vh;
    box-shadow: 2px 0 10px rgba(0,0,0,0.08);
    width: 230px;
    border-right: 1px solid var(--border-color);
}

.sidebar img {
    filter: brightness(0) invert(1);
    transition: opacity 0.3s ease, transform 0.3s ease;
    width: 100%;
    max-width: 200px;
}

.sidebar img:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

.sidebar .nav-link {
    color: rgba(255,255,255,1); /* Opacité à 1 pour meilleure lisibilité */
    padding: 12px 20px;
    border-radius: 8px;
    margin: 4px 0;
    transition: all 0.3s ease;
    font-weight: 500;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: white !important;
    background-color: rgba(255,255,255,0.15);
    transform: translateX(3px);
    border-left: 3px solid white;
    font-weight: 600;
}

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

.topbar {
    background: var(--bg-card);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 2000;
}

.main-content {
    background-color: var(--light-color);
    min-height: 100vh;
    padding: 20px;
}

.card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    background: var(--bg-card);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    border-color: var(--primary-light);
}

.stat-card {
    background: var(--primary-dark);
    color: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

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

.stat-card .stat-label {
    opacity: 1; /* Opacité à 1 pour meilleure lisibilité */
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255,255,255,1);
}

.btn-primary {
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(71, 85, 105, 0.25);
    color: white;
}

.table {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.table thead th {
    background-color: var(--bg-hover);
    border: none;
    font-weight: 700;
    color: var(--text-primary) !important;
    padding: 15px;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.table tbody td {
    border: none;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary) !important;
    font-weight: 500;
}

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

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

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

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

.badge-warning {
    background-color: var(--warning-color);
    color: white;
}

.badge-info {
    background-color: var(--info-color);
    color: white;
}

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

/* Styles supplémentaires pour le thème sobre */
.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

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

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

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

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

.alert-primary {
    background-color: rgba(71, 85, 105, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-dark);
}

.progress-bar {
    background-color: var(--primary-color);
}

.pagination .page-link {
    color: var(--primary-color);
    border-color: var(--border-color);
}

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

.pagination .page-link:hover {
    color: var(--primary-dark);
    background-color: var(--bg-hover);
    border-color: var(--primary-light);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.nav-link {
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* ===== 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;
    }

    /* Améliorer les colonnes sur tablette - certaines colonnes peuvent rester côte à côte */
    .col-md-6 {
        flex: 0 0 auto;
        width: 50%;
    }

    .col-md-4 {
        flex: 0 0 auto;
        width: 33.33333333%;
    }

    .col-md-3 {
        flex: 0 0 auto;
        width: 50%;
    }

    /* Améliorer les tableaux sur tablette */
    .table-responsive {
        overflow-x: auto;
    }

    /* Améliorer les modals sur tablette */
    .modal-dialog {
        max-width: 90%;
        margin: 1rem auto;
    }

    /* Améliorer les groupes de boutons */
    .btn-group {
        flex-wrap: nowrap;
    }
}

/* 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;
    }

    /* Améliorer les colonnes sur petits écrans desktop */
    .col-lg-6 {
        flex: 0 0 auto;
        width: 50%;
    }

    .col-lg-4 {
        flex: 0 0 auto;
        width: 33.33333333%;
    }

    .col-lg-3 {
        flex: 0 0 auto;
        width: 25%;
    }

    /* Améliorer les tableaux */
    .table {
        font-size: 0.95rem;
    }

    /* Améliorer les modals */
    .modal-dialog {
        max-width: 600px;
    }
}

/* 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;
    }

    /* Améliorer les colonnes sur grands écrans */
    .col-xl-6 {
        flex: 0 0 auto;
        width: 50%;
    }

    .col-xl-4 {
        flex: 0 0 auto;
        width: 33.33333333%;
    }

    .col-xl-3 {
        flex: 0 0 auto;
        width: 25%;
    }
}

/* Amélioration de la lisibilité des formulaires */
.form-label {
    color: var(--text-primary) !important;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-control, .form-select {
    color: var(--text-primary) !important;
    font-weight: 500;
    border-color: var(--border-color);
}

.form-control:focus, .form-select:focus {
    color: var(--text-primary) !important;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(71, 85, 105, 0.25);
}

.form-control::placeholder {
    color: var(--text-secondary);
    opacity: 0.8;
}

/* Amélioration de la lisibilité des cartes */
.card-title, .card-header h5, .card-header h6 {
    color: var(--text-primary) !important;
    font-weight: 700;
}

.card-text, .card-body p, .card-body span {
    color: var(--text-primary) !important;
    font-weight: 500;
}

.card-body {
    color: var(--text-primary) !important;
}

/* Amélioration de la lisibilité des alertes */
.alert {
    font-weight: 500;
}

.alert-success {
    color: #065f46 !important;
    background-color: #d1fae5;
    border-color: #059669;
}

.alert-danger {
    color: #991b1b !important;
    background-color: #fee2e2;
    border-color: #dc2626;
}

.alert-warning {
    color: #92400e !important;
    background-color: #fef3c7;
    border-color: #d97706;
}

.alert-info {
    color: #075985 !important;
    background-color: #e0f2fe;
    border-color: #0284c7;
}

/* Amélioration de la lisibilité des breadcrumbs */
.breadcrumb-item a {
    color: var(--primary-color) !important;
    font-weight: 500;
    text-decoration: none;
}

.breadcrumb-item.active {
    color: var(--text-primary) !important;
    font-weight: 600;
}

/* Amélioration de la lisibilité des petits textes */
small, .small {
    color: var(--text-secondary) !important;
    font-weight: 500;
    font-size: 0.875rem;
}

/* Amélioration de la lisibilité des liens */
a:not(.btn):not(.nav-link):not(.dropdown-item) {
    color: var(--primary-color) !important;
    font-weight: 500;
    text-decoration: none;
}

a:not(.btn):not(.nav-link):not(.dropdown-item):hover {
    color: var(--primary-dark) !important;
    font-weight: 600;
}

/* Amélioration de la lisibilité des titres */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary) !important;
    font-weight: 700;
    line-height: 1.2;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

/* Règles supplémentaires pour garantir la lisibilité */
.text-white {
    color: #ffffff !important;
    font-weight: 500;
}

.text-dark {
    color: var(--text-primary) !important;
    font-weight: 600;
}

.text-primary {
    color: var(--primary-color) !important;
    font-weight: 600;
}

/* Amélioration de la lisibilité dans les dropdowns */
.dropdown-menu {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color);
    z-index: 1050;
}

.dropdown-item {
    color: var(--text-primary) !important;
    font-weight: 500;
}

.dropdown-item:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary) !important;
    font-weight: 600;
}

.dropdown-header {
    color: var(--text-primary) !important;
    font-weight: 700;
}

/* Amélioration de la lisibilité dans les modals */
.modal-header {
    background-color: var(--primary-color);
    color: white;
}

.modal-title {
    color: white !important;
    font-weight: 700;
}

.modal-body {
    color: var(--text-primary) !important;
}

.modal-body label {
    color: var(--text-primary) !important;
    font-weight: 600;
}

/* Amélioration de la lisibilité dans les tooltips */
.tooltip .tooltip-inner {
    background-color: var(--dark-color);
    color: white;
    font-weight: 500;
}

/* Amélioration de la lisibilité dans les popovers */
.popover {
    background-color: var(--bg-card);
    border-color: var(--border-color);
}

.popover-header {
    background-color: var(--bg-hover);
    color: var(--text-primary) !important;
    font-weight: 700;
}

.popover-body {
    color: var(--text-primary) !important;
    font-weight: 500;
}

/* Améliorations supplémentaires pour la responsivité */
/* Forcer l'empilement vertical sur très petits écrans */
@media (max-width: 576px) {
    /* Toutes les colonnes s'empilent sur très petits écrans */
    [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Améliorer les headers avec actions */
    .d-flex.justify-content-between.align-items-center {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }

    .d-flex.justify-content-between.align-items-center > * {
        width: 100%;
    }

    /* Améliorer les boutons dans les headers */
    .d-flex.gap-2 {
        flex-direction: column;
        width: 100%;
    }

    .d-flex.gap-2 > * {
        width: 100%;
    }

    /* Améliorer les descriptions list */
    dl.row {
        margin: 0;
    }

    dl.row dt,
    dl.row dd {
        padding-left: 0;
        padding-right: 0;
        margin-bottom: 0.5rem;
    }

    dl.row dt {
        font-weight: 600;
        margin-bottom: 0.25rem;
    }

    /* Améliorer les tableaux avec beaucoup de colonnes */
    .table th,
    .table td {
        white-space: nowrap;
        font-size: 0.8rem;
    }

    /* Améliorer les cards avec plusieurs colonnes */
    .row.g-3 > [class*="col-"],
    .row.g-4 > [class*="col-"] {
        margin-bottom: 1rem;
    }

    /* Améliorer les modals */
    .modal-dialog {
        margin: 0.25rem;
        max-width: calc(100% - 0.5rem);
    }

    .modal-body {
        padding: 1rem;
    }

    /* Améliorer les formulaires dans les modals */
    .modal-body .row.g-3 > [class*="col-"],
    .modal-body .row.g-4 > [class*="col-"] {
        margin-bottom: 0.75rem;
    }

    /* Améliorer les stats cards */
    .row.g-3 .col-md-3,
    .row.g-3 .col-lg-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Améliorer les breadcrumbs */
    .breadcrumb {
        font-size: 0.7rem;
        margin-bottom: 0.5rem;
    }

    /* Améliorer les titres */
    h1, .h1 {
        font-size: 1.25rem;
        line-height: 1.3;
    }

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

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

    /* Améliorer les badges dans les tableaux */
    .table .badge {
        display: block;
        width: fit-content;
        margin: 0.25rem 0;
    }

    /* Améliorer les actions dans les tableaux */
    .table .btn-group {
        flex-direction: column;
        width: 100%;
    }

    .table .btn-group .btn {
        width: 100%;
        margin-bottom: 0.25rem;
    }

    /* Améliorer les dropdowns */
    .dropdown-menu {
        max-width: calc(100vw - 1rem);
        left: auto !important;
        right: 0.5rem !important;
    }

    /* Améliorer les alertes */
    .alert {
        font-size: 0.8rem;
        padding: 0.75rem;
    }

    /* Améliorer les inputs groups */
    .input-group {
        flex-direction: column;
    }

    .input-group > .form-control,
    .input-group > .form-select,
    .input-group > .btn {
        border-radius: 0.375rem;
        margin-bottom: 0.5rem;
    }

    .input-group > .form-control:first-child,
    .input-group > .form-select:first-child {
        border-top-right-radius: 0.375rem;
        border-bottom-right-radius: 0.375rem;
    }

    .input-group > .input-group-text {
        border-radius: 0.375rem;
        margin-bottom: 0.5rem;
    }

}

/* Améliorations pour les écrans moyens (tablettes en mode portrait) */
@media (min-width: 577px) and (max-width: 768px) {
    /* Améliorer les descriptions list */
    dl.row dt {
        margin-bottom: 0.5rem;
    }

    dl.row dd {
        margin-bottom: 1rem;
    }

    /* Améliorer les tableaux */
    .table th,
    .table td {
        padding: 0.5rem 0.5rem;
        font-size: 0.875rem;
    }

    /* Améliorer les modals */
    .modal-dialog {
        max-width: 85%;
    }
}

/* 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;
    }
}

/* ===== AMÉLIORATIONS RESPONSIVE COMPLÈTES ===== */

/* Amélioration de la sidebar pour toutes les tailles */
@media (max-width: 991.98px) {
    .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;
        width: 100% !important;
    }
}

/* Amélioration du topbar pour mobile/tablette */
@media (max-width: 991.98px) {
    .topbar {
        padding: 10px 15px !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 1030 !important;
    }

    .topbar h1 {
        font-size: 1.1rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar .container-fluid {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .topbar .dropdown-menu {
        max-width: calc(100vw - 20px) !important;
        right: 0 !important;
        left: auto !important;
    }
}

/* Amélioration des tables pour mobile - meilleur scroll */
@media (max-width: 767.98px) {
    .table-responsive {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        -ms-overflow-style: -ms-autohiding-scrollbar !important;
        position: relative !important;
    }

    .table-responsive::before {
        content: '← Faites glisser →';
        position: absolute;
        top: 10px;
        right: 10px;
        background: rgba(0, 0, 0, 0.7);
        color: white;
        padding: 5px 10px;
        border-radius: 4px;
        font-size: 0.75rem;
        z-index: 10;
        pointer-events: none;
        opacity: 0;
        animation: fadeInOut 3s ease-in-out;
    }

    @keyframes fadeInOut {
        0%, 100% { opacity: 0; }
        10%, 90% { opacity: 1; }
    }

    .table {
        font-size: 0.85rem !important;
        min-width: 600px !important;
        margin-bottom: 0 !important;
    }

    .table thead th {
        padding: 10px 8px !important;
        font-size: 0.8rem !important;
        white-space: nowrap !important;
        background-color: var(--primary-dark) !important;
        color: white !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 5 !important;
    }

    .table tbody td {
        padding: 10px 8px !important;
        white-space: nowrap !important;
        vertical-align: middle !important;
    }

    /* Améliorer les actions dans les tables */
    .table .btn-group {
        flex-direction: column !important;
        gap: 5px !important;
    }

    .table .btn-sm {
        width: 100% !important;
        padding: 6px 10px !important;
    }
}

/* Amélioration des formulaires pour mobile/tablette */
@media (max-width: 767.98px) {
    .form-control,
    .form-select {
        font-size: 16px !important; /* Évite le zoom automatique sur iOS */
        padding: 12px 15px !important;
        min-height: 44px !important; /* Taille minimale pour le tactile */
        border-radius: 8px !important;
    }

    .form-label {
        font-size: 0.95rem !important;
        font-weight: 500 !important;
        margin-bottom: 8px !important;
    }

    .input-group {
        flex-wrap: wrap !important;
        margin-bottom: 15px !important;
    }

    .input-group-text {
        font-size: 0.9rem !important;
        padding: 12px 15px !important;
        min-height: 44px !important;
        width: 100% !important;
        border-radius: 8px 8px 0 0 !important;
    }

    .input-group .form-control,
    .input-group .form-select {
        border-radius: 0 0 8px 8px !important;
        width: 100% !important;
    }

    .input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
        margin-left: 0 !important;
        border-left: 1px solid var(--border-color) !important;
    }

    /* Améliorer les checkboxes et radios pour le tactile */
    .form-check-input {
        width: 20px !important;
        height: 20px !important;
        margin-top: 0.25rem !important;
    }

    .form-check-label {
        font-size: 0.95rem !important;
        padding-left: 8px !important;
    }
}

/* Amélioration des cards pour mobile/tablette */
@media (max-width: 767.98px) {
    .card {
        margin-bottom: 15px !important;
        border-radius: 12px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    }

    .card-header {
        padding: 15px !important;
        font-size: 0.95rem !important;
    }

    .card-body {
        padding: 15px !important;
    }

    .card-footer {
        padding: 15px !important;
    }

    .stat-card {
        padding: 15px !important;
        margin-bottom: 15px !important;
    }

    .stat-card .stat-value {
        font-size: 1.75rem !important;
    }

    .stat-card .stat-label {
        font-size: 0.85rem !important;
    }
}

/* Amélioration des boutons pour mobile/tablette/POS */
@media (max-width: 991.98px) {
    .btn {
        min-height: 44px !important; /* Taille minimale recommandée pour le tactile */
        padding: 10px 18px !important;
        font-size: 0.95rem !important;
        border-radius: 8px !important;
        white-space: nowrap !important;
    }

    .btn-sm {
        min-height: 38px !important;
        padding: 8px 14px !important;
        font-size: 0.9rem !important;
    }

    .btn-lg {
        min-height: 50px !important;
        padding: 12px 24px !important;
        font-size: 1.1rem !important;
    }

    .btn-group {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .btn-group .btn {
        flex: 1 1 auto !important;
        min-width: 0 !important;
    }
}

/* Styles spécifiques pour écrans POS (tactiles, généralement 1024px-1920px) */
@media (min-width: 1024px) and (max-width: 1920px) and (hover: none) and (pointer: coarse) {
    /* Détection d'écran tactile */
    .btn {
        min-height: 48px !important;
        padding: 12px 20px !important;
        font-size: 1rem !important;
        border-radius: 10px !important;
    }

    .form-control,
    .form-select {
        min-height: 48px !important;
        padding: 14px 18px !important;
        font-size: 1rem !important;
    }

    .table tbody td {
        padding: 15px 12px !important;
        font-size: 0.95rem !important;
    }

    .card {
        border-radius: 12px !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
    }

    .sidebar {
        width: 260px !important;
    }

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

    .main-content {
        padding: 25px !important;
    }
}

/* Amélioration pour tablettes (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .sidebar {
        width: 240px !important;
    }

    .main-content {
        padding: 20px !important;
    }

    .card {
        margin-bottom: 20px !important;
    }

    .table {
        font-size: 0.9rem !important;
    }

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

    /* Layout en 2 colonnes pour les stats sur tablette */
    .row .col-md-4 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }

    .row .col-md-3 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }

    .row .col-md-6 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}

/* Amélioration pour petits écrans mobiles (< 576px) */
@media (max-width: 575.98px) {
    .main-content {
        padding: 10px !important;
    }

    .card {
        margin-bottom: 10px !important;
        border-radius: 10px !important;
    }

    .card-body {
        padding: 12px !important;
    }

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

    h1, .h1 {
        font-size: 1.3rem !important;
    }

    h2, .h2 {
        font-size: 1.15rem !important;
    }

    h3, .h3 {
        font-size: 1rem !important;
    }

    h4, .h4 {
        font-size: 0.95rem !important;
    }

    /* Forcer l'empilement vertical sur très petits écrans */
    .row > * {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    /* Améliorer les modals sur très petits écrans */
    .modal-dialog {
        margin: 5px !important;
        max-width: calc(100% - 10px) !important;
    }

    .modal-content {
        border-radius: 10px !important;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 15px !important;
    }

    /* Améliorer les dropdowns */
    .dropdown-menu {
        max-width: calc(100vw - 20px) !important;
        font-size: 0.9rem !important;
    }

    .dropdown-item {
        padding: 12px 15px !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
    }
}

/* Amélioration spécifique pour la page POS */
@media (max-width: 991.98px) {
    /* Layout POS sur mobile/tablette */
    .pos-layout .col-lg-8,
    .pos-layout .col-lg-4 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-bottom: 20px !important;
    }

    /* Produits grid sur mobile */
    .produits-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .produit-card {
        padding: 12px !important;
        min-height: 120px !important;
    }

    .produit-card .btn {
        width: 100% !important;
        margin-top: 8px !important;
    }

    .produit-nom {
        -webkit-line-clamp: 2 !important;
        font-size: 0.9rem !important;
    }
}

/* Amélioration pour écrans POS tactiles */
@media (min-width: 1024px) and (hover: none) and (pointer: coarse) {
    .pos-layout {
        padding: 20px !important;
    }

    .produits-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 15px !important;
    }

    .produit-card {
        padding: 20px !important;
        min-height: 150px !important;
        cursor: pointer !important;
        transition: transform 0.2s ease, box-shadow 0.2s ease !important;
        border: 2px solid transparent !important;
    }

    .produit-card:hover {
        border-color: var(--primary-color) !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    }

    .produit-card:active {
        transform: scale(0.98) !important;
    }

    .btn-pos {
        min-height: 60px !important;
        font-size: 1.1rem !important;
        padding: 15px 25px !important;
        border-radius: 10px !important;
    }

    .pos-layout .form-control,
    .pos-layout .form-select {
        min-height: 50px !important;
        font-size: 1.05rem !important;
        padding: 14px 18px !important;
    }

    .pos-layout .btn {
        min-height: 50px !important;
        font-size: 1.05rem !important;
        padding: 12px 20px !important;
    }
}

/* Styles spécifiques pour les cartes produits en liste verticale */
.produit-card {
    transition: all 0.2s ease !important;
    border: 1px solid var(--border-color) !important;
    width: 100% !important;
}

.produit-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
    border-color: var(--primary-color) !important;
}

.produit-card .card-body {
    padding: 1rem !important;
}

.produit-card .card-title {
    font-size: 1rem !important;
    font-weight: 600 !important;
    margin-bottom: 0.5rem !important;
}

.produit-card .text-success {
    font-size: 1rem !important;
    font-weight: 600 !important;
}

.produit-card .text-muted {
    font-size: 0.875rem !important;
}

@media (hover: none) and (pointer: coarse) {
    .produit-card:active {
        transform: scale(0.97) !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
    }
}

/* Amélioration des alertes pour mobile */
@media (max-width: 767.98px) {
    .alert {
        padding: 12px 15px !important;
        margin-bottom: 15px !important;
        border-radius: 8px !important;
        font-size: 0.9rem !important;
    }

    .alert-dismissible .btn-close {
        padding: 0.75rem !important;
    }
}

/* Amélioration de la pagination pour mobile */
@media (max-width: 767.98px) {
    .pagination {
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 5px !important;
    }

    .page-link {
        padding: 8px 12px !important;
        font-size: 0.9rem !important;
        min-height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}

/* Amélioration des badges pour mobile */
@media (max-width: 767.98px) {
    .badge {
        font-size: 0.8rem !important;
        padding: 5px 10px !important;
    }
}

/* Amélioration des breadcrumbs pour mobile */
@media (max-width: 767.98px) {
    .breadcrumb {
        font-size: 0.85rem !important;
        padding: 10px 0 !important;
        flex-wrap: wrap !important;
    }

    .breadcrumb-item {
        padding: 0 5px !important;
    }
}

/* Amélioration des listes pour mobile */
@media (max-width: 767.98px) {
    .list-group-item {
        padding: 12px 15px !important;
        font-size: 0.9rem !important;
    }
}

/* Amélioration des descriptions list pour mobile */
@media (max-width: 767.98px) {
    dl.row dt {
        margin-bottom: 0.5rem !important;
        font-size: 0.9rem !important;
    }

    dl.row dd {
        margin-bottom: 1rem !important;
        font-size: 0.9rem !important;
    }
}

/* Amélioration des tooltips et popovers pour mobile */
@media (max-width: 767.98px) {
    .tooltip,
    .popover {
        font-size: 0.85rem !important;
    }
}

/* Amélioration des progress bars pour mobile */
@media (max-width: 767.98px) {
    .progress {
        height: 8px !important;
    }

    .progress-bar {
        font-size: 0.75rem !important;
    }
}

/* Amélioration des spinners pour mobile */
@media (max-width: 767.98px) {
    .spinner-border,
    .spinner-grow {
        width: 1.5rem !important;
        height: 1.5rem !important;
    }
}

/* Amélioration des toasts pour mobile */
@media (max-width: 767.98px) {
    .toast {
        max-width: calc(100vw - 20px) !important;
        margin: 10px !important;
    }
}

/* Amélioration des offcanvas pour mobile */
@media (max-width: 767.98px) {
    .offcanvas {
        max-width: 85% !important;
    }
}

/* Amélioration générale pour éviter le zoom sur iOS */
@media (max-width: 767.98px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    input[type="url"],
    input[type="search"],
    textarea,
    select {
        font-size: 16px !important; /* Évite le zoom automatique sur iOS */
    }
}

/* Amélioration pour les écrans très larges (desktop) */
@media (min-width: 1400px) {
    .container-fluid {
        max-width: 1400px !important;
        margin: 0 auto !important;
    }

    .main-content {
        padding: 30px !important;
    }
}

/* Amélioration de l'accessibilité tactile */
@media (hover: none) and (pointer: coarse) {
    /* Pour tous les écrans tactiles */
    a, button, .btn, .nav-link, .dropdown-item, .list-group-item {
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
    }

    .form-check-input {
        width: 24px !important;
        height: 24px !important;
    }

    .form-check-label {
        padding-left: 10px !important;
    }
}

