/**
 * Styles pour les pages de boutique
 * Design moderne et professionnel
 * 
 * @package UMOA
 * @version 2.0
 */

/* ============================================================================
   CONTAINER PRINCIPAL
   ============================================================================ */

.shop-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-6) var(--spacing-4);
    background: var(--gray-50);
    min-height: calc(100vh - 200px);
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* ============================================================================
   EN-TÊTE DE LA BOUTIQUE
   ============================================================================ */

.shop-header {
    background: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: var(--spacing-6);
    position: relative;
}

.shop-cover {
    width: 100%;
    height: 300px;
    background: #7B2CBF; /* Violet UMOA - couleur unie */
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shop-cover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.1) 100%);
    z-index: 1;
    pointer-events: none;
}

.shop-cover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(107, 182, 255, 0.85) 0%, rgba(30, 58, 138, 0.85) 100%);
    z-index: 1;
    opacity: 0;
    transition: opacity var(--duration-normal);
}

.shop-cover:hover::before {
    opacity: 1;
}

.shop-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 0;
    transition: transform var(--duration-slow);
}

.shop-cover:hover img {
    transform: scale(1.05);
}

.shop-info {
    padding: var(--spacing-8) var(--spacing-6);
    position: relative;
    display: flex;
    gap: var(--spacing-6);
    flex-wrap: wrap;
    align-items: flex-start;
}

.shop-logo-container {
    position: relative;
    flex-shrink: 0;
}

.shop-logo {
    width: 140px;
    height: 140px;
    border-radius: var(--radius-xl);
    object-fit: cover;
    border: 5px solid var(--white);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    background: var(--white);
    position: relative;
    z-index: 2;
    margin-top: -70px;
    transition: transform var(--duration-normal) var(--curve-ease-out);
}

.shop-logo:hover {
    transform: scale(1.05);
}

.verified-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: var(--success-color);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: 18px;
    border: 3px solid var(--white);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    z-index: 3;
}

.shop-details {
    flex: 1;
    min-width: 300px;
}

.shop-details h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--spacing-3);
    line-height: 1.2;
}

.shop-rating {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    margin-bottom: var(--spacing-4);
    flex-wrap: wrap;
}

.stars {
    display: flex;
    gap: 4px;
}

.star {
    font-size: 1.5rem;
    color: var(--gray-300);
    transition: color var(--duration-fast);
}

.star.filled {
    color: #FFB800;
    text-shadow: 0 2px 4px rgba(255, 184, 0, 0.3);
}

.rating-text {
    font-size: 1rem;
    color: var(--gray-600);
    font-weight: 500;
}

.shop-description {
    font-size: 1.1rem;
    color: var(--gray-700);
    line-height: 1.7;
    margin-bottom: var(--spacing-5);
    max-width: 800px;
}

.shop-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-4);
    margin-bottom: var(--spacing-5);
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2);
    padding: var(--spacing-2) var(--spacing-4);
    background: var(--gray-100);
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: all var(--duration-normal);
}

.meta-item:hover {
    background: var(--blue-light);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 182, 255, 0.3);
}

.shop-stats {
    display: flex;
    gap: var(--spacing-6);
    margin-bottom: var(--spacing-5);
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    padding: var(--spacing-4) var(--spacing-6);
    background: linear-gradient(135deg, var(--blue-light) 0%, var(--blue-medium) 100%);
    border-radius: var(--radius-md);
    color: var(--white);
    min-width: 120px;
    box-shadow: 0 4px 12px rgba(107, 182, 255, 0.25);
    transition: transform var(--duration-normal);
}

.stat-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(107, 182, 255, 0.35);
}

.stat-item strong {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: var(--spacing-1);
}

.stat-item span {
    font-size: 0.9rem;
    opacity: 0.95;
    font-weight: 500;
}

.shop-actions {
    display: flex;
    gap: var(--spacing-3);
    flex-wrap: wrap;
    margin-top: var(--spacing-4);
}

.shop-actions .btn {
    padding: var(--spacing-3) var(--spacing-6);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    transition: all var(--duration-normal);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2);
    text-decoration: none;
}

.shop-actions .btn-primary {
    background: #7B2CBF; /* Violet UMOA - couleur unie */
    color: var(--white);
    box-shadow: 0 4px 12px rgba(107, 182, 255, 0.3);
}

.shop-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 182, 255, 0.4);
}

.shop-actions .btn-secondary {
    background: var(--white);
    color: var(--blue-medium);
    border: 2px solid var(--blue-medium);
}

.shop-actions .btn-secondary:hover {
    background: var(--blue-medium);
    color: var(--white);
    transform: translateY(-2px);
}

