/* =========================================
   App Prepa Yonis — Design System
   Thème Sombre & Thème Clair (Switchable)
   ========================================= */

:root, [data-theme="dark"] {
    color-scheme: dark;
    /* Palette principale sombre */
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --bg-card-hover: #1a2745;
    --bg-input: #0a0a15;
    --bg-navbar: rgba(15, 15, 26, 0.85);
    --bg-tabs: rgba(15, 15, 26, 0.6);

    /* Accents */
    --accent-primary: #e94560;
    --accent-primary-glow: rgba(233, 69, 96, 0.3);
    --accent-secondary: #0f3460;
    --accent-success: #00d68f;
    --accent-success-glow: rgba(0, 214, 143, 0.3);
    --accent-warning: #ffaa00;
    --accent-warning-glow: rgba(255, 170, 0, 0.3);
    --accent-danger: #ff3d71;
    --accent-info: #00b4d8;

    /* Texte */
    --text-primary: #e8e8f0;
    --text-secondary: #8b8ba3;
    --text-muted: #5a5a7a;
    --text-inverse: #0f0f1a;

    /* Bordures */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-active: rgba(233, 69, 96, 0.4);

    /* Ombres */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--accent-primary-glow);

    /* Dimensions */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-smooth: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

[data-theme="light"] {
    color-scheme: light;
    /* Palette principale claire */
    --bg-primary: #f1f5f9;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-input: #ffffff;
    --bg-navbar: rgba(255, 255, 255, 0.95);
    --bg-tabs: #ffffff;

    /* Accents */
    --accent-primary: #e11d48;
    --accent-primary-glow: rgba(225, 29, 72, 0.18);
    --accent-secondary: #e2e8f0;
    --accent-success: #059669;
    --accent-success-glow: rgba(5, 150, 105, 0.18);
    --accent-warning: #d97706;
    --accent-warning-glow: rgba(217, 119, 6, 0.18);
    --accent-danger: #dc2626;
    --accent-info: #0284c7;

    /* Texte */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-inverse: #ffffff;

    /* Bordures */
    --border-color: #cbd5e1;
    --border-active: #94a3b8;

    /* Ombres */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 20px rgba(225, 29, 72, 0.15);
}

/* =========================================
   Reset & Base
   ========================================= */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Fond animé subtil */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(233, 69, 96, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(15, 52, 96, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

#app {
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

/* =========================================
   Contrôles de formulaire & Inputs
   ========================================= */
input, select, textarea, .form-control, .filter-select, .col-filter-select, .search-input {
    font-family: inherit;
    color: var(--text-primary) !important;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

select, .filter-select, .col-filter-select {
    cursor: pointer;
}

/* Haute Lisibilité pour les options des listes déroulantes (Selects / Dropdowns) */
option, optgroup, 
select option, select optgroup, 
.form-control option, .filter-select option, .col-filter-select option, .search-input option {
    background-color: #16213e !important;
    color: #f1f5f9 !important;
    padding: 8px 12px;
    font-size: 0.92rem;
    font-weight: 500;
}

option:hover, option:focus, option:checked,
select option:hover, select option:focus, select option:checked,
.form-control option:checked, .filter-select option:checked {
    background-color: #273966 !important;
    color: #ffffff !important;
}

[data-theme="light"] input, 
[data-theme="light"] select, 
[data-theme="light"] textarea, 
[data-theme="light"] .form-control, 
[data-theme="light"] .filter-select,
[data-theme="light"] .col-filter-select,
[data-theme="light"] .search-input {
    color: #0f172a !important;
    background-color: #ffffff;
    border-color: var(--border-color);
}

[data-theme="light"] option, 
[data-theme="light"] optgroup, 
[data-theme="light"] select option, 
[data-theme="light"] select optgroup, 
[data-theme="light"] .form-control option, 
[data-theme="light"] .filter-select option,
[data-theme="light"] .col-filter-select option,
[data-theme="light"] .search-input option {
    background-color: #ffffff !important;
    color: #0f172a !important;
}

[data-theme="light"] option:hover, 
[data-theme="light"] option:focus, 
[data-theme="light"] option:checked,
[data-theme="light"] select option:hover, 
[data-theme="light"] select option:focus, 
[data-theme="light"] select option:checked,
[data-theme="light"] .form-control option:checked,
[data-theme="light"] .filter-select option:checked {
    background-color: #e2e8f0 !important;
    color: #0f172a !important;
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.85;
}

input:focus, select:focus, textarea:focus, .form-control:focus, .filter-select:focus, .col-filter-select:focus, .search-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-primary-glow);
}

/* =========================================
   Login Screen
   ========================================= */

.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.5s var(--transition-smooth);
}

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

