/* --- DESIGN SYSTEM CHANV OFFICIAL --- */
:root {
    /* Palette Officielle */
    --chanv-blanc: #FFFFFF;
    --chanv-beige: #DDCBA4;
    --chanv-fibre: #F1EADA;
    --chanv-terre: #282828;

    /* Variables Fonctionnelles */
    --bg-main: var(--chanv-blanc);
    --bg-alternate: var(--chanv-fibre);
    --text-main: var(--chanv-terre);
    --accent: var(--chanv-beige);

    --glass-bg: rgba(255, 255, 255, 0.9);
    --shadow-soft: 0 4px 20px rgba(40, 40, 40, 0.05);
    --shadow-bold: 0 12px 40px rgba(40, 40, 40, 0.1);
    --radius: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--chanv-blanc);
    /* 70% Blanc pour la respiration */
    background-image: radial-gradient(var(--chanv-fibre) 1px, transparent 1px);
    background-size: 40px 40px;
    background-attachment: fixed;
    color: var(--text-main);
    /* Terre pour le texte */
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

h1,
h2,
h3,
.section-num {
    font-family: 'Outfit', sans-serif;
}

/* --- HEADER --- */
.main-header {
    background: var(--chanv-terre);
    color: var(--chanv-blanc);
    padding: 40px 20px 90px;
    position: relative;
    overflow: hidden;
}

.main-header::after {
    content: '';
    position: absolute;
    bottom: -50px;
    left: 0;
    width: 100%;
    height: 100px;
    background: var(--chanv-blanc);
    transform: skewY(-2deg);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
    position: relative;
    z-index: 10;
    flex-wrap: wrap;
}

/* --- HEADER USER SECTION --- */
.header-user-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-logout:hover {
    background: rgba(229, 62, 62, 0.25);
    color: #fff;
}

.auth-btn {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.9);
    font-size: 13px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--transition);
}

.auth-btn:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

#user-email-display {
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    font-weight: 500;
}

.logo-wrapper {
    text-decoration: none;
    display: flex;
    align-items: center;
    background: var(--chanv-fibre);
    padding: 12px 18px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
    flex-shrink: 0;
}

.logo-wrapper:hover {
    filter: brightness(0.97);
    box-shadow: var(--shadow-bold);
}

.main-logo {
    height: 40px;
    display: block;
}

.user-details {
    text-align: right;
}

.header-user-section .user-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.header-user-section .user-role {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.6);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
    object-fit: cover;
}

.header-titles h1 {
    font-size: 20px;
    font-weight: 700;
    color: white;
    margin: 0;
    line-height: 1.2;
}

.header-titles p {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-top: 4px;
    opacity: 0.7;
}

/* --- AVATAR-BURGER BUTTON --- */
.avatar-burger-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.avatar-burger-inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 14px 5px 5px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: var(--transition);
}

.avatar-burger-btn:hover .avatar-burger-inner {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.avatar-burger-btn .user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    object-fit: cover;
    transition: var(--transition);
}

.avatar-burger-btn:hover .user-avatar {
    border-color: rgba(255, 255, 255, 0.5);
}

.avatar-burger-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 16px;
}

.avatar-burger-icon span {
    display: block;
    height: 2px;
    width: 100%;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 2px;
    transition: var(--transition);
}

.avatar-burger-icon span:nth-child(2) {
    width: 70%;
}

.avatar-burger-btn:hover .avatar-burger-icon span {
    background: white;
}

.avatar-burger-btn:hover .avatar-burger-icon span:nth-child(2) {
    width: 100%;
}

/* --- UNIVERSAL SIDEBAR --- */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.open {
    opacity: 1;
}

.sidebar-panel {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background: var(--chanv-terre);
    z-index: 9999;
    padding: 0;
    display: flex;
    flex-direction: column;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.3);
}

.sidebar-panel.open {
    right: 0;
}

.sidebar-header {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 36px 24px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, transparent 100%);
}

.sidebar-avatar {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 3px rgba(221, 203, 164, 0.3), 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
}

.sidebar-name {
    font-family: 'Outfit', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: white;
    text-align: center;
}

.sidebar-role {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.5);
}

.sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 24px;
    -webkit-overflow-scrolling: touch;
}

.sidebar-favs {
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-favs-title {
    font-family: 'Outfit', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.4);
    padding: 0 0 12px;
}

