/* =============================================
   StockAtelier — CSS Variables & Styles
   Police : Outfit (titres) + Nunito (corps)
   ============================================= */

:root {
    /* ——— Couleurs principales ——— */
    --color-primary:        #5B8C3E;
    --color-primary-light:  #7DB356;
    --color-primary-dark:   #3E6B28;
    --color-primary-bg:     #dff5cf;

    --color-secondary:      #d46954;
    --color-secondary-light:#c99a48;
    --color-secondary-bg:   #f1d8ab;


    /* ——— Neutres ——— */
    --color-bg:             #fadcbc;
    --color-surface:        #FFFFFF;
    --color-surface-hover:  #F5F2ED;
    --color-border:         #E5DFD6;
    --color-border-light:   #B0A898;

    --color-text:           #2C2418;
    --color-text-secondary: #7A7062;
    --color-text-muted:     #B0A898;

    /* ——— Feedback ——— */
    --color-success:        #4CAF50;
    --color-warning:        #FFA726;
    --color-danger:         #E05252;
    --color-danger-light:   #FDECEC;
    --color-danger-dark:    #C62828;

    /* ——— Sidebar ——— */
    --sidebar-width:        260px;
    --sidebar-bg:           #31281b;
    --sidebar-text:         #D4CFC7;
    --sidebar-text-active:  #FFFFFF;

    /* ——— Typographie ——— */
    --font-display:         'Outfit', sans-serif;
    --font-body:            'Nunito', sans-serif;

    /* ——— Rayons & ombres ——— */
    --radius-sm:            6px;
    --radius-md:            10px;
    --radius-lg:            16px;
    --radius-xl:            24px;

    --shadow-sm:            0 1px 3px rgba(44, 36, 24, 0.06);
    --shadow-md:            0 4px 12px rgba(44, 36, 24, 0.08);
    --shadow-lg:            0 8px 30px rgba(44, 36, 24, 0.12);

    /* ——— Transitions ——— */
    --transition-fast:      0.15s ease;
    --transition-base:      0.25s ease;
    --transition-slow:      0.4s ease;
}

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

html {
    scroll-behavior: smooth;
}

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

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.3;
}

a { text-decoration: none; color: inherit; }

input, select, button {
    font-family: var(--font-body);
}

/* =============================================
   Sidebar
   ============================================= */

.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 100;
    transition: transform var(--transition-base);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    object-fit: contain;
}

.logo-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.3rem;
    color: #fff;
    letter-spacing: -0.02em;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: var(--radius-md);
    color: var(--sidebar-text);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.nav-item i { width: 20px; text-align: center; font-size: 1rem; }

.nav-item:hover {
    background: rgba(255,255,255,0.07);
    color: var(--sidebar-text-active);
}

.nav-item.active {
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
}

.nav-item#btn-add-category {
    margin-top: 8px;
    padding-top: 12px;
    border: 1px dashed rgba(255,255,255,0.2);
    background: transparent;
    width: 100%;
    text-align: left;
    opacity: 0.7;
    color: var(--sidebar-text);
}

.nav-item#btn-add-category:hover {
    opacity: 1;
    background: rgba(255,255,255,0.05);
    color: var(--sidebar-text-active);
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--color-text);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.sidebar-toggle:hover { background: var(--color-surface-hover); }

/* =============================================
   Main Content
   ============================================= */

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 0 40px 60px;
    max-width: 1400px;
}

/* =============================================
   Zone sticky : Top Bar + Stats
   ============================================= */

.sticky-header-wrap {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--color-bg);
    padding-bottom: 20px;
    margin-bottom: 32px;
    isolation: isolate;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 28px 0 20px;
}

.topbar-left { flex: 1; }

.page-title {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 0.88rem;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 9px 16px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-box:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-bg);
}

.search-box i { color: var(--color-text-muted); font-size: 0.85rem; }

.search-box input {
    border: none; outline: none; background: none;
    font-size: 0.88rem; color: var(--color-text);
    width: 220px;
}

.search-box input::placeholder { color: var(--color-text-muted); }

/* =============================================
   Buttons
   ============================================= */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    border: none;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
}
.btn-primary:hover:not(:disabled) {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-danger {
    background: var(--color-danger);
    color: #fff;
}
.btn-danger:hover {
    background: var(--color-danger-dark);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--color-border);
    color: var(--color-text-secondary);
}
.btn-outline:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-primary-bg);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-muted);
}
.btn-ghost:hover {
    color: var(--color-danger);
    background: var(--color-danger-light);
}

.btn-dashed {
    background: transparent;
    border: 2px dashed var(--color-border);
    color: var(--color-text-muted);
    padding: 18px 28px;
    border-radius: var(--radius-lg);
    width: 100%;
    justify-content: center;
    font-size: 0.95rem;
}
.btn-dashed:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-primary-bg);
}

