/* ===== CSS UNIFIÉ - APPLICATION MULTI-TRANSFER CCE ===== */

/* ===== VARIABLES CSS ===== */
:root {
    /* Couleurs principales */
    --primary-color: #1E40AF;
    --primary-dark: #1E3A8A;
    --primary-light: #3B82F6;
    --secondary-color: #059669;
    --accent-color: #DC2626;
    --success-color: #059669;
    --warning-color: #D97706;
    --danger-color: #DC2626;
    --info-color: #0284C7;
    
    /* Couleurs de fond */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8F9FA;
    --bg-tertiary: #E9ECEF;
    
    /* Couleurs de texte */
    --text-primary: #1C1C1E;
    --text-secondary: #4A4A4C;
    --text-muted: #8E8E93;
    --text-inverse: #FFFFFF;
    
    /* Espacements */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Bordures */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Ombres */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    
    /* Typographie */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    
    /* Transitions */
    --transition: all 0.3s ease;
}

/* ===== RESET ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--text-primary);
    background: var(--bg-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== LAYOUT PRINCIPAL ===== */
#app {
    min-height: 100vh;
    display: block;
    overflow-x: hidden;
    overflow-y: visible;
    background: #ffffff;
    position: relative;
}

.screen {
    min-height: 100%;
    display: block;
    overflow-x: hidden;
    overflow-y: visible;
    position: relative;
}

.main-content {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 1.5rem 2rem 2rem 2rem;
    padding-top: calc(90px + max(1.5rem, calc(env(safe-area-inset-top) + 1rem)) + 1rem);
    padding-right: calc(100px + max(2rem, env(safe-area-inset-right)));
    display: flex;
    flex-direction: column;
    overflow-y: visible;
    overflow-x: hidden;
    position: relative;
    min-height: calc(100vh - 90px - max(0px, env(safe-area-inset-top)));
    height: calc(100vh - 90px - max(0px, env(safe-area-inset-top)));
    background: transparent;
    /* Support safe areas iOS */
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
    padding-left: max(2rem, env(safe-area-inset-left));
}

/* ===== ÉCRAN DE CONNEXION ===== */
#loginScreen {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    overflow: hidden;
}

.login-container {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl);
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    width: 100%;
}

.login-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.login-logo {
    max-width: 120px;
    height: auto;
    margin-bottom: var(--spacing-md);
}

.login-form .form-group {
    margin-bottom: var(--spacing-lg);
}

.login-form label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.login-form input {
    width: 100%;
    padding: var(--spacing-md);
    border: 2px solid var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    transition: var(--transition);
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.login-btn {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--primary-color);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.login-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.login-error {
    color: var(--danger-color);
    font-size: var(--font-size-sm);
    margin-top: var(--spacing-sm);
    display: none;
}

/* ===== HEADER FIXE ===== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 90px;
    background: white;
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    z-index: 9999;
    padding-top: max(0, env(safe-area-inset-top));
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
}

.header-content {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 100%;
}

.header-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.header-destination {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 0 2rem;
    height: 100%;
    max-height: 100%;
    box-sizing: border-box;
}

.header-destination-display {
    padding: 0.75rem 1.5rem;
    text-align: center;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 2px dashed #dee2e6;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
}

.header-destination-display span {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

/* Override pour mobile - doit être après la définition de base */
@media (max-width: 768px) {
    .header-destination-display span {
        font-size: 1.95rem !important;
    }
}

@media (max-width: 480px) {
    .header-destination-display span {
        font-size: 1.8rem !important;
    }
}

@media (max-width: 360px) {
    .header-destination-display span {
        font-size: 1.65rem !important;
    }
}

.header-destination-display span:not(:empty) {
    color: var(--primary-color);
    font-weight: 900;
}

/* Override pour mobile - doit être après la définition de base */
@media (max-width: 768px) {
    .header-destination-display span:not(:empty) {
        font-size: 1.95rem !important;
    }
}

@media (max-width: 480px) {
    .header-destination-display span:not(:empty) {
        font-size: 1.8rem !important;
    }
}

@media (max-width: 360px) {
    .header-destination-display span:not(:empty) {
        font-size: 1.65rem !important;
    }
}

.header-destination-display.has-location {
    background: #d4edda;
    border: 2px solid #28a745;
    border-style: solid;
    animation: destinationPulse 0.5s ease;
}

.header-destination-display.has-location span {
    color: #28a745;
    font-weight: 900;
    font-size: 2rem;
    animation: textFadeIn 0.5s ease;
}

/* Override pour mobile - doit être après la définition de base */
@media (max-width: 768px) {
    .header-destination-display.has-location span {
        font-size: 1.95rem !important;
    }
}

@media (max-width: 480px) {
    .header-destination-display.has-location span {
        font-size: 1.8rem !important;
    }
}

@media (max-width: 360px) {
    .header-destination-display.has-location span {
        font-size: 1.65rem !important;
    }
}

/* Media queries pour override les styles par défaut sur mobile */
@media (max-width: 768px) {
    .header-destination-display span,
    .header-destination-display.has-location span,
    .header-destination-display span:not(:empty),
    #destinationDisplay,
    #destinationDisplay:not(:empty) {
        font-size: 1.95rem !important;
    }
}

@media (max-width: 480px) {
    .header-destination-display span,
    .header-destination-display.has-location span,
    .header-destination-display span:not(:empty),
    #destinationDisplay,
    #destinationDisplay:not(:empty) {
        font-size: 1.8rem !important;
    }
}

@media (max-width: 360px) {
    .header-destination-display span,
    .header-destination-display.has-location span,
    .header-destination-display span:not(:empty),
    #destinationDisplay,
    #destinationDisplay:not(:empty) {
        font-size: 1.65rem !important;
    }
}