.shop-actions .btn-outline {
    background: transparent;
    color: var(--gray-700);
    border: 2px solid var(--gray-300);
}

.shop-actions .btn-outline:hover {
    border-color: var(--blue-medium);
    color: var(--blue-medium);
    background: var(--gray-50);
}

/* ============================================================================
   NAVIGATION PAR ONGLETS
   ============================================================================ */

.shop-tabs {
    display: flex;
    gap: var(--spacing-2);
    background: var(--white);
    padding: var(--spacing-2);
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: var(--spacing-6);
    overflow-x: auto;
    scrollbar-width: none;
}

.shop-tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    padding: var(--spacing-3) var(--spacing-6);
    border: none;
    background: transparent;
    color: var(--gray-600);
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-normal);
    white-space: nowrap;
    position: relative;
}

.tab-btn:hover {
    color: var(--blue-medium);
    background: var(--gray-50);
}

.tab-btn.active {
    color: var(--blue-medium);
    background: linear-gradient(135deg, rgba(107, 182, 255, 0.1) 0%, rgba(74, 144, 226, 0.1) 100%);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 3px;
    background: #7B2CBF; /* Violet UMOA - couleur unie */
    border-radius: var(--radius-full);
}

/* ============================================================================
   CONTENU DES ONGLETS
   ============================================================================ */

.shop-content {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--spacing-6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.tab-content {
    display: none;
    animation: fadeIn var(--duration-normal) var(--curve-ease-out);
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================================
   GRILLE DE PRODUITS
   ============================================================================ */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-5);
    margin-top: var(--spacing-4);
}

.product-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all var(--duration-normal);
    border: 1px solid var(--gray-200);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0; /* Permet au flex de répartir l'espace sans couper le contenu */
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    border-color: var(--blue-light);
}

.product-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
    overflow: hidden;
    background: var(--gray-100);
    flex-shrink: 0;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-slow);
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-badge {
    position: absolute;
    top: var(--spacing-3);
    right: var(--spacing-3);
    padding: var(--spacing-1) var(--spacing-3);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 1;
}

.badge-new {
    background: var(--success-color);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.product-info {
    padding: var(--spacing-4);
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    justify-content: space-between;
    min-height: 0;
    overflow: visible;
    width: 100%;
    box-sizing: border-box;
}

.product-info h3 {
    font-size: 0.875rem; /* 14px Desktop */
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--spacing-2);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
    min-height: 2.8em; /* Réserve l'espace pour 2 lignes */
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--blue-medium);
    margin-bottom: var(--spacing-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
}

.product-location {
    font-size: 0.9rem;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    gap: var(--spacing-1);
    flex-wrap: wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    min-height: 1.5em;
    flex-shrink: 0;
}

/* ============================================================================
   LISTE DES AVIS
   ============================================================================ */

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-4);
    margin-top: var(--spacing-4);
}

.review-card {
    padding: var(--spacing-5);
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    transition: all var(--duration-normal);
}

.review-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateX(4px);
}

.review-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-4);
    margin-bottom: var(--spacing-3);
}

.review-header .avatar {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 3px solid var(--white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.review-author {
    flex: 1;
}

.review-author h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--spacing-1);
}

.review-rating {
    display: flex;
    gap: 2px;
}

.review-rating .star {
    font-size: 1rem;
}

.review-date {
    font-size: 0.9rem;
    color: var(--gray-500);
}

.review-comment {
    font-size: 1rem;
    color: var(--gray-700);
    line-height: 1.6;
    padding-left: calc(56px + var(--spacing-4));
}

/* ============================================================================
   SECTION À PROPOS
   ============================================================================ */

.about-card {
    padding: var(--spacing-6);
    background: var(--gray-50);
    border-radius: var(--radius-lg);
}

.about-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--spacing-5);
    padding-bottom: var(--spacing-3);
    border-bottom: 2px solid var(--gray-200);
}

.info-list {
    display: grid;
    gap: var(--spacing-4);
}

.info-list dt {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.95rem;
    margin-bottom: var(--spacing-1);
}

.info-list dd {
    color: var(--gray-900);
    font-size: 1rem;
    padding: var(--spacing-2) var(--spacing-4);
    background: var(--white);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--blue-medium);
}

/* ============================================================================
   ÉTAT VIDE
   ============================================================================ */

.empty-state {
    text-align: center;
    padding: var(--spacing-16) var(--spacing-6);
    color: var(--gray-500);
}