.sidebar-favs-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-fav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-fav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    transform: translateX(4px);
}

.sidebar-fav-icon {
    font-size: 16px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-fav-img {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.sidebar-no-favs {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.35);
    font-style: italic;
    padding: 8px 0;
}

.sidebar-logout {
    flex-shrink: 0;
    width: calc(100% - 48px);
    margin: 0 24px 24px;
    justify-content: center;
    padding: 12px;
    font-size: 14px;
}

@media (max-width: 768px) {
    .sidebar-panel {
        width: 280px;
        right: -280px;
    }
    .sidebar-avatar {
        width: 60px;
        height: 60px;
    }
    .sidebar-name {
        font-size: 15px;
    }
}

/* --- HELP BUTTON --- */
.help-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    font-family: 'Outfit', sans-serif;
    transition: var(--transition);
    flex-shrink: 0;
}

.help-link:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

/* --- MOBILE HEADER --- */
@media (max-width: 768px) {
    .main-header {
        padding: 20px 16px 50px;
    }
    .main-header::after {
        height: 60px;
        bottom: -30px;
    }
    .header-container {
        flex-direction: column;
        text-align: center;
        position: relative;
    }
    .header-user-section {
        position: absolute;
        top: 0;
        right: 0;
        margin: 0;
    }
    .header-titles p { font-size: 10px; }
    .help-link { display: none; }
    .user-details { display: none !important; }
    .avatar-burger-inner { padding: 3px 10px 3px 3px; }
    .avatar-burger-photo, .avatar-burger-btn .user-avatar { width: 30px; height: 30px; }
    .avatar-burger-icon { width: 14px; gap: 3px; }
}

/* --- LAYOUT --- */
.container {
    max-width: 1200px;
    margin: -10px auto 60px auto;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

/* --- SECTION CARDS --- */
.section-card {
    background: var(--chanv-blanc);
    border: 1px solid var(--chanv-fibre);
    border-radius: var(--radius-lg);
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-soft);
    animation: fadeIn 0.6s ease-out both;
    animation-delay: var(--delay);
    position: relative;
}

/* Quand un dropdown autocomplete est ouvert dans une section, la faire
   passer au-dessus des sections suivantes (l'animation translateY crée
   un stacking context par carte, ce qui piège le dropdown sinon).
   Le sélecteur couvre à la fois le dropdown SKU et le dropdown Lot MP
   (tous deux utilisent la classe .sku-dropdown). */
.section-card:has(.sku-dropdown:not(.hidden)) {
    z-index: 100;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 35px;
    border-bottom: 2px solid var(--chanv-fibre);
    padding-bottom: 20px;
}

.section-num {
    color: var(--chanv-terre);
    font-size: 13px;
    font-weight: 700;
    background: var(--chanv-fibre);
    padding: 6px 12px;
    border-radius: 8px;
    letter-spacing: 1px;
}

.section-card h2 {
    margin: 0;
    font-size: 22px;
    color: var(--chanv-terre);
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* --- GRIDS --- */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
}

@media (max-width: 768px) {

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* --- FORM ELEMENTS --- */
.form-group {
    margin-bottom: 25px;
}

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

label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--chanv-terre);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}

.label-required::after {
    content: '*';
    color: #E53E3E;
    margin-left: 4px;
    font-size: 16px;
    vertical-align: middle;
}

input,
select,
textarea {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid var(--chanv-fibre);
    border-radius: 12px;
    background: var(--chanv-blanc);
    font-size: 15px;
    transition: var(--transition);
    color: var(--chanv-terre);
    font-family: 'Inter', sans-serif;
}

input::placeholder {
    color: #A0AEC0;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--chanv-beige);
    /* Beige Chanv pour l'intention/focus */
    box-shadow: 0 0 0 4px rgba(221, 203, 164, 0.2);
    transform: translateY(-1px);
}

.other-input {
    margin-top: 12px;
    background: var(--chanv-fibre);
    border-style: solid;
    border-width: 1px;
}

.hidden {
    display: none !important;
}

/* --- BUTTONS --- */
.actions {
    margin-top: 50px;
}

.btn-primary {
    background: var(--chanv-beige);
    /* Beige Chanv pour le CTA principal */
    color: var(--chanv-terre);
    border: none;
    padding: 22px 45px;
    border-radius: var(--radius-lg);
    font-size: 18px;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-bold);
    filter: brightness(1.05);
}