@keyframes destinationPulse {
    0% {
        transform: scale(0.98);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes textFadeIn {
    0% {
        opacity: 0;
        transform: translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ===== LOGOS ET MENU UTILISATEUR (dans header) ===== */
.logos-container {
    display: none; /* Masqué car maintenant dans le header */
}

.company-logo-container {
    padding: 0.25rem;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
}

.company-logo {
    max-width: 70px;
    max-height: 30px;
    display: block;
}

/* Logo dans le header */
.header-logo .company-logo-container {
    padding: 0.375rem;
}

.header-logo .company-logo {
    max-width: 80px;
    max-height: 35px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
}

.header-logo .company-logo-container {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
}

.header-logo .company-logo-container:active {
    transform: scale(0.95);
}

.header-logo .company-logo-container:hover {
    transform: scale(1.05);
}

.user-logo-container {
    position: relative;
}

.user-logo-trigger {
    position: relative;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.2s ease;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
}

.user-logo-trigger:hover {
    opacity: 0.9;
}

.user-menu-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 12px;
    height: 12px;
    background: #10b981;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.user-menu-container {
    position: static;
    display: block;
    width: 0;
    height: 0;
    overflow: visible;
}

.user-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.user-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.user-menu-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 380px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    -webkit-backdrop-filter: blur(40px);
    backdrop-filter: blur(40px);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.4s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.user-menu-overlay.active .user-menu-panel {
    transform: translateX(0);
}

.user-menu-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.user-menu-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.user-menu-info {
    flex: 1;
}

.user-menu-name {
    font-weight: 600;
    color: var(--text-primary);
}

.user-menu-role {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.user-menu-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
}

.user-menu-close:hover {
    background: var(--bg-tertiary);
}

.user-menu-content {
    padding: var(--spacing-md);
}

.user-menu-item {
    width: 100%;
    padding: var(--spacing-md);
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    transition: var(--transition);
    margin-bottom: var(--spacing-sm);
}

.user-menu-item:hover {
    background: var(--bg-secondary);
}

.user-menu-item-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    color: var(--primary-color);
}

.user-menu-item-content {
    flex: 1;
}

.user-menu-item-title {
    font-weight: 600;
    color: var(--text-primary);
}

.user-menu-item-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.user-menu-item-arrow {
    color: var(--text-muted);
}

/* ===== BOUTONS FLOTTANTS ===== */
/* Barre latérale droite pour les boutons flottants */
.floating-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 80px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-left: 1px solid #e9ecef;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 0;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
}

.scan-actions-floating {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    align-items: center;
    transition: margin-bottom 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scan-actions-floating .floating-action-btn {
    animation: buttonSmoothFadeIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) backwards;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scan-actions-floating .floating-action-btn:nth-child(1) {
    animation-delay: 0.1s;
}

.scan-actions-floating .floating-action-btn:nth-child(2) {
    animation-delay: 0.15s;
}

.scan-actions-floating .floating-action-btn:nth-child(3) {
    animation-delay: 0.2s;
}

.scan-actions-floating .floating-action-btn:nth-child(4) {
    animation-delay: 0.25s;
}

@keyframes buttonSmoothFadeIn {
    0% {
        opacity: 0;
        transform: translateX(20px) scale(0.8);
    }
    60% {
        transform: translateX(-3px) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.management-actions-floating {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    overflow: hidden;
    transform: translateY(15px) scale(0.9);
    filter: blur(2px);
    transition: opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                visibility 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                max-height 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                filter 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.management-actions-floating.visible {
    opacity: 1;
    visibility: visible;
    max-height: 500px;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

.management-actions-floating.visible .floating-action-btn {
    animation: buttonModernSlideIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.management-actions-floating:not(.visible) .floating-action-btn {
    animation: buttonModernSlideOut 0.4s cubic-bezier(0.55, 0.055, 0.675, 0.19) forwards;
}

.management-actions-floating.visible .floating-action-btn:nth-child(1) {
    animation-delay: 0.05s;
}

.management-actions-floating.visible .floating-action-btn:nth-child(2) {
    animation-delay: 0.1s;
}

.management-actions-floating.visible .floating-action-btn:nth-child(3) {
    animation-delay: 0.15s;
}

.management-actions-floating.visible .floating-action-btn:nth-child(4) {
    animation-delay: 0.2s;
}

.management-actions-floating.visible .floating-action-btn:nth-child(5) {
    animation-delay: 0.25s;
}

@keyframes buttonModernSlideIn {
    0% {
        opacity: 0;
        transform: translateY(25px) translateX(-15px) scale(0.5) rotate(-15deg);
        filter: blur(6px);
    }
    35% {
        opacity: 0.7;
        transform: translateY(-8px) translateX(5px) scale(1.15) rotate(5deg);
        filter: blur(2px);
    }
    65% {
        opacity: 0.95;
        transform: translateY(3px) translateX(-2px) scale(0.95) rotate(-2deg);
        filter: blur(0.5px);
    }
    85% {
        transform: translateY(-1px) translateX(1px) scale(1.02) rotate(1deg);
        filter: blur(0.2px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) translateX(0) scale(1) rotate(0deg);
        filter: blur(0);
    }
}

@keyframes buttonModernSlideOut {
    0% {
        opacity: 1;
        transform: translateY(0) translateX(0) scale(1) rotate(0deg);
        filter: blur(0);
    }
    50% {
        opacity: 0.5;
        transform: translateY(10px) translateX(5px) scale(0.8) rotate(5deg);
        filter: blur(2px);
    }
    100% {
        opacity: 0;
        transform: translateY(20px) translateX(10px) scale(0.5) rotate(10deg);
        filter: blur(4px);
    }
}

.floating-action-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--primary-color);
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                background-color 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    will-change: transform;
}

.floating-action-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}

.floating-action-btn:active {
    transform: translateY(-1px) scale(1.02);
    transition: transform 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.floating-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-label {
    position: absolute;
    right: 70px;
    background: var(--text-primary);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.floating-action-btn:hover .btn-label {
    opacity: 1;
}


.floating-scan-btn {
    background: var(--primary-color);
}

.floating-manual-btn {
    background: var(--info-color);
}

.floating-quantity-btn {
    background: var(--warning-color);
}

.floating-quantity-btn.active {
    background: var(--success-color);
}

.floating-continuous-scan-btn {
    background: var(--secondary-color);
}

.floating-continuous-scan-btn.active {
    background: var(--success-color);
}

/* Quand les boutons de gestion sont visibles, ajuster l'espacement avec animation */
.scan-actions-floating.management-visible {
    margin-bottom: 0.5rem;
    transform: translateY(-5px);
    transition: margin-bottom 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scan-actions-floating:not(.management-visible) {
    transform: translateY(0);
}

.floating-save-btn {
    background: var(--success-color);
}

.floating-load-btn {
    background: var(--info-color);
}

.floating-notfound-btn {
    background: var(--warning-color);
}

.floating-clear-btn {
    background: var(--danger-color);
}

.floating-3d-btn {
    background: #8B5CF6;
}

.quantity-badge,
.continuous-scan-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: var(--success-color);
    border: 2px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: white;
}

/* ===== SECTION DESTINATION ===== */
.destination-section {
    margin-bottom: var(--spacing-xl);
    margin-top: 0;
}

.destination-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid #e9ecef;
    margin-top: 0;
}

.destination-display {
    padding: var(--spacing-xl);
    text-align: center;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 2px dashed #dee2e6;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#destinationDisplay {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

#destinationDisplay:not(:empty) {
    color: var(--primary-color);
    font-weight: 900;
}

/* Media queries pour #destinationDisplay sur mobile */
@media (max-width: 768px) {
    #destinationDisplay {
        font-size: 1.95rem !important;
    }
}

@media (max-width: 480px) {
    #destinationDisplay {
        font-size: 1.8rem !important;
    }
}

@media (max-width: 360px) {
    #destinationDisplay {
        font-size: 1.65rem !important;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ===== SECTION PALETTES ===== */
.palettes-section {
    margin-bottom: var(--spacing-xl);
    margin-top: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* Sur mobile, ajouter un espacement supplémentaire pour éviter le masquage par le header */
@media (max-width: 768px) {
    .palettes-section:first-of-type {
        margin-top: 2rem;
    }
}

.section-header-modern {
    margin-bottom: var(--spacing-lg);
    scroll-margin-top: calc(90px + max(0px, env(safe-area-inset-top)) + 1rem);
    flex-shrink: 0;
}

.header-content-modern h2 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.subtitle-modern {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.search-filter-container {
    margin-bottom: var(--spacing-lg);
}

.search-filter-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-filter-icon {
    position: absolute;
    left: var(--spacing-md);
    color: var(--text-muted);
    z-index: 1;
}

.search-filter-input {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-md) var(--spacing-md) 2.5rem;
    border: 2px solid #dee2e6;
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    transition: var(--transition);
}

.search-filter-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.clear-search-btn {
    margin-left: var(--spacing-sm);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(148, 163, 184, 0.15);
    color: #64748B;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.clear-search-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
}

.search-results-info {
    margin-top: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.15);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    color: var(--primary-color);
    font-weight: 600;
    text-align: center;
}

.transfer-button-container {
    margin-bottom: var(--spacing-lg);
    flex-shrink: 0;
}

.transfer-btn {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.transfer-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.transfer-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.palettes-container {
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 0;
    background: white;
    border: 1px solid #dee2e6;
    flex: 1;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    box-shadow: none;
}

.palettes-container::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.palettes-container::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.palettes-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: var(--radius-sm);
}

.palettes-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.table-wrapper {
    overflow-x: auto;
    overflow-y: visible;
    border-radius: 0;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 0;
    padding-bottom: 0;
}

.palettes-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.95rem;
    border: none;
    border-radius: 0;
    overflow: hidden;
    margin-bottom: 0;
    padding-bottom: 0;
}

.palettes-table tbody {
    margin-bottom: 0;
    padding-bottom: 0;
}

.palettes-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #e3f2fd;
    border-bottom: 2px solid #90caf9;
}

.palettes-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #1565c0;
    background: transparent;
    border-bottom: 1px solid #90caf9;
    white-space: nowrap;
    font-size: 0.875rem;
    text-transform: none;
    letter-spacing: normal;
}

.palettes-table th:first-child {
    border-top-left-radius: 0;
}

.palettes-table th:last-child {
    border-top-right-radius: 0;
}

.palettes-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e9ecef;
    color: #212529;
    background: white;
    transition: background-color 0.15s ease;
}

.palettes-table tbody tr {
    transition: background-color 0.15s ease;
}

.palettes-table tbody tr:hover {
    background: #f8f9fa;
    transform: none;
    box-shadow: none;
}

.palettes-table tbody tr:nth-child(even) {
    background: white;
}

.palettes-table tbody tr:nth-child(even):hover {
    background: #f8f9fa;
}

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

.palettes-table tbody {
    display: table-row-group;
}

.palettes-table tbody:only-child {
    display: table-row-group;
}

.palettes-table tbody tr.empty-row {
    height: 100%;
    display: table-row;
}

