<?php /* warehouse-manager.php — KREMER Régis v2.2.0 */ ?>
<div class="page-body">
    <section class="page-sect">
        <div class="sect-toolbar">
            <div class="sect-toolbar-left">
                <h2 style="font-size:18px;font-weight:700;margin:0">Gestion Magasins & Catégories</h2>
            </div>
            <button class="btn btn-primary" id="btnNewWarehouse"><span data-icon="plus"></span> Nouveau magasin</button>
        </div>

        <div class="warehouse-manager-grid">
            <!-- Populated by JS -->
        </div>
    </section>
</div>

<style>
.warehouse-manager-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    padding: 20px;
}

.warehouse-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 20px;
    transition: all 0.3s ease;
}

.warehouse-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    border-color: var(--blue);
}

.warehouse-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.warehouse-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.warehouse-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--r);
}

.warehouse-stat {
    flex: 1;
    text-align: center;
}

.warehouse-stat-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--blue);
    line-height: 1;
}

.warehouse-stat-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 4px;
}

.warehouse-categories {
    margin-top: 12px;
}

.warehouse-categories-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.warehouse-categories-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 40px;
}

.category-list:empty::before {
    content: "Aucune catégorie";
    color: var(--text-muted);
    font-style: italic;
    font-size: 12px;
}

.category-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--blue-pale);
    color: var(--blue);
    border: 1px solid rgba(0, 180, 216, 0.2);
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
}

.category-tag:hover {
    background: var(--blue);
    color: #fff;
    transform: scale(1.05);
}

.category-tag-remove {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: inherit;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    padding: 0;
    transition: all 0.2s ease;
}

.category-tag-remove:hover {
    background: rgba(255, 255, 255, 0.4);
}

.warehouse-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
    .warehouse-manager-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 12px;
    }
}
</style>

<script>window.SM_PAGE = 'warehouse-manager';</script>