.btn-primary .icon {
    width: 24px;
    height: 24px;
}

/* --- FEEDBACK --- */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(241, 234, 218, 0.95);
    /* Fibre pour l'overlay */
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--chanv-terre);
    visibility: hidden;
    opacity: 0;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

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

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--chanv-fibre);
    border-top-color: var(--chanv-beige);
    border-radius: 50%;
    animation: rotate 1s linear infinite;
    margin-bottom: 20px;
}

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

#toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--chanv-terre);
    color: var(--chanv-blanc);
    padding: 18px 35px;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: var(--shadow-bold);
    z-index: 10001;
    transition: var(--transition);
    opacity: 0;
}

#toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

#toast.error {
    background: #E53E3E;
}

/* --- MODE SELECTOR --- */
.mode-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    background: var(--chanv-fibre);
    padding: 6px;
    border-radius: 14px;
    width: fit-content;
}

.mode-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--chanv-terre);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.mode-btn.active {
    background: var(--chanv-blanc);
    box-shadow: var(--shadow-soft);
    color: var(--chanv-terre);
}

.mode-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.4);
}

/* --- SEARCH SECTION --- */
.search-section {
    margin-bottom: 30px;
    animation: fadeIn 0.4s ease-out both;
}

.search-card {
    background: var(--chanv-beige);
    padding: 30px;
    border-radius: var(--radius-lg);
    color: var(--chanv-terre);
    box-shadow: var(--shadow-bold);
}

.search-card h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 700;
}

.search-select {
    width: 100%;
    border: 2px solid rgba(40, 40, 40, 0.1);
    background: white;
    font-weight: 500;
    font-size: 16px;
}

.search-select:focus {
    border-color: var(--chanv-terre);
}

/* --- MODAL OVERLAY --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(40, 40, 40, 0.4);
    backdrop-filter: blur(8px);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.modal-card {
    background: white;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-bold);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    background: var(--chanv-terre);
    color: white;
    padding: 30px;
}

.modal-header h2 { margin: 0; font-size: 24px; color: var(--chanv-beige); }
.modal-header p { margin: 5px 0 0 0; opacity: 0.8; font-size: 14px; }

.summary-grid {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    background: var(--chanv-fibre);
}

.summary-item {
    background: white;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid rgba(40,40,40,0.05);
}

.summary-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.summary-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--chanv-terre);
    word-break: break-all;
}

.modal-actions {
    padding: 25px 30px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    background: white;
    border-top: 1px solid var(--chanv-fibre);
}

.btn-secondary {
    background: #EDF2F7;
    color: #4A5568;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover { background: #E2E8F0; }

/* Lot + bouton "Générer le lot" sur la même ligne */
.input-with-button {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.input-with-button input {
    flex: 1;
    min-width: 0;
}

.input-with-button .btn-generate-lot {
    flex-shrink: 0;
    padding: 0 22px;
    font-size: 13px;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.input-with-button .btn-generate-lot:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- PRODUCT CARD (Consulter / Supprimer) --- */
.product-card {
    background: var(--chanv-blanc);
    border: 1px solid var(--chanv-fibre);
    border-radius: var(--radius-lg);
    padding: 35px;
    margin-top: 20px;
    box-shadow: var(--shadow-soft);
    animation: fadeIn 0.4s ease-out both;
}

.product-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--chanv-fibre);
}

.product-card-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--chanv-terre);
}

.product-card-sku {
    font-size: 13px;
    font-weight: 700;
    color: var(--chanv-beige);
    background: var(--chanv-terre);
    padding: 5px 14px;
    border-radius: 50px;
    letter-spacing: 0.5px;
}

.product-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

.product-card-item {
    background: var(--chanv-fibre);
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid rgba(40, 40, 40, 0.04);
    transition: var(--transition);
}

.product-card-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.product-card-item .pc-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.product-card-item .pc-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--chanv-terre);
    word-break: break-word;
}

.product-card-item .pc-value.empty {
    color: #CBD5E0;
    font-style: italic;
    font-weight: 400;
}

.product-card-section-title {
    grid-column: 1 / -1;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--chanv-terre);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 10px;
    padding-top: 15px;
    border-top: 1px solid var(--chanv-fibre);
}