.empty-state p {
    font-size: 1.1rem;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

/* ============================================================================
   DESKTOP OPTIMIZATIONS - Images produits avec ratio et contraintes
   ============================================================================ */

@media (min-width: 1024px) {
    /* Images produits - Respect du ratio et contraintes desktop */
    .product-image {
        aspect-ratio: 1 / 1; /* Force le ratio carré */
        max-height: 400px; /* Limite la hauteur maximale sur desktop */
        max-width: 400px; /* Limite aussi la largeur pour maintenir le ratio */
        width: 100%;
    }
    
    /* S'assurer que les images dans les conteneurs produits respectent le ratio */
    .product-image img {
        width: 100%;
        height: 100%;
        object-fit: cover; /* Remplit le cadre sans déformation */
        object-position: center; /* Centre l'image si elle est plus petite */
    }
    
    /* Cartes produits - Contraintes de taille sur desktop */
    .product-card {
        max-width: 400px; /* Largeur maximale fixe sur desktop */
    }
    
    /* Réduire l'effet de zoom au survol sur desktop */
    .product-card:hover .product-image img {
        transform: scale(1.05); /* Effet modéré sur desktop */
    }
}

@media (max-width: 768px) {
    .shop-container {
        padding: var(--spacing-4) var(--spacing-3);
        max-width: 100vw;
    }
    
    .shop-content {
        padding: var(--spacing-4);
        max-width: 100%;
    }
    
    .shop-cover {
        height: 200px;
    }
    
    .shop-logo {
        width: 100px;
        height: 100px;
        margin-top: -50px;
    }
    
    .shop-details h1 {
        font-size: 1.8rem;
    }
    
    .shop-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .shop-details {
        text-align: center;
    }
    
    .shop-stats {
        justify-content: center;
    }
    
    /* Une colonne sur mobile pour éviter le débordement (override des règles globales) */
    .shop-container .products-grid,
    .shop-content .products-grid {
        grid-template-columns: 1fr !important;
        gap: var(--spacing-3);
        width: 100%;
        max-width: 100%;
    }
    
    .shop-container .product-card,
    .shop-content .product-card {
        max-width: 100% !important;
        width: 100%;
        min-width: 0;
        max-height: none; /* Ne pas couper le contenu sur mobile */
    }
    
    .product-image {
        height: 180px;
        min-height: 180px;
    }
    
    .shop-container .product-info,
    .shop-content .product-info {
        min-height: 90px; /* Garantir la place pour titre + prix + localisation */
        padding: var(--spacing-3);
        overflow: visible;
    }
    
    .product-info h3 {
        font-size: 0.8125rem; /* 13px Mobile - lisible */
        min-height: 2.6em;
        word-wrap: break-word;
        overflow-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
    }
    
    .shop-container .product-price,
    .shop-content .product-price {
        font-size: 1.25rem;
    }
    
    .shop-container .product-location,
    .shop-content .product-location {
        font-size: 0.8125rem;
    }
    
    .review-comment {
        padding-left: 0;
        margin-top: var(--spacing-3);
    }
}

@media (max-width: 480px) {
    .shop-actions {
        flex-direction: column;
    }
    
    .shop-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .shop-container .products-grid,
    .shop-content .products-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================================================
   SECTION COMMANDES
   ============================================================================ */

/* Header de l'onglet commandes */
.orders-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-6);
    padding: var(--spacing-5);
    background: #7B2CBF; /* Violet UMOA - couleur unie */
    border-radius: var(--radius-xl);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.2);
}

.orders-header-content h2 {
    color: var(--white);
    margin: 0 0 var(--spacing-1) 0;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.orders-header-subtitle {
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 400;
}

.orders-header .btn-primary {
    background: var(--white);
    color: var(--primary);
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.orders-header .btn-primary:hover {
    background: var(--gray-50);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Statistiques des commandes */
.orders-stats-container {
    margin-bottom: var(--spacing-6);
}

.orders-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--spacing-3);
    margin-bottom: var(--spacing-4);
}

.stat-card {
    background: var(--white);
    padding: var(--spacing-3);
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform var(--duration-fast), box-shadow var(--duration-fast);
    border-top: 3px solid transparent;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}


/* Carte Total */
.stat-card.stat-total {
    background: #7B2CBF; /* Violet UMOA - couleur unie */
    color: var(--white);
    border-top-color: #8b5cf6;
}


/* Carte Chiffre d'affaires */
.stat-card.stat-revenue {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: var(--white);
    border-top-color: #34d399;
}


/* Carte En attente */
.stat-card.stat-pending {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: var(--white);
    border-top-color: #fbbf24;
}


/* Carte En préparation */
.stat-card.stat-preparing {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: var(--white);
    border-top-color: #60a5fa;
}


/* Carte En livraison */
.stat-card.stat-delivering {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    color: var(--white);
    border-top-color: #f472b6;
}

.stat-card.stat-delivering .stat-value,
.stat-card.stat-delivering .stat-label {
    color: var(--white);
}

.stat-icon {
    display: block;
    font-size: 1.5rem;
    margin-bottom: var(--spacing-1);
    opacity: 0.9;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
    line-height: 1;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: var(--spacing-1);
    line-height: 1.2;
}

.stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 600;
    margin-top: 0;
    line-height: 1.2;
}