.palettes-table tbody tr.empty-row td {
    padding: 0;
    text-align: center;
    color: #6c757d;
    font-style: normal;
    background: #f8f9fa;
    height: calc(100vh - 250px);
    min-height: calc(100vh - 250px);
    vertical-align: middle;
    position: relative;
}

.palettes-table td.cell-location.has-location,
.palettes-table td.cell-destination.has-location {
    color: #28a745 !important;
    font-weight: 600;
}

.palettes-table td.cell-destination.has-location .table-badge,
.palettes-table td.cell-destination.has-location .badge-destination {
    color: #28a745 !important;
    font-weight: 600;
}

.empty-state-modern {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-lg);
    color: var(--text-muted);
    width: 100%;
    height: 100%;
    min-height: calc(100vh - 250px);
    padding: 4rem 2rem;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    box-sizing: border-box;
    pointer-events: none; /* Permettre les clics à travers pour accéder aux boutons */
}

.empty-icon {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--text-muted);
    box-shadow: var(--shadow-md);
}

.empty-state-modern h3 {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    pointer-events: none; /* Permettre les clics à travers */
}

.empty-state-modern p {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    margin: 0;
    pointer-events: none; /* Permettre les clics à travers */
}

.palette-row-new {
    animation: slideIn 0.3s ease;
}

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

.editable-quantity {
    cursor: pointer;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.editable-quantity:hover {
    background: var(--bg-secondary);
}

.btn-remove {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.btn-remove:hover {
    background: #B91C1C;
    transform: scale(1.05);
}

/* ===== MODALES ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10005;
    justify-content: center;
    align-items: center;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.modal.show {
    display: flex;
}

.modal-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.05);
    max-width: 600px;
    width: 90%;
    max-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 2rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-card.modal-large {
    max-width: 900px;
    width: 95%;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid #e9ecef;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.modal-header h3 {
    margin: 0;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--font-size-lg);
    font-weight: 700;
}

.modal-header h3 i {
    font-size: 1.25rem;
}

.close-modal,
.modal-close,
.btn-close-modal {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 1.25rem;
    color: white;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.close-modal:hover,
.modal-close:hover,
.btn-close-modal:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.modal-body {
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
    flex: 1;
    background: white;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: var(--radius-sm);
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Style spécifique pour le modal-body de la liste des palettes introuvables */
.not-found-list-body {
    position: relative;
    overflow: visible;
}

.modal-footer {
    padding: 1rem max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    border-top: 1px solid #e9ecef;
    background: white;
    display: flex;
}

/* ===== FORMULAIRES ===== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    display: block;
    font-weight: 600;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.875rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background-color: #fff;
    font-size: var(--font-size-base);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-control:disabled {
    background: var(--bg-tertiary);
    cursor: not-allowed;
}

/* ===== BOUTONS ===== */
.btn {
    min-width: 44px;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    font-weight: 600;
}

.btn:active {
    opacity: 0.8;
    transform: scale(0.98);
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn-secondary {
    background: rgba(241, 245, 249, 0.8);
    color: #64748B;
    border: 1px solid rgba(203, 213, 225, 0.6);
}

.btn-secondary:hover {
    background: rgba(241, 245, 249, 1);
}

.btn-primary-large {
    min-height: 52px;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.btn-primary-large:active:not(:disabled) {
    transform: scale(0.97);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-sync {
    background: var(--info-color);
    color: white;
    border: none;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--font-size-sm);
    transition: var(--transition);
}

.btn-sync:hover {
    background: #2563EB;
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-width: 400px;
}

.toast {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    border-left: 4px solid;
}

.toast-show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    border-left-color: var(--success-color);
}

.toast-error {
    border-left-color: var(--danger-color);
}

.toast-warning {
    border-left-color: var(--warning-color);
}

.toast-info {
    border-left-color: var(--info-color);
}

.toast-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.toast-message {
    flex: 1;
    font-size: var(--font-size-sm);
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--spacing-xs);
}

/* ===== PROGRESS BAR ===== */
.global-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10001;
    background: rgba(255, 255, 255, 0.95);
    padding: var(--spacing-sm);
    box-shadow: var(--shadow-md);
}

.progress-bar {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-top: var(--spacing-xs);
}

/* ===== CONNECTION STATUS ===== */
.connection-status {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: var(--warning-color);
    color: white;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.connection-text {
    font-size: var(--font-size-sm);
}

/* ===== SCAN FLASH ===== */
.scan-flash {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10004 !important;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.scan-flash.active {
    display: flex !important;
    pointer-events: auto;
}

.scan-flash-content {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.scan-flash-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-lg);
}

.scan-flash.success .scan-flash-icon {
    color: var(--success-color);
}

.scan-flash.error .scan-flash-icon {
    color: var(--danger-color);
}

.scan-flash-article,
.scan-flash-designation,
.scan-flash-slot,
.scan-flash-quantity,
.scan-flash-status,
.scan-flash-text {
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-base);
}

/* ===== CAMERA VIEW ===== */
#cameraView {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10003;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

#camera-container {
    width: 100%;
    max-width: 100%;
    height: 100%;
    position: relative;
}

.camera-modal {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.camera-header {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.camera-footer {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: var(--spacing-md);
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
}

.scan-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-md);
    pointer-events: none;
}

/* ===== QUANTITY MODAL ===== */
.quantity-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10006;
    justify-content: center;
    align-items: center;
    padding: max(var(--spacing-lg), env(safe-area-inset-top)) max(var(--spacing-lg), env(safe-area-inset-right)) max(var(--spacing-lg), env(safe-area-inset-bottom)) max(var(--spacing-lg), env(safe-area-inset-left));
}

.quantity-modal.show {
    display: flex;
}

.quantity-modal-content {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    max-width: 500px;
    width: 100%;
    max-height: calc(90vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.quantity-display {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.quantity-display input,
#quantityInput {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    border: 3px solid var(--primary-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    width: 100%;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: var(--transition);
}

.quantity-display input:focus,
#quantityInput:focus {
    outline: none;
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.1);
    background: white;
}

.quantity-info {
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    text-align: center;
}

.quantity-max-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.quantity-max-label strong {
    font-size: var(--font-size-base);
    color: var(--primary-color);
    font-weight: 700;
}

.numeric-keypad,
.num-keyboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.num-key {
    padding: var(--spacing-lg);
    font-size: var(--font-size-xl);
    font-weight: 600;
    border: 2px solid #dee2e6;
    border-radius: var(--radius-md);
    background: white;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.num-key:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.num-key:active {
    transform: scale(0.95) translateY(0);
}

.num-key-backspace {
    grid-column: span 2;
    background: var(--warning-color);
    color: white;
    border-color: var(--warning-color);
}

.num-key-enter {
    grid-column: span 2;
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

/* ===== NOT FOUND MODAL ===== */
#notFoundModal .modal-card {
    max-width: 550px;
    width: 90%;
}

#notFoundModal .modal-header {
    background: linear-gradient(135deg, var(--info-color) 0%, #2563eb 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 16px 16px 0 0;
}

#notFoundModal .modal-header h3 {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#notFoundModal .modal-header h3 i {
    font-size: 1.5rem;
}

#notFoundModal .close-modal {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

#notFoundModal .close-modal:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

#notFoundModal .modal-body {
    padding: 2rem;
    background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
}

#notFoundModal .info-display {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    border: 2px solid #0ea5e9;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.1);
}

#notFoundModal .info-display h4 {
    margin: 0 0 0.5rem 0;
    color: #0c4a6e;
    font-size: 0.95rem;
    font-weight: 600;
}

#notFoundModal .info-display > div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    color: #0c4a6e;
    font-size: 0.875rem;
    line-height: 1.6;
}

#notFoundModal .info-display strong {
    color: #075985;
    font-weight: 700;
}

#notFoundModal .form-group {
    margin-bottom: 1.5rem;
}

#notFoundModal .form-group label {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    gap: 0.5rem;
}

#notFoundModal .form-group label i {
    color: var(--info-color);
}

#notFoundModal .form-group input {
    width: 100%;
    padding: 1.125rem 1.25rem;
    font-size: 1rem;
    border-radius: 12px;
    border: 2px solid #cbd5e1;
    background: white;
    color: var(--text-primary);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

#notFoundModal .form-group input:focus {
    outline: none;
    border-color: var(--info-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

#notFoundModal .form-group input[readonly] {
    background: #f8f9fa;
}