.product-card-archive-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #9B2C2C;
    background: #FED7D7;
    padding: 4px 12px;
    border-radius: 50px;
    margin-left: auto;
}

@media (max-width: 768px) {
    .product-card-grid {
        grid-template-columns: 1fr;
    }
}

/* --- SEARCH FILTER INPUT --- */
.search-filter-input {
    width: 100%;
    padding: 14px 18px 14px 18px;
    border: 2px solid rgba(40, 40, 40, 0.1);
    border-radius: 12px;
    background: white;
    font-size: 15px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    color: var(--chanv-terre);
    transition: var(--transition);
    margin-bottom: 12px;
}

.search-filter-input::placeholder {
    color: #A0AEC0;
    font-weight: 400;
}

.search-filter-input:focus {
    outline: none;
    border-color: var(--chanv-terre);
    box-shadow: 0 0 0 4px rgba(40, 40, 40, 0.08);
    transform: translateY(-1px);
}

.search-card-danger .search-filter-input:focus {
    border-color: #E53E3E;
    box-shadow: 0 0 0 4px rgba(229, 62, 62, 0.1);
}

/* --- EDIT ACTION BAR (Consulter → Modifier) --- */
.edit-action-bar {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid var(--chanv-fibre);
    animation: fadeIn 0.4s ease-out both;
}

.btn-edit {
    background: var(--chanv-beige);
    color: var(--chanv-terre);
    border: none;
    padding: 18px 35px;
    border-radius: var(--radius-lg);
    font-size: 16px;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(221, 203, 164, 0.35);
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-edit:hover {
    filter: brightness(1.05);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(221, 203, 164, 0.5);
}

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

.btn-edit .icon {
    width: 22px;
    height: 22px;
}

/* --- DELETE ACTION BAR --- */
.delete-action-bar {
    margin-top: 20px;
    animation: fadeIn 0.4s ease-out both;
}

/* --- RESTORE ACTION BAR --- */
.restore-action-bar {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid var(--chanv-fibre);
    animation: fadeIn 0.4s ease-out both;
}

.btn-restore {
    background: #276749;
    color: white;
    border: none;
    padding: 18px 35px;
    border-radius: var(--radius-lg);
    font-size: 16px;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(39, 103, 73, 0.25);
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-restore:hover {
    background: #22543D;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(39, 103, 73, 0.35);
}

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

.btn-restore .icon {
    width: 22px;
    height: 22px;
}

/* --- BUTTON DANGER --- */
.btn-danger {
    background: #E53E3E;
    color: white;
    border: none;
    padding: 18px 35px;
    border-radius: var(--radius-lg);
    font-size: 16px;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(229, 62, 62, 0.25);
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-danger:hover {
    background: #C53030;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(229, 62, 62, 0.35);
}

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

.btn-danger .icon {
    width: 22px;
    height: 22px;
}

/* --- SEARCH CARD DANGER VARIANT --- */
.search-card-danger {
    background: var(--chanv-fibre);
    border: 2px solid rgba(229, 62, 62, 0.15);
}

.search-card-danger h3 {
    color: #C53030;
}

/* --- TOGGLE SWITCH (Archives) --- */
.view-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.view-header-row h3 {
    margin: 0;
}

.archive-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.archive-toggle-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--chanv-terre);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #CBD5E0;
    border-radius: 28px;
    transition: var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--chanv-terre);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(40, 40, 40, 0.15);
}

/* Archive mode active indicator */
.search-card.archive-mode {
    border: 2px solid var(--chanv-terre);
    background: linear-gradient(135deg, var(--chanv-beige) 0%, var(--chanv-fibre) 100%);
}

/* --- DELETE CONFIRMATION MODAL --- */
.modal-card-danger {
    max-width: 520px;
}

.modal-header-danger {
    background: #C53030 !important;
}

.modal-header-danger h2 {
    color: white !important;
}

.modal-header-danger p {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
}

.modal-danger-body {
    padding: 30px;
    text-align: center;
    background: var(--chanv-fibre);
}

.danger-icon-wrapper {
    margin-bottom: 15px;
    animation: pulse 2s ease-in-out infinite;
}

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

.danger-warning {
    font-size: 14px;
    color: #718096;
    margin: 0;
    line-height: 1.6;
}