.login-logo {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo h1 {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-info));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.login-logo p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 4px;
}

.login-field {
    margin-bottom: 20px;
}

.login-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.login-field select,
.login-field input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 1rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
}

.login-field select:focus,
.login-field input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

.pin-input-group {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.pin-digit {
    width: 56px;
    height: 64px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    outline: none;
}

.pin-digit:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-glow);
    transform: scale(1.05);
}

.pin-digit.filled {
    border-color: var(--accent-success);
    background: rgba(0, 214, 143, 0.05);
}

.login-btn {
    width: 100%;
    padding: 16px;
    margin-top: 24px;
    background: linear-gradient(135deg, var(--accent-primary), #d63851);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-normal);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.login-btn:active {
    transform: translateY(0);
}

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

.login-error {
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(255, 61, 113, 0.1);
    border: 1px solid rgba(255, 61, 113, 0.3);
    border-radius: var(--radius-sm);
    color: var(--accent-danger);
    font-size: 0.875rem;
    text-align: center;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* =========================================
   Navigation
   ========================================= */

.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--bg-navbar);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-normal), border-color var(--transition-normal);
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-info));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    cursor: pointer;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Bouton Toggle Thème Jour/Nuit */
.theme-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.theme-toggle-btn:hover {
    border-color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.config-active-btn {
    background: linear-gradient(135deg, var(--accent-primary), #7b61ff) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 2px 10px rgba(225, 29, 72, 0.35) !important;
}

.theme-label {
    font-weight: 600;
}

.navbar-user-info {
    text-align: right;
}

.navbar-user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.navbar-user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.navbar-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
}

.btn-logout {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-logout:hover {
    border-color: var(--accent-danger);
    color: var(--accent-danger);
}

/* =========================================
   Badges Système & ID Produit Haute Lisibilité
   ========================================= */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.badge.mono, .badge-id-produit {
    font-family: 'JetBrains Mono', Consolas, monospace, sans-serif;
    font-weight: 800;
}

.badge-id-produit {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    border-radius: 6px;
    padding: 3px 8px;
    letter-spacing: 0.3px;
    background: #4338ca;
    color: #ffffff !important;
    border: 1px solid #6366f1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .badge-id-produit {
    background: #4338ca !important;
    color: #ffffff !important;
    border: 1px solid #312e81 !important;
    box-shadow: 0 1px 3px rgba(67, 56, 202, 0.25);
}

[data-theme="dark"] .badge-id-produit {
    background: #4338ca !important;
    color: #ffffff !important;
    border: 1px solid #6366f1 !important;
}

.badge-success {
    background: rgba(0, 214, 143, 0.18);
    color: var(--accent-success);
    border: 1px solid rgba(0, 214, 143, 0.35);
}

.badge-danger {
    background: rgba(255, 61, 113, 0.18);
    color: var(--accent-danger);
    border: 1px solid rgba(255, 61, 113, 0.35);
}

.badge-warning {
    background: rgba(255, 170, 0, 0.18);
    color: var(--accent-warning);
    border: 1px solid rgba(255, 170, 0, 0.35);
}

.badge-info {
    background: rgba(0, 180, 216, 0.18);
    color: var(--accent-info);
    border: 1px solid rgba(0, 180, 216, 0.35);
}

/* =========================================
   Dashboard
   ========================================= */

.dashboard {
    padding: 12px 16px;
    max-width: 100%;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
}

.dashboard-header {
    margin-bottom: 32px;
}

.dashboard-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.dashboard-header p {
    color: var(--text-secondary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-normal);
    cursor: default;
}

.stat-card:hover {
    border-color: var(--border-active);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.stat-card-icon.primary { background: rgba(233, 69, 96, 0.1); }
.stat-card-icon.success { background: rgba(0, 214, 143, 0.1); }
.stat-card-icon.warning { background: rgba(255, 170, 0, 0.1); }
.stat-card-icon.info { background: rgba(0, 180, 216, 0.1); }

.stat-card-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Actions rapides */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
}

.action-btn:hover {
    border-color: var(--accent-primary);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.action-btn .icon {
    font-size: 1.5rem;
}

.action-btn.primary {
    background: linear-gradient(135deg, var(--accent-primary), #d63851);
    border-color: transparent;
    color: white;
}

.action-btn.primary:hover {
    box-shadow: var(--shadow-glow);
}

/* =========================================
   Responsive
   ========================================= */

@media (max-width: 768px) {
    .navbar {
        padding: 10px 16px;
    }

    .dashboard {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

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

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .login-container {
        padding: 32px 24px;
    }

    .pin-digit {
        width: 48px;
        height: 56px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   Utilities
   ========================================= */

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: rgba(0, 214, 143, 0.15); color: var(--accent-success); }
.badge-warning { background: rgba(255, 170, 0, 0.15); color: var(--accent-warning); }
.badge-danger { background: rgba(255, 61, 113, 0.15); color: var(--accent-danger); }
.badge-info { background: rgba(0, 180, 216, 0.15); color: var(--accent-info); }

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100020;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    animation: slideIn 0.3s ease;
    box-shadow: var(--shadow-md);
    max-width: 400px;
}

.toast-success { background: rgba(0, 214, 143, 0.15); border: 1px solid rgba(0, 214, 143, 0.3); color: var(--accent-success); }
.toast-error { background: rgba(255, 61, 113, 0.15); border: 1px solid rgba(255, 61, 113, 0.3); color: var(--accent-danger); }
.toast-info { background: rgba(0, 180, 216, 0.15); border: 1px solid rgba(0, 180, 216, 0.3); color: var(--accent-info); }

@keyframes slideIn {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

/* =========================================
   Navigation Tabs
   ========================================= */

.nav-tabs {
    display: flex;
    gap: 0;
    padding: 0 16px;
    background: var(--bg-tabs);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.nav-tab {
    padding: 12px 16px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.nav-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

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

/* =========================================
   Data Tables
   ========================================= */

.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    width: 100%;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.data-table thead th {
    padding: 6px 3px;
    text-align: left;
    font-weight: 600;
    font-size: 0.70rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.sortable-th {
    cursor: pointer;
    user-select: none;
    transition: all var(--transition-fast);
}

.sortable-th:hover {
    color: var(--accent-primary) !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

.sort-icon {
    display: inline-block;
    margin-left: 2px;
    font-size: 0.65rem;
    opacity: 0.6;
    transition: transform var(--transition-fast);
}

.sortable-th:hover .sort-icon {
    opacity: 1;
    color: var(--accent-primary);
}

.data-table th, .data-table td {
    min-width: 0;
    box-sizing: border-box;
}

.filter-header-row th {
    padding: 2px 2px !important;
    background: rgba(0, 0, 0, 0.35) !important;
    border-bottom: 2px solid var(--border-color) !important;
    min-width: 0 !important;
}

.col-filter-input, .col-filter-select {
    width: 100%;
    min-width: 0 !important;
    max-width: 100%;
    padding: 2px 3px;
    font-size: 0.68rem;
    height: 22px;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-sizing: border-box;
    transition: all var(--transition-fast);
}

.col-filter-input:focus, .col-filter-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 1px var(--accent-primary);
}

.col-filter-input::placeholder {
    color: var(--text-muted);
    font-size: 0.65rem;
}

.data-table tbody td {
    padding: 3px 3px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    font-size: 0.75rem;
}

.stock-inline-input {
    width: 28px;
    height: 20px;
    text-align: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    padding: 0 1px;
}

/* Product Thumbnails & Lightbox Zoom */
.product-thumb {
    width: 48px;
    height: 48px;
    min-width: 48px;
    object-fit: contain;
    background: #ffffff;
    border-radius: var(--radius-sm);
    padding: 2px;
    border: 1px solid var(--border-color);
    cursor: zoom-in;
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease, border-color 0.22s ease;
    flex-shrink: 0;
    vertical-align: middle;
}

.product-thumb:hover {
    transform: scale(2.0);
    border-color: var(--accent-primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.75);
    z-index: 50;
    position: relative;
}

.product-thumb-placeholder {
    width: 48px;
    height: 48px;
    min-width: 48px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-muted);
    flex-shrink: 0;
    vertical-align: middle;
}

.product-cell-with-img {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 20, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
    animation: fadeIn 0.15s ease-out;
}

.lightbox-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    max-width: 550px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    position: relative;
    animation: scaleUp 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox-img {
    max-width: 100%;
    max-height: 460px;
    object-fit: contain;
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 8px;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
}

.lightbox-title {
    margin-top: 14px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.lightbox-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.lightbox-close:hover {
    background: var(--accent-danger);
    color: #fff;
}

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

.table-row-clickable {
    cursor: pointer;
    transition: background var(--transition-fast);
}

.table-row-clickable:hover {
    background: rgba(233, 69, 96, 0.05);
}

.data-table .mono {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.8rem;
}

.data-table .center {
    text-align: center;
}

.data-table .muted {
    color: var(--text-muted);
}

.data-table .flag {
    font-size: 1.1rem;
    margin-right: 4px;
}

.empty-state {
    text-align: center;
    padding: 40px 16px !important;
    color: var(--text-muted);
    font-style: italic;
}

/* =========================================
   Filters & Search
   ========================================= */

.search-input, .filter-select {
    padding: 10px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.875rem;
    outline: none;
    transition: border-color var(--transition-fast);
    min-width: 200px;
}

.search-input:focus, .filter-select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

.filter-select option {
    background: var(--bg-secondary);
}

/* =========================================
   Pagination
   ========================================= */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px;
}

.page-btn {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.page-btn:hover:not(:disabled) {
    border-color: var(--accent-primary);
    background: var(--bg-card-hover);
}

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

.page-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* =========================================
   Product Thumbnails
   ========================================= */

.product-thumb {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-name {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* =========================================
   Text colors
   ========================================= */

.text-success { color: var(--accent-success); font-weight: 600; }
.text-warning { color: var(--accent-warning); font-weight: 600; }
.text-danger { color: var(--accent-danger); font-weight: 600; }

/* =========================================
   Progress Bar
   ========================================= */

.progress-bar-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    height: 28px;
    margin: 16px 24px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-success), #00e676);
    border-radius: var(--radius-sm);
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    min-width: 40px;
}

/* =========================================
   Scan Zone
   ========================================= */

.scan-zone {
    margin: 0 24px 16px;
    padding: 20px;
    background: var(--bg-card);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
}

.scan-input-group {
    display: flex;
    gap: 12px;
}

.scan-input {
    flex: 1;
    padding: 16px 20px;
    font-size: 1.2rem;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition-fast);
}

.scan-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px var(--accent-primary-glow);
}

.scan-btn {
    padding: 16px 24px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.scan-btn:hover { filter: brightness(1.2); }

.scan-feedback {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-align: center;
    animation: slideIn 0.3s ease;
}

.scan-success {
    background: rgba(0, 214, 143, 0.15);
    border: 1px solid rgba(0, 214, 143, 0.3);
    color: var(--accent-success);
}

.scan-error {
    background: rgba(255, 61, 113, 0.15);
    border: 1px solid rgba(255, 61, 113, 0.3);
    color: var(--accent-danger);
}

/* =========================================
   Pick Cards
   ========================================= */

.pick-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin: 0 24px 12px;
    overflow: hidden;
    transition: all var(--transition-fast);
}

.current-pick {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-primary-glow), var(--shadow-lg);
}

.pick-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
}

.pick-location {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent-warning);
}

.pick-card-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    gap: 20px;
}

.pick-product-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 8px;
}

.pick-product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.pick-quantity {
    text-align: center;
    flex-shrink: 0;
}

.pick-qty-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-primary);
    line-height: 1;
}