#notFoundModal .form-group input::placeholder {
    color: #94a3b8;
    font-style: italic;
}

#notFoundModal .form-group > div {
    display: flex;
    gap: 0.5rem;
}

#notFoundModal .form-group > div input {
    flex: 1;
}

#notFoundModal .form-group > div button {
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
}

#notFoundModal form > div {
    display: grid;
    gap: 1rem;
}

#notFoundModal .modal-footer {
    padding: 1.5rem 2rem;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    border-radius: 0 0 16px 16px;
}

#notFoundModal .modal-footer .btn {
    padding: 0.875rem 1.75rem;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#notFoundModal .modal-footer .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#notFoundModal .modal-footer .btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 2px solid #e2e8f0;
}

#notFoundModal .modal-footer .btn-secondary:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

#notFoundModal .modal-footer .btn-primary {
    background: linear-gradient(135deg, var(--info-color) 0%, #2563eb 100%);
    color: white;
    border: none;
}

#notFoundModal .modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Styles mobiles pour modal palette introuvable - compact et sans scroll */
@media (max-width: 768px) {
    #notFoundModal .modal-card {
        max-width: 95%;
        width: 95%;
        max-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 1rem);
        margin: 0.5rem auto;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    
    #notFoundModal .modal-header {
        padding: 0.75rem 1rem;
        flex-shrink: 0;
    }
    
    #notFoundModal .modal-header h3 {
        font-size: 1rem;
        gap: 0.4rem;
    }
    
    #notFoundModal .modal-header h3 i {
        font-size: 1rem;
    }
    
    #notFoundModal .close-modal {
        width: 32px;
        height: 32px;
        padding: 0.4rem;
        font-size: 1rem;
    }
    
    #notFoundModal .modal-body {
        padding: 0.75rem 1rem !important;
        max-height: none !important;
        overflow: visible !important;
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }
    
    #notFoundModal .info-display {
        padding: 0.75rem !important;
        margin-bottom: 1rem !important;
        border-radius: 6px;
        flex-shrink: 0;
    }
    
    #notFoundModal form {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }
    
    #notFoundModal form > div {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
    }
    
    #notFoundModal .info-display h4 {
        font-size: 0.875rem !important;
        margin: 0 0 0.5rem 0 !important;
    }
    
    #notFoundModal .info-display > div {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
        font-size: 0.875rem;
    }
    
    #notFoundModal .info-display > div > div {
        word-break: break-word;
    }
    
    #notFoundModal .info-display > div > div:has(#notFoundDesignation) {
        grid-column: 1 / -1;
    }
    
    #notFoundModal .info-display > div > div {
        padding: 0.25rem 0;
    }
    
    #notFoundModal .form-group {
        margin-bottom: 0.75rem;
    }
    
    #notFoundModal .form-group label {
        font-size: 0.875rem;
        margin-bottom: 0.4rem;
    }
    
    #notFoundModal .form-group {
        flex-shrink: 0;
    }
    
    #notFoundModal .form-group input {
        padding: 0.6rem 0.75rem !important;
        font-size: 0.9rem !important;
    }
    
    #notFoundModal .form-group button {
        padding: 0.6rem 1rem !important;
        font-size: 0.875rem !important;
    }
    
    #notFoundModal form > div {
        gap: 0.75rem !important;
    }
    
    #notFoundModal .form-group > div {
        display: flex;
        gap: 0.5rem !important;
    }
    
    #notFoundModal .form-group > div button {
        padding: 0.6rem 0.75rem !important;
        font-size: 0.875rem !important;
        min-width: auto;
    }
    
    #notFoundModal .modal-footer {
        padding: 0.75rem 1rem !important;
        flex-shrink: 0;
        gap: 0.75rem !important;
    }
    
    #notFoundModal .modal-footer button {
        padding: 0.6rem 1rem !important;
        font-size: 0.875rem !important;
        flex: 1;
    }
    
    #notFoundModal .modal-footer button i {
        font-size: 0.875rem;
    }
}

/* Styles pour très petits écrans */
@media (max-width: 480px) {
    #notFoundModal .modal-card {
        max-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 0.5rem);
        margin: 0.25rem auto;
    }
    
    #notFoundModal .modal-header {
        padding: 0.6rem 0.75rem;
    }
    
    #notFoundModal .modal-header h3 {
        font-size: 0.9rem;
    }
    
    #notFoundModal .modal-body {
        padding: 0.6rem 0.75rem;
    }
    
    #notFoundModal .info-display {
        padding: 0.6rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    #notFoundModal .info-display h4 {
        font-size: 0.8rem !important;
    }
    
    #notFoundModal .info-display > div {
        font-size: 0.8rem;
    }
    
    #notFoundModal .form-group label {
        font-size: 0.8rem;
    }
    
    #notFoundModal .form-group input {
        padding: 0.5rem 0.6rem !important;
        font-size: 0.85rem !important;
    }
    
    #notFoundModal .form-group button {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.8rem !important;
    }
    
    #notFoundModal .modal-footer {
        padding: 0.6rem 0.75rem !important;
    }
    
    #notFoundModal .modal-footer button {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.8rem !important;
    }
}

.not-found-list-modal {
    max-width: 900px;
    width: 90%;
}

.not-found-list-header {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: white;
}

.not-found-list-header h3 {
    color: white;
}

.not-found-list-container {
    max-height: 60vh;
    overflow-y: auto;
    padding: var(--spacing-md);
    background: white;
    position: relative; /* Pour que l'empty-state-modern soit positionné relativement à ce conteneur */
    min-height: 200px; /* Hauteur minimale pour éviter que le conteneur soit trop petit */
}

.not-found-list-container table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.95rem;
    border: none;
    border-radius: 0;
    overflow: hidden;
    margin-bottom: 0;
    padding-bottom: 0;
}

.not-found-list-container table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.not-found-list-container table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #495057;
    background: transparent;
    border-bottom: 1px solid #dee2e6;
    white-space: nowrap;
    font-size: 0.875rem;
    text-transform: none;
    letter-spacing: normal;
}

.not-found-list-container table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e9ecef;
    color: #212529;
    background: white;
    transition: background-color 0.15s ease;
}

.not-found-list-container table tbody tr {
    transition: background-color 0.15s ease;
}

.not-found-list-container table tbody tr:hover {
    background: #f8f9fa;
    transform: none;
    box-shadow: none;
}

.not-found-list-container table tbody tr:nth-child(even) {
    background: white;
}

.not-found-list-container table tbody tr:nth-child(even):hover {
    background: #f8f9fa;
}

.not-found-list-container table tbody tr:last-child td {
    border-bottom: none;
}

.not-found-list-container::-webkit-scrollbar {
    width: 8px;
}

.not-found-list-container::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.not-found-list-container::-webkit-scrollbar-thumb {
    background: var(--warning-color);
    border-radius: var(--radius-sm);
}

.not-found-list-footer {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 1rem;
    border-top: 1px solid #e9ecef;
    background: white;
    position: relative; /* S'assurer que le footer est au-dessus */
    z-index: 1; /* S'assurer que le footer est cliquable */
}

.not-found-list-footer .btn {
    margin: 0;
    white-space: nowrap;
}

/* ===== MODAL SAISIE MANUELLE ===== */
#manualInputModal .modal-card {
    max-width: 550px;
    width: 90%;
}

#manualInputModal .modal-header {
    background: linear-gradient(135deg, var(--info-color) 0%, #2563eb 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 16px 16px 0 0;
}

#manualInputModal .modal-header h3 {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#manualInputModal .modal-header h3 i {
    font-size: 1.5rem;
}

#manualInputModal .close-modal {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

#manualInputModal .close-modal:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

#manualInputModal .modal-body {
    padding: 2rem;
    background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
}

.manual-input-info {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    border: 2px solid #0ea5e9;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.1);
}

.manual-input-info p {
    color: #0c4a6e;
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.6;
}

.manual-input-info i {
    color: #0284c7;
    margin-right: 0.5rem;
}

.manual-input-info strong {
    color: #075985;
    font-weight: 700;
}

.manual-input-group {
    margin-bottom: 1.5rem;
}

.manual-input-label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.manual-input-label::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, var(--info-color) 0%, #2563eb 100%);
    border-radius: 2px;
}