/* --- MODE SELECTOR RESPONSIVE --- */
@media (max-width: 900px) {
    .mode-selector {
        flex-wrap: wrap;
        width: 100%;
    }
    .mode-btn {
        flex: 1 1 calc(50% - 5px);
        text-align: center;
    }
}

/* --- LOCK SCREEN --- */
.lock-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    padding: 40px 20px;
}
.lock-screen.hidden { display: none; }
.lock-card {
    text-align: center;
    background: var(--glass-bg);
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    box-shadow: var(--shadow-bold);
    max-width: 440px;
}
.app-locked .mode-selector,
.app-locked .search-section,
.app-locked #productForm,
.app-locked .section-card,
.app-locked #view-container,
.app-locked #delete-section {
    display: none !important;
}

/* --- MASTER EDIT TOGGLE --- */
.master-edit-toggle {
    background: #EDF2F7;
    color: #4A5568;
    border: 1px solid #CBD5E0;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}
.master-edit-toggle:hover {
    background: #E2E8F0;
}
.master-edit-toggle.active {
    background: #FED7D7;
    color: #9B2C2C;
    border-color: #FC8181;
}
.master-edit-input {
    width: 100%;
    padding: 6px 10px;
    border: 1.5px solid #DDCBA4;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    background: #FFFDF7;
    transition: border-color 0.2s;
}
.master-edit-input:focus {
    outline: none;
    border-color: #282828;
    box-shadow: 0 0 0 3px rgba(221, 203, 164, 0.3);
}
.master-save-bar {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    padding: 8px 0;
    gap: 10px;
}
.btn-save-master {
    background: #282828;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-save-master:hover { background: #444; }

/* =============================
   SKU Autocomplete Dropdown
   ============================= */
.sku-autocomplete-wrapper {
    position: relative;
}

.sku-autocomplete-wrapper .search-filter-input {
    margin-bottom: 0;
}

.sku-result-count {
    font-size: 11px;
    color: #9ca3af;
    padding: 4px 0 2px;
    min-height: 20px;
    font-weight: 500;
}

.sku-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    animation: skuDropIn 0.15s ease-out;
}

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

.sku-dropdown.hidden {
    display: none;
}

.sku-dropdown-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.1s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sku-dropdown-item:last-child {
    border-bottom: none;
}

.sku-dropdown-item:hover,
.sku-dropdown-item.active {
    background: #f9f7f3;
}

.sku-dropdown-item .sku-code {
    font-weight: 700;
    color: #282828;
    font-size: 12px;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 6px;
    flex-shrink: 0;
}

.sku-dropdown-item .sku-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sku-dropdown-item .sku-cat {
    font-size: 11px;
    color: #9ca3af;
    flex-shrink: 0;
}

.sku-dropdown-item mark {
    background: #DDCBA4;
    color: #282828;
    padding: 0 1px;
    border-radius: 2px;
}

.sku-selected-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #166534;
    /* Aligne la hauteur avec un .search-filter-input (padding 14px + ~24px content),
       et reproduit la même marge-bottom pour que le wrapper ait la même hauteur totale
       qu'une colonne avec input simple. */
    min-height: 52px;
    margin-bottom: 12px;
    box-sizing: border-box;
}

.sku-selected-badge button {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #9ca3af;
    padding: 0 4px;
    line-height: 1;
}

.sku-selected-badge button:hover {
    color: #ef4444;
}

.sku-dropdown-empty {
    padding: 14px;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
    font-style: italic;
}

/* =============================================================================
   Override widget Feedback (Gandalf) : positionner à gauche au lieu d'au-dessus
   du chatbot. Le widget injecte ses styles tardivement avec un préfixe gfb-,
   d'où le !important.
   ============================================================================= */
.gfb-btn {
    right: auto !important;
    left: 24px !important;
    bottom: 24px !important;
}
@media (max-width: 600px) {
    .gfb-btn {
        left: 16px !important;
        bottom: 16px !important;
    }
}