.pick-qty-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.pick-card-actions {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
}

.pick-card-compact {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
}

.pick-location-sm {
    font-weight: 600;
    color: var(--accent-warning);
    min-width: 60px;
    font-size: 0.85rem;
}

.pick-name-sm {
    flex: 1;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pick-qty-sm {
    font-weight: 700;
    color: var(--accent-primary);
}

.pick-ean-sm {
    color: var(--text-muted);
    font-size: 0.8rem;
    min-width: 100px;
}

.pick-done {
    opacity: 0.4;
    border-color: var(--accent-success);
}

.pick-anomalie {
    opacity: 0.6;
    border-color: var(--accent-danger);
}

/* =========================================
   Modal
   ========================================= */

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    min-width: 350px;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
}

/* =========================================
   Result Card (génération lot)
   ========================================= */

.result-card {
    margin: 16px 24px;
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid;
}

.result-success {
    background: rgba(0, 214, 143, 0.08);
    border-color: rgba(0, 214, 143, 0.3);
}

.result-warning {
    background: rgba(255, 188, 66, 0.08);
    border-color: rgba(255, 188, 66, 0.3);
}

/* =========================================
   Config Screen
   ========================================= */

.config-panels {
    padding: 0;
}

.config-panel {
    margin: 16px 24px;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.config-panel h3 {
    margin-bottom: 16px;
    font-weight: 700;
}

.config-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

/* =========================================
   Emballage
   ========================================= */

.emballage-detail {
    padding: 0 24px;
}

.emballage-section {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.emballage-section:last-child {
    border-bottom: none;
}

.emballage-section h4 {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.emballage-ligne {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    font-size: 0.9rem;
}

/* =========================================
   Responsive Mobile
   ========================================= */

/* =========================================
   Modales & Overlays
   ========================================= */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 10, 20, 0.75);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 16px;
    animation: fadeIn 0.2s ease;
}

.modal-card,
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    animation: slideIn 0.25s ease;
}