.stat-card.stat-total .stat-value,
.stat-card.stat-total .stat-label,
.stat-card.stat-revenue .stat-value,
.stat-card.stat-revenue .stat-label,
.stat-card.stat-revenue .stat-currency,
.stat-card.stat-pending .stat-value,
.stat-card.stat-pending .stat-label,
.stat-card.stat-preparing .stat-value,
.stat-card.stat-preparing .stat-label,
.stat-card.stat-delivering .stat-value,
.stat-card.stat-delivering .stat-label {
    color: var(--white);
}

.stat-currency {
    display: block;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 2px;
    font-weight: 500;
    line-height: 1;
}

.orders-status-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-2);
    margin-top: var(--spacing-4);
    padding: var(--spacing-3);
    background: var(--gray-50);
    border-radius: var(--radius-lg);
}

.status-badge-count {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-2) var(--spacing-3);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    cursor: pointer;
    transition: transform var(--duration-fast), box-shadow var(--duration-fast);
    background: var(--gray-100);
    color: var(--gray-700);
}

.status-badge-count:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.status-badge-count.status-draft {
    background: #e5e7eb;
    color: #6b7280;
}

.status-badge-count.status-pending_payment {
    background: #fef3c7;
    color: #92400e;
}

.status-badge-count.status-paid {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge-count.status-preparing {
    background: #d1fae5;
    color: #065f46;
}

.status-badge-count.status-delivering {
    background: #fce7f3;
    color: #9f1239;
}

.status-badge-count.status-delivered {
    background: #dcfce7;
    color: #166534;
}

.status-badge-count.status-completed {
    background: #86efac;
    color: #14532d;
}

.status-badge-count.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

/* Filtres avancés */
.order-filters-advanced {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    padding: var(--spacing-5);
    border-radius: var(--radius-xl);
    margin-bottom: var(--spacing-6);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--spacing-4);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
}

.filter-group label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-input,
.filter-select {
    padding: var(--spacing-3) var(--spacing-4);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    background: var(--white);
    transition: all var(--duration-fast);
    color: var(--gray-900);
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.08);
    transform: translateY(-1px);
}

.filter-input::placeholder {
    color: var(--gray-400);
}

/* Liste des commandes */
.orders-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-4);
}

.order-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: all var(--duration-normal);
    border: 1px solid rgba(0, 0, 0, 0.04);
    position: relative;
}

.order-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, #8b5cf6 100%);
    opacity: 0;
    transition: opacity var(--duration-normal);
}

.order-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: rgba(99, 102, 241, 0.2);
}

.order-card:hover::before {
    opacity: 1;
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: var(--spacing-5);
    border-bottom: 1px solid var(--gray-100);
    gap: var(--spacing-4);
    background: linear-gradient(135deg, #fafbfc 0%, #ffffff 100%);
    /* S'assurer que les éléments enfants sont correctement affichés */
    flex-wrap: nowrap;
    overflow: visible;
}

.order-header-left {
    display: flex;
    gap: var(--spacing-3);
    flex: 1;
    min-width: 0; /* Permet au contenu de se rétrécir si nécessaire */
    overflow: visible;
}

.order-header-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-1);
    min-width: 0;
    flex: 1;
}

.order-header-left > div {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-1);
    min-width: 0;
    flex: 1;
}

.order-buyer-avatar {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-full);
    object-fit: cover;
    flex-shrink: 0;
    border: 3px solid var(--white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.order-number {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
    padding: 0;
    letter-spacing: -0.3px;
    line-height: 1.4;
    display: block;
    /* S'assurer que le numéro de commande est bien affiché */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.order-buyer {
    color: var(--gray-600);
    margin: 0;
    padding: 0;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    flex-wrap: wrap;
    line-height: 1.5;
}

.order-buyer-name {
    display: inline-block;
    font-weight: 600;
    color: var(--gray-700);
}

.order-buyer strong {
    display: inline-block;
    font-weight: 600;
    color: var(--gray-700);
}

.order-items-count {
    display: inline-flex;
    align-items: center;
    margin-left: var(--spacing-2);
    padding: 4px 10px;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.order-status-badge {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-2) var(--spacing-4);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: transform var(--duration-fast);
    flex-shrink: 0;
    /* S'assurer que le badge est bien séparé du contenu */
    margin-left: auto;
}

.order-status-badge:hover {
    transform: scale(1.05);
}

.order-status-badge.status-draft {
    background: #e5e7eb;
    color: #6b7280;
}

.order-status-badge.status-pending_payment {
    background: #fef3c7;
    color: #92400e;
}

.order-status-badge.status-paid {
    background: #dbeafe;
    color: #1e40af;
}

.order-status-badge.status-preparing {
    background: #d1fae5;
    color: #065f46;
}

.order-status-badge.status-delivering {
    background: #fce7f3;
    color: #9f1239;
}

.order-status-badge.status-delivered {
    background: #dcfce7;
    color: #166534;
}

.order-status-badge.status-completed {
    background: #86efac;
    color: #14532d;
}

.order-status-badge.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.order-card-body {
    padding: var(--spacing-5);
    background: var(--white);
}

.order-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--spacing-4);
}