/* --- AVATAR-BURGER BUTTON --- */
.avatar-burger-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}
.avatar-burger-inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 14px 5px 5px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: var(--transition);
}
.avatar-burger-btn:hover .avatar-burger-inner {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
.avatar-burger-photo {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    object-fit: cover;
    transition: var(--transition);
}
.avatar-burger-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 16px;
}
.avatar-burger-icon span {
    display: block;
    height: 2px;
    width: 100%;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 2px;
    transition: var(--transition);
}
.avatar-burger-icon span:nth-child(2) { width: 70%; }
.avatar-burger-btn:hover .avatar-burger-icon span { background: white; }
.avatar-burger-btn:hover .avatar-burger-icon span:nth-child(2) { width: 100%; }

/* --- UNIVERSAL SIDEBAR --- */
.sidebar-overlay {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 99998;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
}
.sidebar-overlay.open { opacity: 1; pointer-events: auto; }
.sidebar-panel {
    position: fixed; top: 0; right: -300px;
    width: 300px; height: 100%;
    background: var(--chanv-terre);
    z-index: 99999; padding: 0;
    display: flex; flex-direction: column;
    transition: right 0.35s cubic-bezier(0.4,0,0.2,1);
    box-shadow: -8px 0 40px rgba(0,0,0,0.3);
}
.sidebar-panel.open { right: 0; }
.sidebar-header {
    flex-shrink: 0;
    display: flex; flex-direction: column; align-items: center;
    gap: 10px; padding: 36px 24px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, transparent 100%);
}
.sidebar-avatar {
    width: 68px; height: 68px; border-radius: 50%; object-fit: cover;
    box-shadow: 0 0 0 3px rgba(221,203,164,0.3), 0 4px 20px rgba(0,0,0,0.3);
}
.sidebar-name {
    font-family: 'Outfit', sans-serif;
    font-size: 17px; font-weight: 700; color: white; text-align: center;
}
.sidebar-role {
    font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px;
    color: rgba(255,255,255,0.5);
}
.sidebar-body { flex: 1; overflow-y: auto; padding: 0 24px; }
.sidebar-favs { padding: 20px 0; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-favs-title {
    font-family: 'Outfit', sans-serif;
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 2px; color: rgba(255,255,255,0.4); padding: 0 0 12px;
}
.sidebar-favs-list { display: flex; flex-direction: column; gap: 2px; }
.sidebar-fav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: 10px;
    color: rgba(255,255,255,0.85); text-decoration: none;
    font-size: 14px; font-weight: 500; transition: var(--transition);
}
.sidebar-fav-link:hover {
    background: rgba(255,255,255,0.08); color: white; transform: translateX(4px);
}
.sidebar-fav-icon { font-size: 16px; width: 24px; text-align: center; flex-shrink: 0; }
.sidebar-fav-img {
    width: 28px; height: 28px; border-radius: 6px;
    object-fit: contain; flex-shrink: 0;
    background: rgba(255,255,255,0.1); padding: 3px;
}
.sidebar-no-favs {
    font-size: 13px; color: rgba(255,255,255,0.35); font-style: italic; padding: 8px 0;
}
.sidebar-logout {
    flex-shrink: 0; width: calc(100% - 48px);
    margin: 0 24px 24px; justify-content: center; padding: 12px; font-size: 14px;
}
/* ═══════════════════════════════════════════════════════════════
   NAV D'EMBED GANDALF (modèle Gestion-Parc-It)
   Le SDK masque .main-header en mode embarqué : ces pastilles
   reconstruisent les fonctions du header (Aide, Menu).
   ═══════════════════════════════════════════════════════════════ */
#gandalf-embed-nav { display: none; }

html.gandalf-embed #gandalf-embed-nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px 0 4px;
    position: sticky;
    top: 0;
    z-index: 60;
    background: transparent;
}

html.gandalf-embed .gen-tab {
    background: #fff;
    border: 1px solid rgba(40, 34, 24, .10);
    border-radius: 999px;
    padding: 8px 15px;
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    color: rgba(40, 38, 34, .66);
    cursor: pointer;
    transition: all .15s ease;
}

html.gandalf-embed .gen-tab:hover {
    border-color: rgba(168, 134, 63, .32);
    color: #282828;
}

/* En embed, le padding haut du container compense le header masqué */
html.gandalf-embed .container { padding-top: 12px; margin-top: 0; }

/* ═══════════════════════════════════════════════════════════════
   MODE SOMBRE GANDALF — html.gandalf-dark posé par /gandalf/embed-client.js
   Palette dark du hub : fond #201d19 / panneaux #2b2823,
   texte rgba(255,255,255,.92), lignes rgba(221,203,164,.14), accent or #DDCBA4.
   Le mode clair (:root) reste inchangé.
   ═══════════════════════════════════════════════════════════════ */