.btn-sm { padding: 6px 14px; font-size: 0.82rem; }

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border: none; background: transparent;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.85rem;
}
.btn-icon:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
}
.btn-icon--danger:hover {
    background: var(--color-danger-light);
    color: var(--color-danger);
}

/* =============================================
   Stats Cards
   ============================================= */


/* =============================================
   Category Blocks
   ============================================= */

.categories {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* scroll-margin pour que l’ancre ne passe pas sous la zone sticky */
.category-block {
    animation: fadeInUp 0.4s ease both;
    scroll-margin-top: 220px;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-title h2 { font-size: 1.15rem; font-weight: 700; }

.category-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}


.category-count {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    background: var(--color-surface-hover);
    padding: 3px 10px;
    border-radius: var(--radius-lg);
    font-weight: 600;
}

.threshold-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.73rem;
    font-weight: 600;
    color: var(--color-warning);
    background: #ffffff;
    border: 1px solid rgba(255, 167, 38, 0.25);
    padding: 3px 10px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-body);
}

.threshold-badge:hover {
    font-weight: bold;
}

.threshold-badge i {
    font-size: 0.65rem;
}

.threshold-editor {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.73rem;
    font-weight: 600;
    color: var(--color-warning);
    background: #ffffff;
    border: 1px solid var(--color-warning);
    padding: 3px 8px;
    border-radius: var(--radius-lg);
}

.threshold-editor i {
    font-size: 0.65rem;
}

.threshold-inline-input {
    width: 45px;
    padding: 2px 4px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    text-align: center;
    outline: none;
    background: var(--color-surface);
    font-family: var(--font-display);
    font-weight: 700;
}

.threshold-inline-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-bg);
}

.threshold-save-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px; height: 22px;
    border: none;
    background: var(--color-primary);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.6rem;
    transition: all var(--transition-fast);
}

/* ——— Sub-groups ——— */
.product-group-label {
    grid-column: 1 / -1;
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 8px 0 2px;
    border-bottom: 1px solid var(--color-border-light);
    margin-top: 6px;
}

.product-group-label:first-child {
    margin-top: 0;
}

/* =============================================
   Product Cards
   ============================================= */

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
}

.product-card {
    background: var(--color-surface);
    border: 1.5px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card-header {
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}


.product-card-body {
    padding: 14px 16px 10px;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.product-card-body h3 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.product-qty {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--color-success);
    letter-spacing: -0.02em;
}

.product-qty.stock-low {
    color: var(--color-danger);
}

.product-qty.stock-unknown {
    color: var(--color-warning);
    font-style: italic;
    font-size: 0.9rem;
    font-weight: 600;
}

.product-note {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 4px;
    font-style: italic;
}

.product-card-footer {
    padding: 6px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2px;
    border-top: 1px solid var(--color-border-light);
    margin-top: auto;
}

/* Boutons -/+ inline autour de la quantité */
.qty-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 4px 0 2px;
}

.qty-inline-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    border: 1.5px solid var(--color-border);
    background: var(--color-surface);
    border-radius: 50%;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 0.65rem;
    transition: all var(--transition-fast);
}

.qty-inline-btn.qty-minus:hover {
    border-color: var(--color-danger);
    background: var(--color-danger-light);
    color: var(--color-danger);
}

.qty-inline-btn.qty-plus:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-bg);
    color: var(--color-primary);
}

.qty-validate-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 6px;
    padding: 4px 14px;
    border: none;
    background: var(--color-primary);
    color: #fff;
    border-radius: var(--radius-lg);
    font-size: 0.72rem;
    font-weight: 700;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all var(--transition-fast);
    animation: fadeInUp 0.2s ease;
}

.qty-validate-btn:hover {
    background: var(--color-primary-dark);
    transform: scale(1.05);
}

/* =============================================
   Add Category Section
   ============================================= */

.add-category-section { margin-top: 32px; }

/* =============================================
   Bell Button (topbar)
   ============================================= */

.btn-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border: 1.5px solid var(--color-border);
    background: var(--color-surface);
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 1rem;
}

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

.btn-bell.has-alerts {
    color: var(--color-danger);
    border-color: var(--color-danger);
    animation: bellShake 0.5s ease;
}

.btn-bell.has-alerts:hover {
    background: var(--color-danger-light);
}

.bell-badge {
    position: absolute;
    top: -6px; right: -6px;
    background: var(--color-danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: var(--radius-md);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

.btn-bell.has-alerts .bell-badge {
    display: flex;
}

@keyframes bellShake {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(12deg); }
    40% { transform: rotate(-10deg); }
    60% { transform: rotate(6deg); }
    80% { transform: rotate(-3deg); }
}

/* =============================================
   Alerts Panel (slide-in from right)
   ============================================= */

.alerts-overlay {
    position: fixed;
    inset: 0;
    background: rgba(44, 36, 24, 0.3);
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

.alerts-overlay.is-open {
    opacity: 1;
    pointer-events: all;
}

.alerts-panel {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 380px;
    max-width: 90vw;
    background: var(--color-surface);
    box-shadow: var(--shadow-lg);
    z-index: 160;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform var(--transition-base);
}

.alerts-panel.is-open {
    transform: translateX(0);
}

.alerts-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border-light);
}