.order-info-item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
    padding: var(--spacing-3);
    background: var(--gray-50);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--primary);
}

.order-info-item.full-width {
    grid-column: 1 / -1;
}

.order-info-label {
    font-size: 0.6875rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

.order-info-value {
    font-size: 0.9375rem;
    color: var(--gray-900);
    font-weight: 600;
}

.order-total {
    font-size: 1.125rem;
    font-weight: 700;
    /* Couleur primaire - toujours visible */
    color: var(--primary, #3b82f6);
}

.order-card-actions {
    display: flex;
    gap: var(--spacing-3);
    padding: var(--spacing-5);
    border-top: 1px solid var(--gray-100);
    flex-wrap: wrap;
    background: var(--gray-50);
}

.order-card-actions .btn {
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all var(--duration-fast);
}

/* Bouton Payer - Style moderne et compact */
.order-card-actions .btn-primary {
    background: #7B2CBF; /* Violet UMOA - couleur unie */
    width: auto !important;
    min-width: fit-content;
    padding: 10px 20px;
    white-space: nowrap;
    flex-shrink: 0;
    flex: 0 0 auto;
    box-shadow: 0 2px 8px rgba(123, 44, 191, 0.3);
}

.order-card-actions .btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a4190 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(123, 44, 191, 0.4);
}

/* Boutons Outline - Style moderne et compact */
.order-card-actions .btn-outline {
    background: white;
    color: #7B2CBF;
    border: 2px solid #7B2CBF;
    width: auto !important;
    min-width: fit-content;
    padding: 10px 20px;
    white-space: nowrap;
    flex-shrink: 0;
    flex: 0 0 auto;
    box-shadow: 0 2px 6px rgba(123, 44, 191, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.order-card-actions .btn-outline:hover {
    background: #7B2CBF; /* Violet UMOA - couleur unie */
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(123, 44, 191, 0.35);
}

.order-card-actions .btn-outline:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(123, 44, 191, 0.25);
}

/* Bouton tracking spécifique */
.order-card-actions .tracking-btn {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    color: #495057;
    border: 2px solid #dee2e6;
}

.order-card-actions .tracking-btn:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #f8f9fa 100%);
    color: #212529;
    border-color: #adb5bd;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.order-card-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Pagination */
.orders-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--spacing-6);
    padding: var(--spacing-5);
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: var(--radius-xl);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.pagination-controls {
    display: flex;
    gap: var(--spacing-2);
}

.pagination-btn {
    padding: var(--spacing-2) var(--spacing-4);
    border: 2px solid var(--gray-200);
    background: var(--white);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all var(--duration-fast);
    color: var(--gray-700);
}

.pagination-btn:hover:not(.active) {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

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

/* Pagination produits - réutilise les mêmes styles que orders-pagination */
.products-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--spacing-6);
    padding: var(--spacing-5);
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: var(--radius-xl);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

/* Modal détails commande */
#order-details-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    /* Empêcher le décalage du header mobile */
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
}

#order-details-modal.active {
    display: block;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.order-details-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--white);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: min(800px, 90vw);
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
}