html.gandalf-dark {
    color-scheme: dark;
    /* --chanv-terre devient la couleur de CONTENU (texte) ; les fonds qui
       l'utilisaient (header, toast, modal-header) sont re-noircis plus bas. */
    --chanv-blanc: #201d19;
    --chanv-fibre: rgba(221, 203, 164, 0.14);
    --chanv-terre: rgba(255, 255, 255, 0.92);
    --glass-bg: rgba(43, 40, 35, 0.9);
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.25);
    --shadow-bold: 0 12px 40px rgba(0, 0, 0, 0.45);
}

/* --- Structure : header, fond, cartes --- */
html.gandalf-dark body { background-color: #201d19; }
html.gandalf-dark .main-header { background: #2b2823; }
html.gandalf-dark .logo-wrapper { background: #F1EADA; } /* le logo sombre a besoin d'un fond clair */
html.gandalf-dark .section-card,
html.gandalf-dark .product-card,
html.gandalf-dark .modal-card,
html.gandalf-dark .modal-actions { background: #2b2823; }
html.gandalf-dark .modal-header { background: #201d19; }
html.gandalf-dark .loader-overlay { background: rgba(32, 29, 25, 0.95); }

/* --- Écran de verrouillage --- */
html.gandalf-dark .lock-card { border-color: rgba(221, 203, 164, 0.2); }
html.gandalf-dark .lock-card h2 { color: rgba(255, 255, 255, 0.92) !important; }
html.gandalf-dark .lock-card p { color: rgba(255, 255, 255, 0.6) !important; }

/* --- Onglets de mode : pastille active en or --- */
html.gandalf-dark .mode-selector { background: #2b2823; }
html.gandalf-dark .mode-btn { color: rgba(255, 255, 255, 0.7); }
html.gandalf-dark .mode-btn.active { background: #DDCBA4; color: #201d19; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); }
html.gandalf-dark .mode-btn:hover:not(.active) { background: rgba(255, 255, 255, 0.06); }

/* --- Cartes de recherche (édition / consulter / supprimer) --- */
html.gandalf-dark .search-card { background: #2b2823; color: rgba(255, 255, 255, 0.92); }
html.gandalf-dark .search-card.archive-mode { background: #2b2823; border: 1px solid #DDCBA4; }
html.gandalf-dark .search-card-danger h3 { color: #F1948A; }
html.gandalf-dark .search-filter-input,
html.gandalf-dark .search-select {
    background: #201d19;
    color: rgba(255, 255, 255, 0.92);
    border-color: rgba(221, 203, 164, 0.2);
}
html.gandalf-dark .search-filter-input:focus { border-color: #DDCBA4; box-shadow: 0 0 0 4px rgba(221, 203, 164, 0.15); }

/* --- Champs de formulaire (inputs héritent des vars, on précise le reste) --- */
html.gandalf-dark input::placeholder,
html.gandalf-dark textarea::placeholder,
html.gandalf-dark .search-filter-input::placeholder { color: rgba(255, 255, 255, 0.35); }
html.gandalf-dark input:focus,
html.gandalf-dark select:focus,
html.gandalf-dark textarea:focus { box-shadow: 0 0 0 4px rgba(221, 203, 164, 0.15); }

/* --- Autocomplete SKU / Lot MP --- */
html.gandalf-dark .sku-dropdown { background: #2b2823; border-color: rgba(221, 203, 164, 0.2); }
html.gandalf-dark .sku-dropdown-item:hover,
html.gandalf-dark .sku-dropdown-item.active { background: rgba(221, 203, 164, 0.12); }
html.gandalf-dark .sku-dropdown-item .sku-code { color: #DDCBA4; }
html.gandalf-dark .sku-dropdown-item .sku-name { color: rgba(255, 255, 255, 0.85); }
html.gandalf-dark .sku-dropdown-item .sku-cat { color: rgba(255, 255, 255, 0.5); }
html.gandalf-dark .sku-dropdown-item mark { background: rgba(221, 203, 164, 0.35); color: inherit; }
html.gandalf-dark .sku-dropdown-empty { color: rgba(255, 255, 255, 0.55); }
html.gandalf-dark .sku-result-count { color: rgba(255, 255, 255, 0.45); }
html.gandalf-dark .sku-selected-badge { background: rgba(72, 187, 120, 0.15); color: rgba(255, 255, 255, 0.9); border-color: rgba(72, 187, 120, 0.4); }

/* --- Boutons --- */
html.gandalf-dark .btn-primary { background: #DDCBA4; color: #201d19; }
html.gandalf-dark .btn-secondary { background: rgba(221, 203, 164, 0.14); color: rgba(255, 255, 255, 0.92); }
html.gandalf-dark .btn-secondary:hover { background: rgba(221, 203, 164, 0.25); }
html.gandalf-dark .btn-edit { background: #DDCBA4; color: #201d19; }
html.gandalf-dark .input-with-button .btn-generate-lot { background: rgba(221, 203, 164, 0.14); color: #DDCBA4; }
html.gandalf-dark .input-with-button .btn-generate-lot:hover { background: #DDCBA4; color: #201d19; }
html.gandalf-dark .btn-save-master { background: #DDCBA4; color: #201d19; }
html.gandalf-dark .master-edit-toggle { background: rgba(221, 203, 164, 0.14); color: rgba(255, 255, 255, 0.85); border-color: rgba(221, 203, 164, 0.3); }
html.gandalf-dark .master-edit-toggle.active { background: #DDCBA4; color: #201d19; }
html.gandalf-dark .master-edit-input { background: #201d19; color: rgba(255, 255, 255, 0.92); }
html.gandalf-dark .master-edit-input:focus { border-color: #DDCBA4; }

/* --- Boutons inline générés en JS (fiche consultation) --- */
html.gandalf-dark #copy-link-btn { background: rgba(221, 203, 164, 0.14) !important; color: rgba(255, 255, 255, 0.85) !important; border-color: rgba(221, 203, 164, 0.3) !important; }
html.gandalf-dark #view-label-btn { background: rgba(252, 211, 77, 0.15) !important; color: #FCD34D !important; border-color: rgba(252, 211, 77, 0.4) !important; }
html.gandalf-dark #label-preview-select { background: #201d19 !important; color: rgba(255, 255, 255, 0.92) !important; border-color: rgba(221, 203, 164, 0.25) !important; }

/* --- Fiche produit (mode Consulter / Supprimer) --- */
html.gandalf-dark .product-card-item { background: #201d19; border-color: rgba(221, 203, 164, 0.14); }
html.gandalf-dark .product-card-item .pc-label { color: rgba(255, 255, 255, 0.55); }
html.gandalf-dark .product-card-item .pc-value.empty { color: rgba(255, 255, 255, 0.3); }
html.gandalf-dark .product-card-sku { background: #201d19; color: #DDCBA4; }
html.gandalf-dark .product-card-archive-badge { background: rgba(229, 62, 62, 0.2); color: #F1948A; }

/* --- Résumé (modal de confirmation) --- */
html.gandalf-dark .summary-grid { background: #201d19; }
html.gandalf-dark .summary-item { background: #2b2823; border-color: rgba(221, 203, 164, 0.14); }
html.gandalf-dark .summary-label { color: rgba(255, 255, 255, 0.55); }
html.gandalf-dark .modal-header h2 { color: #DDCBA4; }

/* --- Modales danger (suppression / lot existant) --- */
html.gandalf-dark .modal-danger-body { background: #201d19; }
html.gandalf-dark .danger-warning { color: rgba(255, 255, 255, 0.6); }

/* --- Toggle Archives --- */
html.gandalf-dark .toggle-slider { background: rgba(255, 255, 255, 0.25); }
html.gandalf-dark .toggle-switch input:checked + .toggle-slider { background: #DDCBA4; }

/* --- Toast --- */
html.gandalf-dark #toast { background: #DDCBA4; color: #201d19; }
html.gandalf-dark #toast.error { background: #E53E3E; color: white; }

/* --- Nav d'embed en dark --- */
html.gandalf-dark.gandalf-embed .gen-tab {
    background: #2b2823;
    border-color: rgba(221, 203, 164, 0.2);
    color: rgba(255, 255, 255, 0.7);
}
html.gandalf-dark.gandalf-embed .gen-tab:hover { border-color: #DDCBA4; color: rgba(255, 255, 255, 0.95); }