.manual-input-field {
    width: 100%;
    padding: 1.125rem 1.25rem;
    font-size: 1rem;
    border-radius: 12px;
    border: 2px solid #cbd5e1;
    background: white;
    color: var(--text-primary);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.manual-input-field:focus {
    outline: none;
    border-color: var(--info-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.manual-input-field::placeholder {
    color: #94a3b8;
    font-style: italic;
}

#manualInputModal .modal-footer {
    padding: 1.5rem 2rem;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    border-radius: 0 0 16px 16px;
}

#manualInputModal .modal-footer .btn {
    padding: 0.875rem 1.75rem;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#manualInputModal .modal-footer .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#manualInputModal .modal-footer .btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 2px solid #e2e8f0;
}

#manualInputModal .modal-footer .btn-secondary:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

#manualInputModal .modal-footer .btn-primary {
    background: linear-gradient(135deg, var(--info-color) 0%, #2563eb 100%);
    color: white;
    border: none;
}

#manualInputModal .modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

#manualInputModal .modal-footer .btn-info {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    border: none;
}

#manualInputModal .modal-footer .btn-info:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

/* ===== MODAL SAISIE EN MASSE ===== */
#bulkInputModal .modal-card {
    max-width: 700px;
    width: 90%;
}

#bulkInputModal .modal-header {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 16px 16px 0 0;
}

#bulkInputModal .modal-header h3 {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#bulkInputModal .modal-header h3 i {
    font-size: 1.5rem;
}

#bulkInputModal .close-modal {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

#bulkInputModal .close-modal:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

#bulkInputModal .modal-body {
    padding: 2rem;
    background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
}

.bulk-input-field {
    width: 100%;
    padding: 1.125rem 1.25rem;
    font-size: 0.95rem;
    border-radius: 12px;
    border: 2px solid #cbd5e1;
    background: white;
    color: var(--text-primary);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    font-family: 'Courier New', monospace;
    resize: vertical;
    min-height: 300px;
    line-height: 1.6;
}

.bulk-input-field:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.bulk-input-field::placeholder {
    color: #94a3b8;
    font-style: italic;
}

.bulk-input-stats {
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #475569;
    font-weight: 500;
    display: inline-block;
}

#bulkInputModal .modal-footer {
    padding: 1.5rem 2rem;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    border-radius: 0 0 16px 16px;
}

#bulkInputModal .modal-footer .btn {
    padding: 0.875rem 1.75rem;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#bulkInputModal .modal-footer .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#bulkInputModal .modal-footer .btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 2px solid #e2e8f0;
}

#bulkInputModal .modal-footer .btn-secondary:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

#bulkInputModal .modal-footer .btn-primary {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    border: none;
}

#bulkInputModal .modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

/* ===== MODAL RÉSUMÉ DES ERREURS ===== */
#bulkErrorsModal .modal-card {
    max-width: 800px;
    width: 90%;
}

#bulkErrorsModal .modal-header {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 16px 16px 0 0;
}

#bulkErrorsModal .modal-header h3 {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#bulkErrorsModal .modal-header h3 i {
    font-size: 1.5rem;
}

#bulkErrorsModal .modal-body {
    padding: 2rem;
    background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
}

.errors-summary-header {
    margin-bottom: 1.5rem;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.stat-item i {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.stat-item.stat-success i {
    color: #10b981;
}

.stat-item.stat-error i {
    color: #ef4444;
}

.stat-item.stat-total i {
    color: #6366f1;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
}

.stat-item.stat-success .stat-value {
    color: #10b981;
}

.stat-item.stat-error .stat-value {
    color: #ef4444;
}

.stat-item.stat-total .stat-value {
    color: #6366f1;
}

.errors-list-container {
    max-height: 400px;
    overflow-y: auto;
    border-radius: 12px;
    background: white;
    border: 1px solid #e5e7eb;
}

.errors-list {
    padding: 1rem;
}

.error-item {
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    transition: background 0.2s ease;
}

.error-item:last-child {
    margin-bottom: 0;
}

.error-item:hover {
    background: #fee2e2;
}

.error-item-icon {
    color: #ef4444;
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.error-item-content {
    flex: 1;
}

.error-item-text {
    color: #991b1b;
    font-size: 0.9375rem;
    line-height: 1.5;
    font-weight: 500;
}

.no-errors-message {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

.no-errors-message i {
    font-size: 3rem;
    color: #10b981;
    margin-bottom: 1rem;
    display: block;
}

.no-errors-message p {
    font-size: 1.125rem;
    font-weight: 500;
}

#bulkErrorsModal .modal-footer {
    padding: 1.5rem 2rem;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    border-radius: 0 0 16px 16px;
}

#bulkErrorsModal .modal-footer .btn {
    padding: 0.875rem 1.75rem;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

#bulkErrorsModal .modal-footer .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#bulkErrorsModal .modal-footer .btn-primary {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

#bulkErrorsModal .modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* Responsive pour le modal d'erreurs */
@media (max-width: 768px) {
    .summary-stats {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .stat-item {
        padding: 1rem;
    }
    
    .stat-item i {
        font-size: 1.5rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    #bulkErrorsModal .modal-body {
        padding: 1rem;
    }
    
    .errors-list-container {
        max-height: 300px;
    }
    
    .error-item {
        padding: 0.75rem;
    }
    
    .error-item-text {
        font-size: 0.875rem;
    }
}

/* ===== ADMIN MODAL ===== */
#adminModal .modal-card {
    max-width: 1000px;
    width: 95%;
}

.admin-tabs-container {
    display: flex;
    gap: var(--spacing-sm);
    border-bottom: 2px solid #e9ecef;
    margin-bottom: var(--spacing-lg);
}

.admin-tab {
    padding: var(--spacing-md) var(--spacing-lg);
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition);
}

.admin-tab.active {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
}

.admin-content {
    display: none;
}

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

.admin-list-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    background: white;
}

.admin-list-container::-webkit-scrollbar {
    width: 8px;
}

.admin-list-container::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.admin-list-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: var(--radius-sm);
}

.admin-list-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.admin-list-container table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.95rem;
}

.admin-list-container table thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.admin-list-container table th {
    padding: 0.875rem;
    text-align: left;
    font-weight: 600;
    color: white;
    background: transparent;
    border-bottom: none;
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-list-container table td {
    padding: 0.875rem;
    border-bottom: 1px solid #e9ecef;
    color: var(--text-primary);
    background: white;
}

.admin-list-container table tbody tr:hover {
    background: rgba(30, 64, 175, 0.05);
}

.admin-list-container table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.admin-list-container table tbody tr:nth-child(even):hover {
    background: rgba(30, 64, 175, 0.05);
}

/* ===== LOAD SESSION MODAL ===== */
#loadSessionModal .modal-card {
    max-width: 900px;
    width: 90%;
}

.sessions-table-container {
    display: block;
}

.sessions-cards-container {
    display: none;
}

@media (max-width: 768px) {
    .sessions-table-container {
        display: block;
    }
    
    .sessions-cards-container {
        display: none;
    }
}

.sessions-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.95rem;
    border: none;
    border-radius: 0;
    overflow: hidden;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sessions-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.sessions-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #495057;
    background: transparent;
    border-bottom: 1px solid #dee2e6;
    white-space: nowrap;
    font-size: 0.875rem;
    text-transform: none;
    letter-spacing: normal;
}

.sessions-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e9ecef;
    color: #212529;
    background: white;
    transition: background-color 0.15s ease;
}

.sessions-table tbody tr {
    transition: background-color 0.15s ease;
}

.sessions-table tbody tr:hover {
    background: #f8f9fa;
    transform: none;
    box-shadow: none;
}

.sessions-table tbody tr:nth-child(even) {
    background: white;
}

.sessions-table tbody tr:nth-child(even):hover {
    background: #f8f9fa;
}

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

.session-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    transition: var(--transition);
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.session-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
    border-left-color: var(--primary-dark);
}

.session-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.session-card-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--font-size-lg);
}

.session-card-meta {
    display: flex;
    gap: var(--spacing-md);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
}

.session-card-actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    margin-top: var(--spacing-md);
}

.btn-action {
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--font-size-sm);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.btn-action.btn-load {
    background: var(--info-color);
    color: white;
}

.btn-action.btn-send {
    background: var(--success-color);
    color: white;
}

.btn-action.btn-delete {
    background: var(--danger-color);
    color: white;
}

.btn-action.btn-export {
    background: var(--secondary-color);
    color: white;
}

/* ===== UTILITAIRES ===== */
.hidden {
    display: none !important;
}