/* Styles mobiles pour la modal */
@media (max-width: 768px) {
    .order-details-content {
        width: 100% !important;
        max-width: 100vw !important;
        height: calc(100vh - calc(64px + env(safe-area-inset-bottom, 0px))) !important; /* Tient compte de la navbar bottom */
        max-height: calc(100vh - calc(64px + env(safe-area-inset-bottom, 0px))) !important; /* Tient compte de la navbar bottom */
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
        border-radius: 0 !important;
    }
    
    #order-details-modal {
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }
    
    /* S'assurer que le header mobile reste fixe */
    body.order-modal-open .navbar-mobile-top {
        position: sticky !important;
        top: 0 !important;
        z-index: 10000 !important;
        width: 100% !important;
        max-width: 100vw !important;
        left: 0 !important;
        right: 0 !important;
        transform: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    body.order-modal-open .mobile-top-container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 15px !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        overflow-x: hidden !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        position: relative !important;
        left: 0 !important;
        right: 0 !important;
        transform: none !important;
    }
    
    body.order-modal-open .mobile-menu-toggle {
        flex-shrink: 0 !important;
        min-width: 40px !important;
        max-width: 40px !important;
        width: 40px !important;
        height: 40px !important;
        padding: 0 !important;
        position: relative !important;
        left: 0 !important;
        transform: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
        overflow: visible !important;
    }
    
    body.order-modal-open .mobile-logo {
        flex: 1 !important;
        min-width: 0 !important;
        max-width: none !important;
        padding: 0 10px !important;
        position: relative !important;
        left: 0 !important;
        transform: none !important;
    }
    
    body.order-modal-open .mobile-top-actions {
        flex-shrink: 0 !important;
        position: relative !important;
        right: 0 !important;
        transform: none !important;
        margin-right: 0 !important;
    }
}

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

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--gray-900);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    transition: all var(--duration-fast);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    z-index: 10;
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

/* Bouton de fermeture spécifique pour le modal des détails de commande */
#order-details-modal .order-details-content .modal-header .modal-header-actions .modal-close,
#order-details-modal .modal-close {
    color: #dc3545 !important;
    font-weight: bold !important;
    font-size: 2.2rem !important;
    line-height: 1 !important;
    background: rgba(220, 53, 69, 0.1) !important;
    border: 2px solid #dc3545 !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    border-radius: 50% !important;
    transition: all 0.2s ease !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
    z-index: 10 !important;
}

#order-details-modal .order-details-content .modal-header .modal-header-actions .modal-close:hover,
#order-details-modal .modal-close:hover {
    background: #dc3545 !important;
    color: #ffffff !important;
    transform: scale(1.1) !important;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4) !important;
}

.modal-body {
    padding: var(--spacing-6);
    overflow-y: auto;
    flex: 1;
}

.order-details-section {
    margin-bottom: var(--spacing-6);
}

.order-details-section:last-child {
    margin-bottom: 0;
}

.order-details-section h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 var(--spacing-4) 0;
    padding-bottom: var(--spacing-2);
    border-bottom: 2px solid var(--gray-200);
}

.order-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-4);
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-1);
}

.detail-item label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item span {
    font-size: 0.875rem;
    color: var(--gray-900);
    font-weight: 500;
}

.order-total-large {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.buyer-info {
    display: flex;
    gap: var(--spacing-4);
    align-items: center;
}

.buyer-avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.buyer-address {
    margin-top: var(--spacing-3);
    padding: var(--spacing-3);
    background: var(--gray-50);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--gray-700);
}

.seller-info {
    display: flex;
    gap: var(--spacing-4);
    align-items: center;
}

.seller-avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.qr-code-container {
    text-align: center;
    padding: var(--spacing-4);
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
}

.qr-code-container img {
    max-width: 200px;
    height: auto;
    border-radius: var(--radius);
}

.order-items-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-3);
}

.order-item-row {
    display: flex;
    gap: var(--spacing-3);
    padding: var(--spacing-3);
    background: var(--gray-50);
    border-radius: var(--radius);
}

.item-image {
    width: 60px;
    height: 60px;
    border-radius: var(--radius);
    object-fit: cover;
    flex-shrink: 0;
    display: none; /* Masquer les images dans les commandes - présentation facture */
}

.item-details {
    flex: 1;
}

.item-price-info {
    margin-top: var(--spacing-2);
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* Styles pour le tableau de facture dans les modals */
.invoice-table-container {
    overflow-x: auto;
    margin-top: 1rem;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: var(--radius);
    overflow: hidden;
}

.invoice-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.invoice-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #495057;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.invoice-table td {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    vertical-align: top;
}

.invoice-table tbody tr:hover {
    background: #f8f9fa;
}

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

.invoice-table .col-description {
    width: 50%;
}

.invoice-table .col-quantity {
    width: 10%;
    text-align: center;
}

.invoice-table .col-unit-price {
    width: 20%;
    text-align: right;
}

.invoice-table .col-total {
    width: 20%;
    text-align: right;
    font-weight: 600;
    color: #7B2CBF; /* Violet UMOA */
}

.invoice-table .product-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.invoice-table .product-info strong {
    color: #212529;
}

/* ============================================================================
   VUE FACTURE/PROFORMA PROFESSIONNELLE
   ============================================================================ */