.alerts-panel-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alerts-panel-header h2 i {
    color: var(--color-danger);
}

.alerts-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.alerts-panel-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--color-border-light);
    display: flex;
    justify-content: center;
}

/* Alert items */

.alert-category-group {
    margin-bottom: 20px;
}

.alert-category-title {
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-category-title i {
    font-size: 0.85rem;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    margin-bottom: 6px;
    border-left: 3px solid var(--color-danger);
}

.alert-item.unknown {
    border-left-color: var(--color-warning);
}

.alert-item-info {
    flex: 1;
}

.alert-item-name {
    font-size: 0.88rem;
    font-weight: 600;
}

.alert-item-qty {
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

.alert-item-qty span {
    font-weight: 700;
    color: var(--color-danger);
}

.alert-item.unknown .alert-item-qty span {
    color: var(--color-warning);
}

.alerts-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-text-muted);
}

.alerts-empty i {
    font-size: 2.5rem;
    color: var(--color-success);
    margin-bottom: 12px;
    display: block;
}

.alerts-empty p {
    font-size: 0.92rem;
    font-weight: 600;
}

/* Threshold form in modal */

.threshold-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.threshold-row label {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.threshold-row label i {
    width: 18px;
    text-align: center;
    color: var(--color-text-muted);
}

.threshold-row input {
    width: 70px;
    padding: 6px 10px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    text-align: center;
    outline: none;
    transition: border-color var(--transition-fast);
}

.threshold-row input:focus {
    border-color: var(--color-primary);
}

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

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(44, 36, 24, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

.modal-overlay.is-open {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px) scale(0.97);
    transition: transform var(--transition-base);
}

.modal-sm { max-width: 380px; }

.modal-overlay.is-open .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 28px;
    border-bottom: 1px solid var(--color-border-light);
}

.modal-header h2 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h2 i { color: var(--color-primary); }

.modal-header h2 .fa-triangle-exclamation { color: var(--color-warning); }

.modal-body {
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.modal-footer {
    padding: 16px 28px;
    border-top: 1px solid var(--color-border-light);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* =============================================
   Forms
   ============================================= */

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

.form-group label {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.form-group .text-error {
    font-size: 0.88rem;
    color: var(--color-danger);
    font-weight: 600;
}

.form-group input,
.form-group select {
    padding: 10px 14px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: var(--color-text);
    background: var(--color-surface);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-bg);
}

.form-group input::placeholder { color: var(--color-text-muted); }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* =============================================
   Icon Selector Grid
   ============================================= */

.icon-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 10px;
    padding: 12px;
    background: var(--color-surface-hover);
    border-radius: var(--radius-md);
    border: 1.5px solid var(--color-border);
    max-height: 200px;
    overflow-y: auto;
}

.icon-selector-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--color-border);
    background: var(--color-surface);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 1.2rem;
    color: var(--color-text-secondary);
}

.icon-selector-item:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-bg);
    color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.icon-selector-item.selected {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #fff;
    box-shadow: var(--shadow-md);
}

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

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border-light);
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.setting-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text);
}

.setting-desc {
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--color-border);
    border-radius: 24px;
    transition: background var(--transition-fast);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

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

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

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

.changelog-modal-body {
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.changelog-version {
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-primary);
    background: var(--color-primary-bg);
    padding: 3px 10px;
    border-radius: var(--radius-lg);
    display: inline-block;
}

.changelog-date {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    margin-left: 8px;
}

.changelog-list {
    list-style: none;
    padding: 0;
    margin: 2px 0 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.changelog-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.88rem;
    color: var(--color-text);
    padding: 8px 12px;
    background: var(--color-surface-hover);
    border-radius: var(--radius-md);
    line-height: 1.4;
}

.changelog-list li i {
    color: var(--color-primary);
    margin-top: 3px;
    flex-shrink: 0;
}

/* =============================================
   Drag-and-drop catégories
   ============================================= */

.category-header {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding-left: 5px;
}

.category-block.drag-over {
    outline: 2px dashed var(--color-primary);
    border-radius: var(--radius-lg);
    background: var(--color-primary-bg);
}

.category-block.dragging {
    opacity: 0.4;
}

/* =============================================
   Header collapsible au scroll
   ============================================= */


/* =============================================
   Animations
   ============================================= */

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

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

@media (max-width: 1024px) {
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.is-open { transform: translateX(0); }
    .sidebar-toggle { display: block; }
    .main-content { margin-left: 0; padding: 0 20px 40px; }
    .topbar { flex-wrap: wrap; }
    .topbar-right { width: 100%; }
    .search-box { flex: 1; }
    .search-box input { width: 100%; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}

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