.row-out {
    opacity: 0.85;
}

.row-out td.text-danger {
    color: #ff6b8b !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 768px) {
    .nav-tabs {
        padding: 0 8px;
        gap: 0;
    }
    .nav-tab {
        padding: 10px 12px;
        font-size: 0.8rem;
    }
    .dashboard {
        padding: 12px;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .data-table {
        font-size: 0.75rem;
    }
    .data-table thead th,
    .data-table tbody td {
        padding: 8px;
    }
    .pick-card-body {
        flex-direction: column;
    }
    .scan-input-group {
        flex-direction: column;
    }
    .config-panel {
        margin: 8px 12px;
        padding: 16px;
    }
}

/* =========================================
   THÈME CLAIR (MODE JOUR) — RÈGLES COMPLÈTES
   ========================================= */

[data-theme="light"] body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

[data-theme="light"] body::before {
    background: 
        radial-gradient(ellipse at 15% 40%, rgba(225, 29, 72, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 60%, rgba(2, 132, 199, 0.04) 0%, transparent 50%);
}

/* Navbar & Tabs */
[data-theme="light"] .navbar {
    background: var(--bg-navbar);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .nav-tabs {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .nav-tab {
    color: #475569;
}

[data-theme="light"] .nav-tab:hover {
    color: #0f172a;
    background: #f1f5f9;
}

[data-theme="light"] .nav-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
    background: rgba(225, 29, 72, 0.05);
}

/* Tableaux */
[data-theme="light"] .table-container {
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

[data-theme="light"] .data-table thead th {
    background: #f8fafc;
    color: #334155;
    border-bottom: 2px solid var(--border-color);
}

[data-theme="light"] .filter-header-row th {
    background: #f1f5f9 !important;
    border-bottom: 2px solid var(--border-color) !important;
}

[data-theme="light"] .col-filter-input, 
[data-theme="light"] .col-filter-select {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}

[data-theme="light"] .col-filter-input:focus, 
[data-theme="light"] .col-filter-select:focus {
    background: #ffffff;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(225, 29, 72, 0.15);
}

[data-theme="light"] .data-table tbody td {
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
}

[data-theme="light"] .data-table tbody tr:hover {
    background: #f8fafc;
}

[data-theme="light"] .table-row-clickable:hover {
    background: #f1f5f9;
}

[data-theme="light"] .data-table .muted {
    color: #64748b;
}

/* Cartes & Boutons */
[data-theme="light"] .stat-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

[data-theme="light"] .stat-card:hover {
    background: #ffffff;
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
}

[data-theme="light"] .action-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    box-shadow: var(--shadow-sm);
}

[data-theme="light"] .action-btn:hover {
    background: #f8fafc;
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
}

[data-theme="light"] .action-btn.primary {
    background: linear-gradient(135deg, var(--accent-primary), #be123c);
    color: #ffffff;
    border-color: transparent;
}

/* Inputs, Recherche et Selects */
[data-theme="light"] .search-input,
[data-theme="light"] .filter-select {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}

[data-theme="light"] .search-input:focus,
[data-theme="light"] .filter-select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.15);
}

[data-theme="light"] .filter-select option {
    background: #ffffff;
    color: #0f172a;
}

/* Badges */
[data-theme="light"] .badge-info {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

[data-theme="light"] .badge-success {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

[data-theme="light"] .badge-warning {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

[data-theme="light"] .badge-danger {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

[data-theme="light"] .badge-primary {
    background: #ffe4e6;
    color: #be123c;
    border: 1px solid #fecdd3;
}

[data-theme="light"] .badge-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

/* Modales & Lightbox */
[data-theme="light"] .modal-overlay {
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(8px);
}

[data-theme="light"] .modal-card,
[data-theme="light"] .modal-content {
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.15);
    color: #0f172a;
}

[data-theme="light"] .lightbox-overlay {
    background: rgba(15, 23, 42, 0.7);
}

[data-theme="light"] .lightbox-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.2);
    color: #0f172a;
}

/* Écran Picking Express */
[data-theme="light"] .pick-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    box-shadow: var(--shadow-sm);
}

[data-theme="light"] .pick-card.current-pick {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(225, 29, 72, 0.25), var(--shadow-md);
}

[data-theme="light"] .pick-card-header {
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
}

[data-theme="light"] .pick-location {
    color: #b45309;
}

[data-theme="light"] .scan-zone {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
}

[data-theme="light"] .scan-input {
    background: #ffffff;
    border: 2px solid #cbd5e1;
    color: #0f172a;
}

[data-theme="light"] .scan-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.15);
}