/* Container principal de la facture */
.invoice-view {
    background: #ffffff;
    padding: 0 !important;
}

.invoice-document {
    background: #ffffff;
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

/* Header: Vendeur / Acheteur */
.invoice-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    position: relative;
}

.invoice-header-left,
.invoice-header-right {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.invoice-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #495057;
    margin-bottom: 5px;
}

.invoice-seller-block,
.invoice-buyer-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.invoice-seller-name,
.invoice-buyer-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: #212529;
}

.invoice-contact {
    font-size: 0.875rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Badge statut central flottant */
.invoice-status-badge {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.invoice-status-badge.status-draft {
    background: #ffc107;
    color: #000;
}

.invoice-status-badge.status-pending {
    background: #ff9800;
    color: #fff;
}

.invoice-status-badge.status-paid {
    background: #28a745;
    color: #fff;
}

.invoice-status-badge.status-other {
    background: #6c757d;
    color: #fff;
}

/* Barre référence & QR Code */
.invoice-reference-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-top: 2px solid #dee2e6;
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 30px;
}

.invoice-order-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #212529;
}

.invoice-qr-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.invoice-qr-code {
    width: 100px;
    height: 100px;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    padding: 5px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.invoice-qr-code img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.invoice-qr-label {
    font-size: 0.75rem;
    color: #6c757d;
    text-align: center;
}

/* Tableau des articles */
.invoice-items-section {
    margin-bottom: 30px;
}

.invoice-items-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #eee;
}

.invoice-items-table thead {
    background: #f8f9fa;
}

.invoice-items-table th {
    padding: 12px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.invoice-items-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

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

.invoice-col-desc {
    width: 50%;
}

.invoice-col-qty {
    width: 15%;
    text-align: center;
}

.invoice-col-unit {
    width: 17.5%;
    text-align: right;
}

.invoice-col-total {
    width: 17.5%;
    text-align: right;
}

.invoice-item-sku {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 4px;
}

.invoice-amount {
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

/* Résumé financier */
.invoice-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 30px;
    padding-top: 20px;
    border-top: 2px solid #dee2e6;
}

.invoice-summary-row {
    display: flex;
    justify-content: space-between;
    width: 300px;
    padding: 8px 0;
}

.invoice-summary-label {
    font-size: 0.875rem;
    color: #495057;
}

.invoice-summary-value {
    font-size: 0.875rem;
    color: #212529;
    font-weight: 600;
}

.invoice-summary-row.invoice-discount .invoice-summary-value {
    color: #dc3545;
}

.invoice-summary-row.invoice-total {
    margin-top: 10px;
    padding-top: 15px;
    border-top: 2px solid #dee2e6;
    font-weight: 700 !important;
}

.invoice-summary-row.invoice-total .invoice-summary-label {
    font-size: 1.125rem;
    font-weight: 700 !important;
    color: #212529;
}

.invoice-summary-row.invoice-total .invoice-summary-value {
    font-weight: 700 !important;
}

.invoice-total-amount {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: #007bff !important;
}

.invoice-total-amount strong {
    font-weight: 700 !important;
}

.invoice-summary-row.invoice-delivery-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
    font-size: 0.875rem;
    color: #6c757d;
}

/* Footer */
.invoice-footer {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #dee2e6;
}

.invoice-footer-row {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 15px;
    font-size: 0.875rem;
    color: #6c757d;
}

.invoice-footer-label {
    font-weight: 600;
}

.invoice-footer-meta {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #6c757d;
    text-align: center;
}

.invoice-footer-text {
    margin: 5px 0;
}

.invoice-signature-area {
    margin-top: 40px;
    text-align: right;
}

.invoice-signature-line {
    width: 250px;
    height: 1px;
    background: #dee2e6;
    margin: 0 0 5px auto;
}

.invoice-signature-label {
    font-size: 0.75rem;
    color: #6c757d;
    text-align: right;
}

/* Footer actions dans la vue facture */
.invoice-actions-footer {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #dee2e6;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
}

.invoice-actions-footer .btn {
    padding: 8px 16px;
    font-size: 0.875rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-weight: 500;
}

.invoice-actions-footer .btn-info {
    background: #17a2b8;
    color: #fff;
}

.invoice-actions-footer .btn-info:hover {
    background: #138496;
}

.invoice-actions-footer .btn-success {
    background: #28a745;
    color: #fff;
}

.invoice-actions-footer .btn-success:hover {
    background: #218838;
}

.invoice-actions-footer .btn-danger {
    background: #dc3545;
    color: #fff;
}

.invoice-actions-footer .btn-danger:hover {
    background: #c82333;
}