.action-col {
    width: 100px;
    text-align: center;
}

.actions-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.session-actions {
    text-align: center;
}

.session-actions .actions-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.not-found-actions {
    text-align: center;
}

.not-found-actions .actions-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

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

/* Support des safe areas iOS (notch, etc.) */
@supports (padding: max(0px)) {
    .floating-sidebar {
        right: max(0px, env(safe-area-inset-right));
    }
    
    .logos-container {
        top: max(0.5rem, env(safe-area-inset-top));
        left: max(0.5rem, env(safe-area-inset-left));
    }
    
    .main-content {
        padding-bottom: max(2rem, env(safe-area-inset-bottom));
    }
    
    .toast-container {
        bottom: max(1rem, env(safe-area-inset-bottom));
    }
}

/* Tablettes et petits écrans (max 1024px) */
@media (max-width: 1024px) {
    .main-content {
        padding: 1.25rem;
        padding-top: calc(90px + max(1.25rem, env(safe-area-inset-top)) + 1.5rem);
    }
    
    .palettes-container {
        flex: 1;
        min-height: 0;
    }
    
    .main-content {
        min-height: calc(100vh - 90px - max(0px, env(safe-area-inset-top)));
        height: calc(100vh - 90px - max(0px, env(safe-area-inset-top)));
    }
}