/* Config & Panneaux */
[data-theme="light"] .config-panel {
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

/* Login Screen */
[data-theme="light"] .login-container {
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

[data-theme="light"] .pin-digit {
    background: #f8fafc;
    border: 2px solid #cbd5e1;
    color: #0f172a;
}

[data-theme="light"] .pin-digit:focus {
    background: #ffffff;
    border-color: var(--accent-primary);
}

/* Neutralisation et harmonisation des fonds imbriqués en mode clair */
[data-theme="light"] [style*="background:rgba(0,0,0"],
[data-theme="light"] [style*="background: rgba(0,0,0"],
[data-theme="light"] [style*="background:rgba(0, 0, 0"],
[data-theme="light"] [style*="background: rgba(0, 0, 0"] {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #1e293b !important;
}

[data-theme="light"] img[style*="background:rgba(0,0,0"],
[data-theme="light"] img[style*="background: rgba(0,0,0"],
[data-theme="light"] img[style*="background:rgba(0, 0, 0"],
[data-theme="light"] img[style*="background: rgba(0, 0, 0"] {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
}

[data-theme="light"] .pick-card-actions {
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .pagination-footer {
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
}

/* Stock direct inline input */
.stock-inline-input {
    width: 52px;
    height: 26px;
    text-align: center;
    padding: 2px 4px;
    font-size: 0.88rem;
    font-weight: 700;
    font-family: var(--font-mono, monospace);
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: inherit;
    outline: none;
    transition: all 0.2s ease;
    -moz-appearance: textfield;
}

.stock-inline-input::-webkit-outer-spin-button,
.stock-inline-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.stock-inline-input:focus {
    border-color: var(--accent-primary, #6366f1);
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.35);
}

[data-theme="light"] .stock-inline-input {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

[data-theme="light"] .stock-inline-input:focus {
    background: #ffffff;
    border-color: var(--accent-primary, #6366f1);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Animation et Surbrillance intense pour la ligne de réception scannée */
.ligne-scanne-active {
    background: rgba(0, 214, 143, 0.18) !important;
    border-left: 6px solid var(--accent-success, #00d68f) !important;
    box-shadow: 0 0 22px rgba(0, 214, 143, 0.45) !important;
    position: relative;
    z-index: 5;
    transition: background 0.3s ease, border-left 0.2s ease, box-shadow 0.3s ease;
}

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

.badge-scan-active {
    background: var(--accent-success, #00d68f);
    color: #000;
    font-weight: 900;
    font-size: 0.72rem;
    padding: 2px 7px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    animation: scanPulse 1.4s infinite;
}

/* =========================================
   Barre d'Actions Flottante Groupée (Bulk Actions)
   ========================================= */
.bulk-floating-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 20px var(--accent-primary-glow);
    border-radius: var(--radius-lg);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 1000;
    backdrop-filter: blur(16px);
    animation: slideUpFloating 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpFloating {
    from { opacity: 0; transform: translate(-50%, 25px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.bulk-badge {
    background: var(--accent-primary);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 5px 14px;
    border-radius: 20px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.selected-product-row {
    background: rgba(233, 69, 96, 0.1) !important;
    border-left: 4px solid var(--accent-primary) !important;
}

[data-theme="light"] .selected-product-row {
    background: rgba(225, 29, 72, 0.09) !important;
    border-left: 4px solid var(--accent-primary) !important;
}

/* ============================================================ */
/* ALERTE BUNDLE / ACCESSOIRES / CARTES MÉMOIRE (DARK & LIGHT) */
/* ============================================================ */
.bundle-alert-container {
    margin-top: 14px;
    padding: 14px 18px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18) 0%, rgba(217, 119, 6, 0.28) 100%);
    border: 2px solid #f59e0b;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.25);
}

.bundle-alert-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    font-size: 1.05rem;
    color: #fbbf24;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.bundle-alert-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bundle-alert-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    background: rgba(15, 23, 42, 0.85);
    padding: 10px 14px;
    border-radius: 9px;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.bundle-alert-name {
    font-weight: 800;
    font-size: 0.98rem;
    color: #ffffff;
}

.bundle-alert-qty {
    color: #fcd34d;
    font-weight: 900;
    font-size: 1.15rem;
    margin-right: 4px;
}

.bundle-alert-notes {
    font-size: 0.8rem;
    color: #cbd5e1;
    margin-top: 2px;
}

.bundle-alert-loc {
    font-size: 0.92rem;
    font-weight: 900;
    padding: 6px 14px;
    border-radius: 7px;
    background: #1e1b4b;
    color: #c7d2fe;
    border: 1px solid #6366f1;
    white-space: nowrap;
}

.bundle-alert-stock {
    background: #059669;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.78rem;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

/* --- LIGHT MODE OVERRIDES (MODE JOUR) --- */
[data-theme="light"] .bundle-alert-container {
    background: #fffbeb !important;
    border: 2px solid #b45309 !important;
    box-shadow: 0 4px 16px rgba(180, 83, 9, 0.15) !important;
}

[data-theme="light"] .bundle-alert-header {
    color: #9a3412 !important;
    font-weight: 900 !important;
}

[data-theme="light"] .bundle-alert-item {
    background: #ffffff !important;
    border: 1px solid #f59e0b !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .bundle-alert-name {
    color: #0f172a !important;
    font-weight: 800 !important;
}

[data-theme="light"] .bundle-alert-qty {
    color: #c2410c !important;
    font-weight: 900 !important;
}

[data-theme="light"] .bundle-alert-notes {
    color: #475569 !important;
    font-weight: 600 !important;
}

[data-theme="light"] .bundle-alert-loc {
    background: #e0e7ff !important;
    color: #312e81 !important;
    border: 1px solid #6366f1 !important;
    font-weight: 900 !important;
}

[data-theme="light"] .bundle-alert-stock {
    background: #047857 !important;
    color: #ffffff !important;
    font-weight: 800 !important;
}

/* =====================================================
   FEEDBACK & BUG REPORT SYSTEM (In-App)
   ===================================================== */

/* Floating Action Button (FAB) */
.feedback-fab-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100000;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}

.feedback-fab-container.capturing {
    opacity: 0 !important;
    pointer-events: none !important;
}

.feedback-fab {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #e11d48, #be123c);
    color: #ffffff;
    border: none;
    padding: 10px 16px;
    border-radius: 9999px;
    box-shadow: 0 4px 18px rgba(225, 29, 72, 0.45), 0 2px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    font-weight: 800;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.feedback-fab:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 6px 24px rgba(225, 29, 72, 0.6), 0 3px 8px rgba(0, 0, 0, 0.3);
}

.feedback-fab-icon {
    font-size: 1.15rem;
    line-height: 1;
}

/* Feedback Modal Backdrop & Card */
.feedback-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(6, 10, 20, 0.88);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100010;
    backdrop-filter: blur(8px);
    padding: 10px;
    box-sizing: border-box;
}

.feedback-modal-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    width: 98vw;
    max-width: 98vw;
    height: 96vh;
    max-height: 96vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
    overflow: hidden;
}

.feedback-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    flex-shrink: 0;
}

.feedback-modal-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 14px;
    padding: 12px 16px 14px 16px;
    min-height: 0;
}

@media (max-width: 900px) {
    .feedback-modal-body {
        flex-direction: column;
        overflow-y: auto;
    }
}

/* Canvas Column (Grand Format Plein Écran) */
.feedback-canvas-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
}

.feedback-tools-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.feedback-toolbar-separator {
    width: 1px;
    height: 22px;
    background: var(--border-color);
    margin: 0 4px;
}

.feedback-tool-btn {
    padding: 5px 10px;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
}

.feedback-tool-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.feedback-tool-btn.active {
    background: var(--accent-primary);
    color: #ffffff;
    border-color: var(--accent-primary);
    box-shadow: 0 2px 8px rgba(123, 97, 255, 0.4);
}

/* Boutons de Palette de Couleur */
.color-dot-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease;
    padding: 0;
}

.color-dot-btn:hover {
    transform: scale(1.15);
}

.color-dot-btn.active {
    border-color: #ffffff;
    box-shadow: 0 0 0 2px var(--accent-primary);
    transform: scale(1.2);
}

/* Boutons d'épaisseur de trait */
.stroke-size-btn {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.stroke-size-btn span {
    border-radius: 50%;
    display: inline-block;
}

.stroke-size-btn.active {
    border-color: var(--accent-primary);
    background: rgba(123, 97, 255, 0.15);
}

/* Boutons de Zoom */
.zoom-btn {
    padding: 3px 8px;
    font-size: 0.78rem;
    font-weight: 800;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
}

.zoom-preset-btn {
    padding: 3px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
}

.zoom-preset-btn.active {
    background: var(--accent-primary);
    color: #ffffff;
    border-color: var(--accent-primary);
}

.feedback-canvas-wrapper {
    flex: 1;
    position: relative;
    background: #080c14;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 12px;
    min-height: 0;
    max-height: none;
    -webkit-overflow-scrolling: touch;
}

.feedback-canvas-inner {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin: auto;
}

.feedback-canvas-wrapper canvas {
    cursor: crosshair;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    background: #ffffff;
    display: block;
}

.canvas-hint {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.92);
    color: #f8fafc;
    padding: 8px 18px;
    border-radius: 24px;
    font-size: 0.82rem;
    font-weight: 600;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    max-width: 90%;
    text-align: center;
    z-index: 10;
}

/* Form Column (Volet compact à droite) */
.feedback-form-column {
    width: 320px;
    flex: 0 0 320px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px;
    box-sizing: border-box;
    overflow-y: auto;
}

.feedback-categories-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.feedback-cat-btn {
    padding: 7px 8px;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.feedback-cat-btn.active {
    background: rgba(225, 29, 72, 0.18);
    border-color: #e11d48;
    color: #f43f5e;
    font-weight: 800;
}

.feedback-tech-summary {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 10px;
}

/* ADMIN MODAL */
.feedback-admin-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 95vw;
    max-width: 1180px;
    height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.feedback-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
}

.feedback-admin-stats {
    display: flex;
    gap: 8px;
}

.feedback-admin-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 8px;
}

.feedback-admin-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.feedback-admin-list {
    flex: 0.9;
    max-width: 360px;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    background: var(--bg-secondary);
}

.feedback-admin-item {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.15s ease;
}

.feedback-admin-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.feedback-admin-item.active {
    background: rgba(225, 29, 72, 0.12);
    border-left: 4px solid #e11d48;
}

.feedback-admin-detail {
    flex: 1.1;
    padding: 16px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.feedback-admin-desc-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 14px;
}

.feedback-admin-actions-box {
    margin-top: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 14px;
}

.feedback-nav-badge-btn {
    position: relative;
    border-color: rgba(225, 29, 72, 0.4) !important;
}

.feedback-nav-badge-btn:hover {
    border-color: #e11d48 !important;
}

/* =========================================
   Infobulles Stock & Badges
   ========================================= */

.info-bubble {
    display: inline-block;
    cursor: help;
    font-size: 0.72rem;
    opacity: 0.75;
    margin-left: 2px;
    transition: opacity 0.2s, transform 0.2s;
    user-select: none;
}

.info-bubble:hover {
    opacity: 1;
    transform: scale(1.2);
}