.invoice-actions-footer .btn-primary {
    background: #007bff;
    color: #fff;
}

.invoice-actions-footer .btn-primary:hover {
    background: #0056b3;
}

.invoice-actions-footer .btn-secondary {
    background: #6c757d;
    color: #fff;
}

.invoice-actions-footer .btn-secondary:hover {
    background: #5a6268;
}

/* Styles pour l'impression */
@media print {
    .invoice-document {
        box-shadow: none;
        padding: 20px;
        max-width: 100%;
    }
    
    .invoice-header {
        page-break-inside: avoid;
    }
    
    .invoice-items-table {
        page-break-inside: avoid;
    }
    
    .invoice-summary {
        page-break-inside: avoid;
    }
    
    .modal-header-actions,
    .modal-footer {
        display: none !important;
    }
    
    .invoice-view {
        padding: 0 !important;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .invoice-document {
        padding: 20px;
    }
    
    .invoice-header {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .invoice-status-badge {
        position: static;
        transform: none;
        margin: 10px auto;
        width: fit-content;
    }
    
    .invoice-reference-bar {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }
    
    .invoice-items-table {
        font-size: 0.875rem;
    }
    
    .invoice-items-table th,
    .invoice-items-table td {
        padding: 8px;
    }
    
    .invoice-summary-row {
        width: 100%;
    }
}

/* Styles pour le header de la modal avec bouton */
.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
}

.btn-outline-primary {
    background: transparent;
    border: 2px solid var(--primary, #007bff);
    color: var(--primary, #007bff);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline-primary:hover {
    background: var(--primary, #007bff);
    color: #fff;
}
    font-size: 1rem;
}

.invoice-table .product-seller {
    font-size: 0.875rem;
    color: #6c757d;
}

.invoice-table .product-seller a {
    color: #7B2CBF; /* Violet UMOA */
    text-decoration: none;
}

.invoice-table .product-seller a:hover {
    text-decoration: underline;
}

/* Responsive pour les tableaux de facture */
@media (max-width: 768px) {
    .invoice-table-container {
        overflow-x: auto;
    }
    
    .invoice-table {
        font-size: 0.85rem;
    }
    
    .invoice-table th,
    .invoice-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .invoice-table .col-description {
        min-width: 200px;
    }
}

.order-history {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-3);
}

.history-item {
    display: flex;
    gap: var(--spacing-3);
    padding: var(--spacing-3);
    background: var(--gray-50);
    border-radius: var(--radius);
    border-left: 3px solid var(--primary);
}

.history-status {
    flex-shrink: 0;
    padding: var(--spacing-1) var(--spacing-2);
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
}

.history-info {
    flex: 1;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.modal-footer {
    display: flex;
    gap: var(--spacing-3);
    padding: var(--spacing-6);
    border-top: 1px solid var(--gray-200);
    justify-content: flex-end;
    flex-wrap: wrap;
}

.modal-footer .btn {
    padding: var(--spacing-3) var(--spacing-5);
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration-fast);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2);
}

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

.modal-footer .btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.modal-footer .btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.modal-footer .btn-secondary:hover {
    background: var(--gray-300);
}

.modal-footer .btn-success {
    background: #10b981;
    color: var(--white);
}

.modal-footer .btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.modal-footer .btn-danger {
    background: #ef4444;
    color: var(--white);
}

.modal-footer .btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.modal-footer .btn-info {
    background: #3b82f6;
    color: var(--white);
}

.modal-footer .btn-info:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Responsive */
@media (max-width: 1400px) {
    .orders-stats-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: var(--spacing-2);
    }
    
    .stat-card {
        padding: var(--spacing-2);
        min-height: 100px;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .stat-icon {
        font-size: 1.25rem;
    }
}

@media (max-width: 1024px) {
    .orders-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .orders-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-card {
        min-height: 110px;
    }
    
    .filters-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .orders-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        min-height: 100px;
    }
    
    .filters-row {
        grid-template-columns: 1fr;
    }
    
    .order-card-header {
        flex-direction: column;
        gap: var(--spacing-3);
        align-items: stretch;
    }
    
    .order-header-left {
        width: 100%;
    }
    
    .order-status-badge {
        margin-left: 0;
        align-self: flex-start;
        margin-top: var(--spacing-2);
    }
    
    .order-number {
        font-size: 1.1rem;
    }
    
    .order-buyer {
        font-size: 0.8rem;
    }
    
    .order-info-grid {
        grid-template-columns: 1fr;
    }
    
    .orders-pagination {
        flex-direction: column;
        gap: var(--spacing-3);
    }
    
    .order-details-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .order-details-grid {
        grid-template-columns: 1fr;
    }
}

