:root {
    --color-primary: #330099;
    --color-accent: #BC7F15;
    --color-bg: #FFF8EF;
    --color-text: #24202b;
    --color-border: #e2d9c9;
    --color-danger: #a4302a;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 17px;
    line-height: 1.4;
}

a { color: var(--color-primary); }

header.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--color-primary);
    color: white;
}

header.topbar a { color: white; text-decoration: none; font-weight: 600; }

nav.tabs {
    display: flex;
    overflow-x: auto;
    background: white;
    border-bottom: 1px solid var(--color-border);
}

nav.tabs a {
    padding: 0.75rem 1rem;
    text-decoration: none;
    white-space: nowrap;
    color: var(--color-text);
    font-weight: 500;
}

nav.tabs a.active {
    color: var(--color-primary);
    border-bottom: 3px solid var(--color-accent);
}

main {
    padding: 1rem;
    max-width: 640px;
    margin: 0 auto;
}

.flash {
    background: var(--color-accent);
    color: white;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.btn {
    display: block;
    width: 100%;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: none;
    border-radius: 12px;
    background: var(--color-primary);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.btn.secondary {
    background: white;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

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

.btn.small {
    width: auto;
    padding: 0.5rem 0.9rem;
    font-size: 0.95rem;
    display: inline-block;
    margin: 0 0.4rem 0.4rem 0;
}

.sku-list { list-style: none; padding: 0; margin: 0; }

.sku-list li { margin-bottom: 0.6rem; }

.sku-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: white;
    font-size: 1rem;
    text-align: left;
    cursor: pointer;
}

.sku-btn .stock { color: var(--color-accent); font-weight: 700; }

form.filters { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }

input, select, textarea {
    font-size: 1rem;
    padding: 0.6rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    width: 100%;
    margin-bottom: 0.75rem;
    background: white;
    color: var(--color-text);
}

label { font-weight: 600; display: block; margin-bottom: 0.25rem; }

table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; font-size: 0.95rem; }

th, td { text-align: left; padding: 0.5rem; border-bottom: 1px solid var(--color-border); }

h1, h2, h3 { color: var(--color-primary); }

.card {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.muted { color: #6b6470; font-size: 0.9rem; }

.sku-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sku-thumb {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--color-bg);
}

.sku-thumb--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.7rem;
    color: #9a8f96;
    border: 1px dashed var(--color-border);
}

.sku-row__infos {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.sku-row__actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.sku-row__actions form { margin: 0; }

.photo-upload-label { cursor: pointer; }

/* Tuiles produit avec stepper (dépôt / reprise / relevé de ventes) */
.produit-tuile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 0.75rem;
    margin-bottom: 0.6rem;
}

.produit-tuile__infos {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.produit-tuile__stock {
    font-size: 0.85rem;
    color: var(--color-accent);
}

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

.stepper button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--color-primary);
    background: white;
    color: var(--color-primary);
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.stepper button:active { background: var(--color-primary); color: white; }

.stepper input {
    width: 44px;
    text-align: center;
    margin: 0;
    padding: 0.4rem 0;
    font-weight: 700;
    font-size: 1.1rem;
}

.action-choix {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.action-choix .btn { margin-bottom: 0; }

.boutique-choix { display: grid; gap: 0.5rem; margin-bottom: 1rem; }

.recap-bar {
    position: sticky;
    bottom: 0;
    background: var(--color-bg);
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
}