/* Tablettes et mobiles (max 768px) */
@media (max-width: 768px) {
    .app-header {
        height: 80px;
        padding-left: max(0.75rem, env(safe-area-inset-left));
        padding-right: max(0.75rem, env(safe-area-inset-right));
    }
    
    .header-logo .company-logo {
        max-width: 70px;
        max-height: 30px;
    }
    
    .header-destination {
        padding: 0 0.5rem;
        min-width: 0;
        height: 100%;
        max-height: 100%;
        box-sizing: border-box;
    }
    
    .header-destination-display {
        padding: 0.25rem 0.75rem;
        min-height: 0;
        height: 100%;
        max-height: 100%;
        box-sizing: border-box;
    }
    
    .header-destination-display span {
        font-size: 1.95rem !important;
        font-weight: 900;
        line-height: 1.2;
    }
    
    .header-destination-display.has-location span {
        font-size: 1.95rem !important;
        font-weight: 900;
    }
    
    #destinationDisplay {
        font-size: 1.95rem !important;
    }
    
    .main-content {
        padding-top: calc(80px + max(0px, env(safe-area-inset-top)) + 3.5rem);
        padding-bottom: max(2rem, env(safe-area-inset-bottom));
        padding-left: 1rem;
        padding-right: calc(70px + 1rem) !important;
    }
    
    .palettes-section {
        margin-top: 2.5rem !important;
        scroll-margin-top: calc(80px + max(0px, env(safe-area-inset-top)) + 1rem);
    }
    
    .section-header-modern {
        margin-top: 1.5rem !important;
        padding-top: 1rem !important;
    }
    
    .header-content-modern {
        padding-top: 0.5rem;
    }
    
    .floating-sidebar {
        width: 70px;
        padding: 0.75rem 0;
        gap: 1rem;
    }
    
    .scan-actions-floating {
        gap: 0.75rem;
    }
    
    .management-actions-floating {
        gap: 0.75rem;
    }
    
    .scan-actions-floating.management-visible {
        margin-bottom: 0.5rem;
    }
    
    /* Touch targets minimum 44px pour iOS, 48px pour Android */
    .floating-action-btn {
        width: 48px;
        height: 48px;
        font-size: 1rem;
        min-width: 48px;
        min-height: 48px;
    }
    
    .btn-label {
        display: none;
    }
    
    .palettes-container {
        flex: 1;
        min-height: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .main-content {
        min-height: calc(100vh - 80px - max(0px, env(safe-area-inset-top)));
        height: calc(100vh - 80px - max(0px, env(safe-area-inset-top)));
    }
    
    .palettes-table {
        font-size: 0.7rem;
        min-width: 100%;
    }
    
    .palettes-table th,
    .palettes-table td {
        padding: 0.5rem;
        min-width: 80px;
        font-size: 0.7rem;
    }
    
    /* Appliquer le même style aux tableaux des modals */
    .sessions-table,
    .not-found-list-container table {
        font-size: 0.7rem;
        min-width: 100%;
    }
    
    .sessions-table th,
    .sessions-table td,
    .not-found-list-container table th,
    .not-found-list-container table td {
        padding: 0.5rem;
        min-width: 80px;
        font-size: 0.7rem;
    }
    
    .palettes-table th:first-child,
    .palettes-table td:first-child {
        position: sticky;
        left: 0;
        z-index: 10;
        box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
    }
    
    .palettes-table th:first-child {
        background: #e3f2fd;
    }
    
    .palettes-table td:first-child {
        background: white;
    }
    
    .modal-card {
        width: 95%;
        max-width: 95%;
        max-height: calc(90vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        margin: max(1rem, env(safe-area-inset-top)) auto max(1rem, env(safe-area-inset-bottom));
    }
    
    .not-found-list-modal {
        width: 95%;
        max-width: 95%;
        max-height: calc(85vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    }
    
    .not-found-list-container {
        max-height: calc(60vh - 100px);
        padding: 0.75rem;
    }
    
    .modal {
        padding: max(1rem, env(safe-area-inset-top)) max(0.5rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(0.5rem, env(safe-area-inset-left));
    }
    
    .toast-container {
        top: max(1rem, calc(env(safe-area-inset-top) + 1rem));
        right: max(1rem, env(safe-area-inset-right));
        left: max(1rem, env(safe-area-inset-left));
        max-width: none;
        bottom: auto;
    }
    
    .destination-card {
        padding: var(--spacing-md);
    }
    
    .palettes-table tbody tr.empty-row td {
        padding: 0;
        min-height: calc(100vh - 400px);
        vertical-align: middle;
        position: relative;
    }
    
    .empty-state-modern {
        height: 100%;
        min-height: calc(100vh - 400px);
        gap: var(--spacing-lg);
        width: 100%;
        justify-content: center;
        padding: 4rem 1.5rem;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }
    
    .empty-icon {
        width: 120px;
        height: 120px;
        font-size: 4rem;
    }
    
    .empty-state-modern h3 {
        font-size: var(--font-size-2xl);
        font-weight: 700;
    }
    
    .empty-state-modern p {
        font-size: var(--font-size-lg);
    }
    
    .section-header-modern {
        margin-bottom: var(--spacing-md);
        scroll-margin-top: calc(80px + max(0px, env(safe-area-inset-top)) + 1rem);
        padding-top: 0.5rem;
    }
    
    .header-content-modern h2 {
        font-size: var(--font-size-lg);
    }
    
    /* Optimisation des boutons pour mobile */
    button, .btn {
        min-height: 44px;
        min-width: 44px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Amélioration de la lisibilité */
    input, textarea, select {
        font-size: 16px; /* Évite le zoom automatique sur iOS */
        min-height: 44px;
    }
}

/* Petits mobiles (max 480px) */
@media (max-width: 480px) {
    .app-header {
        height: 76px;
    }
    
    .header-logo .company-logo {
        max-width: 60px;
        max-height: 28px;
    }
    
    .header-destination {
        padding: 0 0.5rem;
        min-width: 0;
        height: 100%;
        max-height: 100%;
        box-sizing: border-box;
    }
    
    .header-destination-display {
        padding: 0.25rem 0.75rem;
        min-height: 0;
        height: 100%;
        max-height: 100%;
        box-sizing: border-box;
    }
    
    .header-destination-display span {
        font-size: 1.8rem !important;
    }
    
    .header-destination-display.has-location span {
        font-size: 1.8rem !important;
    }
    
    #destinationDisplay {
        font-size: 1.8rem !important;
    }
    
    .main-content {
        padding-top: calc(76px + max(0px, env(safe-area-inset-top)) + 3.5rem);
        padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
        padding-left: 0.75rem;
        padding-right: calc(60px + 0.75rem) !important;
    }
    
    .palettes-section {
        margin-top: 2.5rem !important;
        scroll-margin-top: calc(76px + max(0px, env(safe-area-inset-top)) + 1rem);
    }
    
    .section-header-modern {
        margin-top: 1.5rem !important;
        padding-top: 1rem !important;
    }
    
    .header-content-modern {
        padding-top: 0.5rem;
    }
    
    .floating-action-btn {
        width: 48px;
        height: 48px;
        font-size: 0.9rem;
        min-width: 48px;
        min-height: 48px;
    }
    
    .floating-sidebar {
        width: 60px;
        padding: 0.5rem 0;
        gap: 0.75rem;
    }
    
    .scan-actions-floating {
        gap: 0.5rem;
    }
    
    .management-actions-floating {
        gap: 0.5rem;
    }
    
    .palettes-table {
        font-size: 0.6rem;
    }
    
    .palettes-table th,
    .palettes-table td {
        padding: 0.375rem;
        font-size: 0.6rem;
    }
    
    /* Appliquer le même style aux tableaux des modals */
    .sessions-table,
    .not-found-list-container table {
        font-size: 0.6rem;
    }
    
    .sessions-table th,
    .sessions-table td,
    .not-found-list-container table th,
    .not-found-list-container table td {
        padding: 0.375rem;
        font-size: 0.6rem;
    }
    
    .palettes-table tbody tr.empty-row td {
        padding: 0;
        min-height: calc(100vh - 350px);
        vertical-align: middle;
        position: relative;
    }
    
    .empty-state-modern {
        height: 100%;
        min-height: calc(100vh - 350px);
        gap: var(--spacing-md);
        width: 100%;
        justify-content: center;
        padding: 3rem 1rem;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }
    
    .empty-icon {
        width: 100px;
        height: 100px;
        font-size: 3.5rem;
    }
    
    .empty-state-modern h3 {
        font-size: var(--font-size-xl);
        font-weight: 700;
    }
    
    .empty-state-modern p {
        font-size: var(--font-size-base);
    }
    
    .modal-card {
        width: 98%;
        max-width: 98%;
        padding: 1rem;
    }
    
    .not-found-list-modal {
        width: 98%;
        max-width: 98%;
        max-height: calc(85vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        padding: 0.75rem;
    }
    
    .not-found-list-container {
        max-height: calc(55vh - 80px);
        padding: 0.5rem;
    }
    
    .login-container {
        padding: var(--spacing-lg);
        margin: max(1rem, env(safe-area-inset-top)) max(0.5rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(0.5rem, env(safe-area-inset-left));
    }
    
    .destination-card {
        padding: 0.75rem;
    }
    
    .section-header-modern {
        padding-top: 0.5rem;
    }
    
    .section-header-modern h2 {
        font-size: 1.125rem;
    }
}

/* Très petits écrans (max 360px) */
@media (max-width: 360px) {
    .app-header {
        height: 72px;
    }
    
    .header-destination {
        padding: 0 0.75rem;
    }
    
    .header-destination-display {
        padding: 0.2rem 0.5rem;
        min-height: 0;
        height: 100%;
        max-height: 100%;
        box-sizing: border-box;
    }
    
    .header-destination-display span {
        font-size: 1.65rem !important;
    }
    
    .header-destination-display.has-location span {
        font-size: 1.65rem !important;
    }
    
    #destinationDisplay {
        font-size: 1.65rem !important;
    }
    
    .main-content {
        padding: 0.5rem;
        padding-top: calc(72px + max(0px, env(safe-area-inset-top)) + 3rem);
    }
    
    .palettes-table tbody tr.empty-row td {
        padding: 0;
        min-height: calc(100vh - 300px);
        vertical-align: middle;
        position: relative;
    }
    
    .empty-state-modern {
        height: 100%;
        min-height: calc(100vh - 300px);
        gap: var(--spacing-md);
        width: 100%;
        justify-content: center;
        padding: 2.5rem 0.75rem;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }
    
    .empty-icon {
        width: 90px;
        height: 90px;
        font-size: 3rem;
    }
    
    .empty-state-modern h3 {
        font-size: var(--font-size-lg);
        font-weight: 700;
    }
    
    .empty-state-modern p {
        font-size: var(--font-size-sm);
    }
    
    .palettes-section {
        margin-top: 2.5rem !important;
        scroll-margin-top: calc(72px + max(0px, env(safe-area-inset-top)) + 1rem);
    }
    
    .section-header-modern {
        margin-top: 1.5rem !important;
        padding-top: 1rem !important;
    }
    
    .header-content-modern {
        padding-top: 0.5rem;
    }
    
    .floating-action-btn {
        width: 44px;
        height: 44px;
        font-size: 0.85rem;
        min-width: 44px;
        min-height: 44px;
    }
    
    .palettes-table {
        font-size: 0.6rem;
    }
    
    .palettes-table th,
    .palettes-table td {
        padding: 0.25rem;
        font-size: 0.6rem;
    }
}

/* Orientation paysage sur mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .main-content {
        padding-top: max(3rem, calc(env(safe-area-inset-top) + 2rem));
        padding-right: calc(60px + 0.75rem) !important;
    }
    
    .floating-sidebar {
        width: 60px;
        padding: 0.5rem 0;
        gap: 0.5rem;
    }
    
    .scan-actions-floating {
        gap: 0.5rem;
    }
    
    .management-actions-floating {
        gap: 0.5rem;
    }
    
    .scan-actions-floating.management-visible {
        margin-bottom: 0.5rem;
    }
    
    .palettes-container {
        max-height: calc(100vh - 250px);
    }
    
    .floating-action-btn {
        width: 44px;
        height: 44px;
        font-size: 0.9rem;
    }
    
    .modal-card {
        max-height: calc(85vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    }
}

/* Support iOS spécifique */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari */
    .floating-action-btn {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
    
    .palettes-container {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Empêcher le zoom sur double tap */
    * {
        touch-action: manipulation;
    }
    
    input, textarea, select {
        font-size: 16px !important; /* Force 16px pour éviter le zoom iOS */
    }
}

/* Support Android spécifique */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    /* Amélioration pour Chrome Android */
    .floating-action-btn {
        -webkit-tap-highlight-color: transparent;
    }
}

/* Hauteur dynamique pour mobile (gestion du clavier virtuel) */
@media (max-width: 768px) {
    .keyboard-open .floating-sidebar {
        height: auto;
        max-height: 50vh;
        overflow-y: auto;
    }
    
    .keyboard-open .management-actions-floating {
        display: none;
    }
    
    .keyboard-open .palettes-container {
        flex: 1;
        min-height: 0;
    }
}

/* Amélioration de la scrollabilité sur mobile */
@media (max-width: 768px) {
    .palettes-container {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    /* Scrollbar personnalisée pour mobile */
    .palettes-container::-webkit-scrollbar {
        width: 4px;
        height: 4px;
    }
    
    .palettes-container::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.2);
        border-radius: 2px;
    }
}

/* ===== PWA - MODE STANDALONE (APPLICATION INSTALLÉE) ===== */
/* Styles pour améliorer l'expérience en mode standalone */

.standalone-mode .app-header {
    /* Ajuster le header pour tenir compte de la barre de statut iOS */
    padding-top: max(env(safe-area-inset-top), 0.5rem);
}

.standalone-mode .main-content {
    /* Ajuster le contenu principal */
    padding-top: calc(90px + max(env(safe-area-inset-top), 1rem) + 1rem);
}

/* Bouton d'installation PWA */
#pwa-install-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-family: var(--font-family);
}

#pwa-install-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.5);
}

#pwa-install-button:active {
    transform: scale(0.98);
}

#pwa-install-button i {
    font-size: 16px;
}

/* Masquer le bouton si l'app est déjà installée */
.standalone-mode #pwa-install-button,
html.standalone-mode #pwa-install-button {
    display: none !important;
}

/* Ajustements pour les zones sécurisées (notch, etc.) */
@supports (padding: max(0px)) {
    .standalone-mode .app-header,
    .standalone-mode header {
        padding-top: max(env(safe-area-inset-top), 0.5rem);
    }
    
    .standalone-mode .main-content {
        padding-bottom: max(env(safe-area-inset-bottom), 1rem);
    }
    
    #pwa-install-button {
        bottom: max(20px, env(safe-area-inset-bottom) + 10px);
        right: max(20px, env(safe-area-inset-right) + 10px);
    }
}

/* Améliorations pour iOS en mode standalone */
@supports (-webkit-touch-callout: none) {
    .standalone-mode {
        /* iOS spécifique */
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
    
    .standalone-mode input,
    .standalone-mode textarea {
        -webkit-user-select: text;
        user-select: text;
    }
}

/* Media queries pour le bouton d'installation sur mobile */
@media (max-width: 768px) {
    #pwa-install-button {
        bottom: 15px;
        right: 15px;
        padding: 10px 20px;
        font-size: 13px;
    }
    
    #pwa-install-button i {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    #pwa-install-button {
        bottom: 10px;
        right: 10px;
        padding: 8px 16px;
        font-size: 12px;
    }
}

/* ===== MODAL DE LOADING MODERNE ===== */
.loading-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    overflow: hidden;
    background: #0f172a;
}

.loading-modal.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-background-stock {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    overflow: hidden;
}

.loading-warehouse-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.08) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridMove 25s linear infinite;
    opacity: 0.4;
}

.loading-warehouse-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(45deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px),
        linear-gradient(-45deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 120px 120px;
    animation: gridMove 30s linear infinite reverse;
    opacity: 0.3;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(60px, 60px);
    }
}

.loading-modal-content {
    position: relative;
    text-align: center;
    color: white;
    max-width: 700px;
    padding: 3rem;
    z-index: 10;
    animation: fadeInUp 0.6s ease-out;
}

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

/* Animation de transfert de stock */
.loading-transfer-animation {
    position: relative;
    width: 100%;
    max-width: 650px;
    height: 240px;
    margin: 0 auto 3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
}

/* Emplacement (Source/Destination) */
.location-box {
    position: relative;
    width: 160px;
    height: 220px;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
    border: 2px solid rgba(99, 102, 241, 0.4);
    border-radius: 12px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 0 30px rgba(99, 102, 241, 0.15),
        0 0 20px rgba(99, 102, 241, 0.2);
    transition: all 0.3s ease;
}

.location-box:hover {
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 0 30px rgba(99, 102, 241, 0.25),
        0 0 30px rgba(99, 102, 241, 0.3);
}

.location-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

.location-icon {
    font-size: 0.9rem;
    color: #6366F1;
    opacity: 0.8;
}

.location-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    flex: 1;
    text-align: center;
}

.location-count {
    font-size: 0.7rem;
    font-weight: 600;
    color: #6366F1;
    background: rgba(99, 102, 241, 0.2);
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.stock-items {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: center;
    justify-content: flex-start;
    overflow-y: auto;
    padding: 0.25rem 0;
}

.stock-box {
    width: 55px;
    height: 42px;
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #3B82F6 100%);
    border-radius: 6px;
    box-shadow: 
        0 3px 10px rgba(99, 102, 241, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    position: relative;
    animation: boxPulse 2.5s ease-in-out infinite;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.stock-box:hover {
    transform: scale(1.1);
    box-shadow: 
        0 4px 15px rgba(99, 102, 241, 0.7),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.box-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

.stock-box::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 35px;
    height: 2px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 1px;
}

.stock-box::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 35px;
    height: 2px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 1px;
}

.box-1 { animation-delay: 0s; }
.box-2 { animation-delay: 0.2s; }
.box-3 { animation-delay: 0.4s; }
.box-4 { animation-delay: 0.6s; }
.box-5 { animation-delay: 0.8s; }
.box-6 { animation-delay: 1s; }
.box-7 { animation-delay: 1.2s; }
.box-8 { animation-delay: 1.4s; }

.stock-box.arriving {
    animation: boxArrive 2s ease-in-out infinite;
    animation-delay: 1s;
}

@keyframes boxPulse {
    0%, 100% {
        opacity: 0.85;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.08);
    }
}

@keyframes boxArrive {
    0%, 40% {
        opacity: 0.3;
        transform: scale(0.7) translateY(10px);
    }
    50%, 90% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    100% {
        opacity: 0.3;
        transform: scale(0.7) translateY(10px);
    }
}

/* Zone de transfert avec convoyeur */
.transfer-zone {
    position: relative;
    width: 200px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
}

.conveyor-belt {
    position: absolute;
    width: 100%;
    height: 60px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(30, 41, 59, 0.4);
    border-radius: 8px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    overflow: hidden;
}

.belt-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: repeating-linear-gradient(
        90deg,
        rgba(99, 102, 241, 0.3) 0px,
        rgba(99, 102, 241, 0.3) 10px,
        transparent 10px,
        transparent 20px
    );
    animation: beltMove 1.5s linear infinite;
    top: 50%;
    transform: translateY(-50%);
}

.belt-line-2 {
    top: 30%;
    animation-delay: 0.5s;
}

.belt-line-3 {
    top: 70%;
    animation-delay: 1s;
}

@keyframes beltMove {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 20px 0;
    }
}

.transfer-arrow {
    position: absolute;
    width: 100%;
    height: 4px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

.arrow-line {
    position: absolute;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, 
        rgba(99, 102, 241, 0.4) 0%, 
        rgba(99, 102, 241, 0.9) 50%, 
        rgba(99, 102, 241, 0.4) 100%);
    animation: arrowFlow 2s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

@keyframes arrowFlow {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

.arrow-head {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 16px solid #6366F1;
    filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.9));
    animation: arrowPulse 2s ease-in-out infinite;
}

@keyframes arrowPulse {
    0%, 100% {
        opacity: 0.8;
        transform: translateY(-50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateY(-50%) scale(1.2);
    }
}

.moving-boxes {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.moving-box {
    position: absolute;
    width: 40px;
    height: 32px;
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #3B82F6 100%);
    border-radius: 6px;
    box-shadow: 
        0 3px 12px rgba(99, 102, 241, 0.7),
        0 0 20px rgba(99, 102, 241, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    top: 50%;
    transform: translateY(-50%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.moving-box::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 25px;
    height: 2px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 1px;
}

.moving-box::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 25px;
    height: 2px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 1px;
}

.box-moving-1 {
    animation: moveBox1 2.5s ease-in-out infinite;
    left: -40px;
}

.box-moving-2 {
    animation: moveBox2 2.5s ease-in-out infinite;
    animation-delay: 1.25s;
    left: -40px;
}

@keyframes moveBox1 {
    0% {
        left: -40px;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        left: calc(100% + 40px);
        opacity: 0;
    }
}

@keyframes moveBox2 {
    0% {
        left: -40px;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        left: calc(100% + 40px);
        opacity: 0;
    }
}

.transfer-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.transfer-particles .particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(99, 102, 241, 0.8);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.6);
    top: 50%;
    animation: particleMove 2s ease-in-out infinite;
}

.transfer-particles .particle:nth-child(1) {
    animation-delay: 0s;
    left: 20%;
}

.transfer-particles .particle:nth-child(2) {
    animation-delay: 0.7s;
    left: 50%;
}

.transfer-particles .particle:nth-child(3) {
    animation-delay: 1.4s;
    left: 80%;
}

@keyframes particleMove {
    0% {
        transform: translateY(-50%) translateX(0) scale(0);
        opacity: 0;
    }
    50% {
        transform: translateY(-50%) translateX(20px) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-50%) translateX(40px) scale(0);
        opacity: 0;
    }
}

/* Texte de chargement */
.loading-text {
    margin-bottom: 2.5rem;
}

.loading-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    color: #ffffff;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    text-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

.loading-subtitle {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* Barre de progression */
.loading-progress-container {
    width: 100%;
}

.loading-progress-bar {
    position: relative;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-line {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        #6366F1 30%,
        #8B5CF6 50%,
        #6366F1 70%,
        transparent 100%);
    animation: progressLine 3s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.8);
}

@keyframes progressLine {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.loading-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-item i {
    color: #6366F1;
    font-size: 0.9rem;
}

.stat-value {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

/* Responsive */
@media (max-width: 768px) {
    .loading-modal-content {
        padding: 2rem 1.5rem;
        max-width: 95%;
    }
    
    .loading-transfer-animation {
        max-width: 100%;
        height: 200px;
        padding: 0 0.5rem;
    }
    
    .location-box {
        width: 130px;
        height: 180px;
        padding: 0.6rem;
    }
    
    .stock-box {
        width: 45px;
        height: 36px;
    }
    
    .transfer-zone {
        width: 150px;
    }
    
    .moving-box {
        width: 32px;
        height: 26px;
    }
    
    .location-label {
        font-size: 0.65rem;
    }
    
    .box-label {
        font-size: 0.55rem;
    }
    
    .loading-title {
        font-size: 1.5rem;
        letter-spacing: 1.5px;
    }
    
    .loading-subtitle {
        font-size: 0.85rem;
    }
    
    .loading-stats {
        gap: 1.5rem;
        font-size: 0.75rem;
    }
}


