/* =========================================================================
   PEAK Distribution — feuille de style principale
   Palette : rouge PEAK (#E01E26) · marine (#0F1C33) · fond froid (#F2F5FA)
   ========================================================================= */

:root {
    --red: #E01E26;
    --red-dark: #B8141B;
    --red-soft: #FDECEC;
    --navy: #0F1C33;
    --navy-soft: #1B2C4B;
    --ink: #16233B;
    --muted: #64748B;
    --muted-light: #94A3B8;
    --line: #E3E9F2;
    --bg: #F2F5FA;
    --card: #FFFFFF;
    --ok: #0E9F6E;
    --ok-soft: #E7F7F1;
    --warn: #B45309;
    --warn-soft: #FEF3C7;
    --info: #1D4ED8;
    --info-soft: #E8EEFD;
    --radius: 14px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 2px rgba(15, 28, 51, .06), 0 1px 3px rgba(15, 28, 51, .04);
    --shadow: 0 10px 30px -12px rgba(15, 28, 51, .18), 0 2px 8px rgba(15, 28, 51, .05);
    --shadow-lg: 0 24px 60px -20px rgba(15, 28, 51, .28);
    --font: "Segoe UI", "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------------ échelle globale
   Interface réduite de 20 % (le site est compact) : `zoom` met à l'échelle
   toutes les tailles (px et rem) d'un coup. Les hauteurs en vh sont
   compensées plus bas pour que la barre latérale garde toute la hauteur. */
body { zoom: .8; }

a { color: var(--red-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -.01em; color: var(--navy); }
p { margin: 0 0 10px; }
code, .mono { font-family: "Cascadia Mono", Consolas, monospace; font-size: .85em; }

.icon { width: 19px; height: 19px; flex: 0 0 auto; }

/* ------------------------------------------------------------------ layout */
.app-shell {
    display: grid;
    grid-template-columns: 262px minmax(0, 1fr);
    /* 100 vh / 0.8 : compense le zoom global de 20 %. */
    min-height: calc(100vh / .8);
}

.sidebar {
    background: var(--navy);
    color: #DCE4F2;
    padding: 22px 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    position: sticky;
    top: 0;
    /* 100 vh / 0.8 : compense le zoom global de 20 % (body { zoom: .8 }). */
    height: calc(100vh / .8);
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 8px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.brand__logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #fff;
    display: grid;
    place-items: center;
    padding: 5px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}
.brand__logo img { width: 100%; height: 100%; object-fit: contain; }
.brand__name { font-size: .95rem; font-weight: 800; color: #fff; letter-spacing: .04em; line-height: 1.2; }
.brand__sub { font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; color: #8FA3C4; }

.nav-group { display: flex; flex-direction: column; gap: 4px; }
.nav-group__label {
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .16em;
    color: #6C82A6;
    padding: 0 12px;
    margin-bottom: 6px;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 11px;
    color: #C3D0E6;
    font-weight: 600;
    font-size: .89rem;
    transition: background .15s ease, color .15s ease, transform .15s ease;
    position: relative;
    white-space: nowrap;
}
.nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.nav-link.is-active { background: linear-gradient(180deg, #E2232B, #C3121A); color: #fff; box-shadow: 0 8px 18px -8px rgba(224, 30, 38, .9); }
.nav-link.is-active .icon { color: #fff; }
.nav-link__badge {
    margin-left: auto;
    font-size: .62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    background: rgba(255, 255, 255, .12);
    border-radius: 99px;
    padding: 3px 7px;
    color: #C9D6EC;
}
.nav-link.is-active .nav-link__badge { background: rgba(0, 0, 0, .22); color: #fff; }

.sidebar__footer {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, .08);
    padding-top: 14px;
    font-size: .72rem;
    color: #7D93B5;
    line-height: 1.5;
}

/* ------------------------------------------------------------------ topbar */
.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 30px;
    background: rgba(255, 255, 255, .82);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}
.topbar__title { font-size: 1.28rem; font-weight: 800; color: var(--navy); }
.topbar__crumb { font-size: .78rem; color: var(--muted); font-weight: 600; }
.topbar__spacer { flex: 1; }
.userchip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px 6px 6px;
    border: 1px solid var(--line);
    border-radius: 99px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}
.avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: linear-gradient(180deg, #E2232B, #B8141B);
    color: #fff;
    font-weight: 800;
    font-size: .8rem;
    text-transform: uppercase;
}
.userchip__meta { line-height: 1.15; }
.userchip__name { font-size: .8rem; font-weight: 700; color: var(--navy); }
.userchip__role { font-size: .67rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

.content { padding: 26px 30px 46px; max-width: 1560px; width: 100%; margin-inline: auto; }
.content__inner { width: 100%; }
.content__inner--error { min-height: min(68vh, 720px); display: grid; place-items: center; }

.error-page {
    width: min(100%, 640px);
    margin: 30px auto;
    padding: clamp(28px, 5vw, 52px);
    text-align: center;
    background: linear-gradient(155deg, #fff 0%, #FBFCFF 75%, #FFF5F5 100%);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}
.error-page::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: linear-gradient(90deg, var(--navy), var(--red), #FB923C);
}
.error-page__icon {
    width: 76px;
    height: 76px;
    margin: 0 auto 18px;
    display: grid;
    place-items: center;
    border-radius: 24px;
    background: linear-gradient(145deg, #FFF1F2, #FEE2E2);
    border: 1px solid #FECACA;
    color: var(--red-dark);
    font-size: 1.65rem;
    font-weight: 900;
    box-shadow: 0 10px 24px rgba(184, 20, 27, .10);
}
.error-page__eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--red-dark);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}
.error-page h1 { font-size: clamp(1.45rem, 4vw, 2rem); }
.error-page__message { max-width: 470px; margin: 12px auto 0; color: var(--ink); font-size: 1rem; }
.error-page__hint { max-width: 480px; margin: 10px auto 0; color: var(--muted); font-size: .86rem; }
.error-page__actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.error-page__details { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); text-align: left; }
.error-page__details summary { color: var(--muted); cursor: pointer; font-size: .8rem; font-weight: 700; }
.error-page__details p { margin: 12px 0 8px; color: var(--muted); font-size: .78rem; }
.error-page__details pre { max-height: 300px; overflow: auto; margin: 0; padding: 14px; border-radius: 12px; background: var(--navy); color: #DCE4F2; white-space: pre-wrap; overflow-wrap: anywhere; }

:where(a, button, input, select, textarea, summary):focus-visible {
    outline: 3px solid rgba(29, 78, 216, .45);
    outline-offset: 3px;
}
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ------------------------------------------------------------------ entêtes */
.page-head {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.page-head h1 { font-size: 1.6rem; }
.page-head p { color: var(--muted); font-size: .88rem; margin: 4px 0 0; }
.page-head__actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--navy);
    margin: 28px 0 12px;
}
.section-title__hint { font-size: .78rem; font-weight: 600; color: var(--muted); }

/* ------------------------------------------------------------------ cartes */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
}
.card__head h2 { font-size: 1rem; }
.card__head .hint { font-size: .78rem; color: var(--muted); font-weight: 600; }
.card__head .spacer { flex: 1; }
.card__body { padding: 20px; }
.card__body--flush { padding: 0; }
.card + .card { margin-top: 18px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.stat-grid--compact { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.stat-grid--compact .stat { padding: 10px 12px; border-radius: 12px; }
.stat-grid--compact .stat__label { font-size: .65rem; }
.stat-grid--compact .stat__value { font-size: 1.25rem; margin: 2px 0; }
.stat-grid--compact .stat__hint { font-size: .72rem; }
@media (max-width: 640px) {
    .stat-grid--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .stat-grid--compact .stat { padding: 8px 10px; }
    .stat-grid--compact .stat__value { font-size: 1.05rem; }
}
.stat {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.stat::after {
    content: "";
    position: absolute;
    inset: auto -30px -46px auto;
    width: 120px; height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(224, 30, 38, .10), transparent 70%);
}
.stat__label { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.stat__value { font-size: 2rem; font-weight: 800; color: var(--navy); line-height: 1.15; margin-top: 8px; }
.stat__hint { font-size: .76rem; color: var(--muted); margin-top: 4px; }
.stat--accent { background: linear-gradient(160deg, #16233B, #0B1526); border-color: #16233B; }
.stat--accent .stat__label { color: #9FB2D1; }
.stat--accent .stat__value { color: #fff; }
.stat--accent .stat__hint { color: #93A7C7; }
.stat--accent::after { background: radial-gradient(circle, rgba(224, 30, 38, .45), transparent 70%); }

/* ------------------------------------------------------------------ boutons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 11px;
    border: 1px solid transparent;
    background: #fff;
    color: var(--navy);
    font-size: .84rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn .icon { width: 17px; height: 17px; }

.btn--primary {
    background: linear-gradient(180deg, #E2232B, #C3121A);
    border-color: #A80F17;
    color: #fff;
    box-shadow: 0 10px 20px -10px rgba(224, 30, 38, .9), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn--primary:hover { filter: brightness(1.05); }
.btn--dark { background: var(--navy); border-color: #0A1526; color: #fff; }
.btn--ghost { background: #fff; border-color: var(--line); color: var(--navy); }
.btn--ghost:hover { border-color: #C9D3E2; }
.btn--danger { background: #fff; border-color: #F3C3C5; color: var(--red-dark); }
.btn--danger:hover { background: var(--red-soft); }
.btn--sm { padding: 7px 11px; font-size: .78rem; border-radius: 9px; }
.btn--icon { padding: 7px; width: 34px; height: 34px; border-radius: 9px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

/* ------------------------------------------------------------------ tableaux */
.table-wrap { overflow: auto; border-radius: var(--radius); }
table.table { width: 100%; border-collapse: collapse; font-size: .86rem; }
table.table th {
    text-align: left;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted);
    padding: 12px 16px;
    background: #F8FAFD;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}
table.table td { padding: 13px 16px; border-bottom: 1px solid #EEF2F8; vertical-align: middle; }
table.table tbody tr:last-child td { border-bottom: 0; }
table.table tbody tr:hover { background: #FAFCFF; }
table.table .num { text-align: right; font-variant-numeric: tabular-nums; }
table.table .center { text-align: center; }
.table-empty { padding: 40px 20px; text-align: center; color: var(--muted); }

/* ------------------------------------------------------------------ badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 99px;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    background: #EEF2F8;
    color: #475569;
    border: 1px solid #E2E8F0;
    white-space: nowrap;
}
.badge--ok { background: var(--ok-soft); color: #047857; border-color: #BFEAD9; }
.badge--warn { background: var(--warn-soft); color: #92400E; border-color: #FDE68A; }
.badge--info { background: var(--info-soft); color: #1E40AF; border-color: #C7D7FB; }
.badge--red { background: var(--red-soft); color: var(--red-dark); border-color: #F8C9CB; }
.badge--danger { background: var(--red-soft); color: var(--red-dark); border-color: #F8C9CB; }
.badge--success { background: var(--ok-soft); color: #047857; border-color: #BFEAD9; }
.badge--accent { background: #FFF1F2; color: #BE123C; border-color: #FECDD3; }
.badge--dark { background: var(--navy); color: #fff; border-color: var(--navy); }

.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot--blue { background: #2563EB; }
.dot--emerald { background: #059669; }
.dot--green { background: #16A34A; }
.dot--orange { background: #EA580C; }
.dot--red { background: #DC2626; }
.dot--violet { background: #7C3AED; }
.dot--amber { background: #D97706; }
.dot--slate { background: #64748B; }

/* ------------------------------------------------------------------ formulaires */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: #475569; }
.field .hint { font-size: .75rem; color: var(--muted); font-weight: 500; }
.input, .select, .textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid #DCE4EF;
    border-radius: 10px;
    background: #fff;
    font-family: inherit;
    font-size: .88rem;
    font-weight: 600;
    color: var(--ink);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .select:focus, .textarea:focus {
    border-color: #E2232B;
    box-shadow: 0 0 0 3px rgba(224, 30, 38, .12);
}
.input::placeholder { color: var(--muted-light); font-weight: 500; }
.textarea { min-height: 92px; resize: vertical; font-weight: 500; }
.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
}
.checkbox { display: flex; align-items: center; gap: 9px; font-size: .86rem; font-weight: 600; color: #334155; }
.checkbox input { width: 17px; height: 17px; accent-color: var(--red); }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 22px; flex-wrap: wrap; }
.form-actions .spacer { flex: 1; }

/* ------------------------------------------------------------------ alertes */
.alert {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    padding: 13px 15px;
    border-radius: 12px;
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: 14px;
    border: 1px solid;
}
.alert .icon { margin-top: 1px; }
.alert--success { background: var(--ok-soft); border-color: #BFEAD9; color: #065F46; }
.alert--error { background: var(--red-soft); border-color: #F8C9CB; color: #991B1B; }
.alert--warning { background: var(--warn-soft); border-color: #FDE68A; color: #92400E; }
.alert--info { background: var(--info-soft); border-color: #C7D7FB; color: #1E40AF; }
.alert a { color: inherit; text-decoration: underline; }

/* ------------------------------------------------------------------ onglets */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px; background: #EDF1F8; border-radius: 13px; }
.tab {
    padding: 8px 14px;
    border-radius: 9px;
    font-size: .82rem;
    font-weight: 700;
    color: #52617A;
    cursor: pointer;
    border: 0;
    background: transparent;
    font-family: inherit;
}
.tab:hover { background: rgba(255, 255, 255, .7); color: var(--navy); }
.tab.is-active { background: #fff; color: var(--navy); box-shadow: var(--shadow-sm); }

/* ------------------------------------------------------------------ matrice */
.depot-panel { display: none; }
.depot-panel.is-active { display: block; }

.matrix-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    background: #FBFCFE;
}
.matrix-toolbar__hint { font-size: .78rem; color: var(--muted); font-weight: 600; }
.matrix-scroll { overflow: auto; max-height: calc(100vh - 250px); }

table.matrix { border-collapse: separate; border-spacing: 0; font-size: .8rem; min-width: 100%; }
table.matrix th, table.matrix td { padding: 7px 8px; border-bottom: 1px solid #EDF1F7; white-space: nowrap; }
table.matrix thead th {
    position: sticky;
    top: 0;
    background: #F6F9FD;
    z-index: 3;
    font-size: .64rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #52617A;
    font-weight: 800;
    text-align: center;
    border-bottom: 2px solid #E1E8F2;
    vertical-align: bottom;
}
table.matrix thead th small { display: block; font-size: .6rem; font-weight: 700; color: #94A3B8; letter-spacing: 0; text-transform: none; margin-top: 2px; }
table.matrix tbody td { text-align: center; font-variant-numeric: tabular-nums; }
table.matrix .col-ean { font-family: "Cascadia Mono", Consolas, monospace; font-size: .74rem; text-align: left; padding-left: 12px; }
table.matrix .col-style { text-align: left; max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
table.matrix .col-size { font-weight: 800; color: var(--navy); }
table.matrix .col-qty { font-weight: 700; color: #334155; background: #FBFCFE; }
table.matrix td.sticky, table.matrix th.sticky {
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 2;
}
table.matrix thead th.sticky { z-index: 4; background: #F6F9FD; }
table.matrix .group-head td {
    position: sticky;
    top: 0;
    background: #16233B;
    color: #fff;
    text-align: left;
    font-weight: 800;
    font-size: .72rem;
    letter-spacing: .04em;
    padding: 8px 12px;
}
table.matrix .group-head .dot { margin-right: 7px; }
table.matrix tr.total-row td {
    background: #F1F5FB;
    font-weight: 800;
    color: var(--navy);
    border-top: 1px solid #DDE5F1;
    border-bottom: 1px solid #DDE5F1;
}
table.matrix tr.total-row td.col-label { text-align: left; padding-left: 12px; font-size: .72rem; letter-spacing: .04em; }
table.matrix td.alloc-cell { padding: 3px; }
table.matrix input.alloc {
    width: 58px;
    padding: 6px 4px;
    text-align: center;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    font-family: inherit;
    font-size: .82rem;
    font-weight: 700;
    color: var(--navy);
    font-variant-numeric: tabular-nums;
    transition: background .12s ease, border-color .12s ease;
}
table.matrix input.alloc:hover { background: #F4F8FF; border-color: #DCE6F5; }
table.matrix input.alloc:focus { background: #fff; border-color: #E2232B; box-shadow: 0 0 0 2px rgba(224, 30, 38, .14); outline: none; }
table.matrix input.alloc.is-manual { background: #FFF7E8; border-color: #F2D48F; color: #92400E; }
table.matrix input.alloc.is-zero { color: #B6C1D2; }
table.matrix .cell--over { background: var(--red-soft) !important; }
table.matrix .cell--ok { background: var(--ok-soft) !important; }

.matrix-total-box {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    font-size: .78rem;
    font-weight: 700;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 8px;
    background: #F1F5FB;
    color: #475569;
    border: 1px solid #E3E9F2;
    font-variant-numeric: tabular-nums;
}
.chip strong { color: var(--navy); }
.chip--ok { background: var(--ok-soft); border-color: #BFEAD9; color: #065F46; }
.chip--error { background: var(--red-soft); border-color: #F8C9CB; color: #991B1B; }

/* ------------------------------------------------------------------ divers */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 18px; }
.grid-2 > * { min-width: 0; }
@media (max-width: 1020px) { .grid-2 { grid-template-columns: 1fr; } }

.share-list { display: flex; flex-direction: column; gap: 14px; }
.share-item__top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.share-item__name { font-weight: 700; font-size: .87rem; color: var(--navy); }
.share-item__pct { margin-left: auto; font-weight: 800; font-size: .86rem; color: var(--red-dark); font-variant-numeric: tabular-nums; }

.muted { color: var(--muted); }
.small { font-size: .78rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }

.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px 14px; font-size: .86rem; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; font-weight: 700; color: var(--navy); }

.progress { height: 7px; border-radius: 99px; background: #E7EDF7; overflow: hidden; }
.progress__bar { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #E2232B, #F0666B); }

.empty {
    text-align: center;
    padding: 46px 24px;
    color: var(--muted);
}
.empty .icon { width: 34px; height: 34px; color: #B7C3D6; margin-bottom: 10px; }
.empty h3 { font-size: 1rem; margin-bottom: 6px; }
.empty p { font-size: .84rem; max-width: 460px; margin: 0 auto 16px; }

/* ------------------------------------------------------------------ dropzone */
.dropzone {
    border: 2px dashed #C9D5E6;
    border-radius: var(--radius);
    background: #FBFCFE;
    padding: 34px 22px;
    text-align: center;
    transition: border-color .15s ease, background .15s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.dropzone:hover, .dropzone.is-dragover { border-color: var(--red); background: #FFF8F8; }
.dropzone .icon { width: 36px; height: 36px; color: var(--red); margin-bottom: 4px; flex-shrink: 0; }
.dropzone .btn .icon, .dropzone ~ * .icon { width: 17px; height: 17px; color: inherit; margin-bottom: 0; }
.dropzone strong { display: block; font-size: .95rem; color: var(--navy); }
.dropzone span { font-size: .8rem; color: var(--muted); }
.dropzone input[type="file"] { display: none; }
.file-name { margin-top: 10px; font-size: .82rem; font-weight: 700; color: var(--red-dark); }

/* ------------------------------------------------------------------ login */
.login-body {
    margin: 0;
    /* 100 vh / 0.8 : compense le zoom global de 20 %. */
    min-height: calc(100vh / .8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 18px;
    background: #E7EEF8;
    background-image:
        radial-gradient(circle at 18% 15%, rgba(255, 255, 255, .85) 0%, transparent 48%),
        radial-gradient(circle at 82% 88%, rgba(200, 212, 230, .6) 0%, transparent 52%);
}
.login-console {
    width: 100%;
    max-width: 420px;
    background: #E7EEF8;
    border-radius: 30px;
    border: 1.5px solid rgba(255, 255, 255, .9);
    box-shadow:
        16px 16px 34px #C1CDE0,
        -16px -16px 34px #FFFFFF,
        0 7px 0 #B6C5DC,
        0 24px 46px rgba(15, 28, 51, .16);
    padding: 34px 30px 26px;
}
.login-head { text-align: center; margin-bottom: 24px; }
.login-logo {
    width: 92px;
    height: 92px;
    border-radius: 24px;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    padding: 10px;
    background: #E7EEF8;
    box-shadow: inset 6px 6px 12px #C2CFE0, inset -6px -6px 12px #FFFFFF;
    border: 1px solid rgba(255, 255, 255, .7);
}
.login-logo img { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 3px 6px rgba(15, 28, 51, .18)); }
.login-title { font-size: 1.18rem; font-weight: 800; letter-spacing: .02em; color: #C3121A; }
.login-sub { font-size: .78rem; font-weight: 600; color: #64748B; margin-top: 5px; }
.login-pills { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.login-pills span { width: 34px; height: 6px; border-radius: 99px; box-shadow: inset 1px 1px 2px rgba(0, 0, 0, .25); }
.login-pills .p-red { background: var(--red); }
.login-pills .p-navy { background: var(--navy); }

.login-field { margin-bottom: 17px; }
.login-field label {
    display: block;
    font-size: .7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #475569;
    margin: 0 0 7px 4px;
}
.login-input-wrap { position: relative; display: flex; align-items: center; }
.login-input-wrap > .icon { position: absolute; left: 14px; width: 17px; height: 17px; color: #64748B; }
.login-input {
    width: 100%;
    padding: 13px 44px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, .7);
    background: #E7EEF8;
    box-shadow: inset 5px 5px 10px #C3CFE0, inset -5px -5px 10px #FFFFFF;
    font-family: inherit;
    font-size: .88rem;
    font-weight: 600;
    color: var(--navy);
    outline: none;
    transition: box-shadow .15s ease, border-color .15s ease;
}
.login-input:focus {
    border-color: rgba(224, 30, 38, .45);
    box-shadow: inset 6px 6px 12px #BCC9DC, inset -6px -6px 12px #FFFFFF, 0 0 0 3px rgba(224, 30, 38, .12);
}
.login-input::placeholder { color: #94A3B8; font-weight: 500; }
.pw-toggle {
    position: absolute;
    right: 8px;
    width: 32px; height: 32px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .8);
    background: #E7EEF8;
    box-shadow: 3px 3px 6px #C3CFE0, -3px -3px 6px #FFFFFF;
    color: #475569;
    display: grid;
    place-items: center;
    cursor: pointer;
    padding: 0;
}
.pw-toggle:active { box-shadow: inset 2px 2px 5px #C3CFE0, inset -2px -2px 5px #FFFFFF; }
.pw-toggle .icon { width: 16px; height: 16px; }

.login-submit {
    width: 100%;
    margin-top: 6px;
    padding: 14px 20px;
    border-radius: 16px;
    border: 1px solid #9C0F16;
    background: linear-gradient(180deg, #E4232B 0%, #B8141B 100%);
    color: #fff;
    font-family: inherit;
    font-size: .84rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    box-shadow: 0 5px 0 #7E0C12, 6px 12px 22px rgba(224, 30, 38, .3), inset 0 1px 0 rgba(255, 255, 255, .3);
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.login-submit:hover { filter: brightness(1.05); transform: translateY(-1px); }
.login-submit:active { transform: translateY(4px); box-shadow: 0 1px 0 #7E0C12, 0 4px 8px rgba(224, 30, 38, .25), inset 0 2px 4px rgba(0, 0, 0, .25); }
.login-footer {
    margin-top: 22px;
    padding-top: 15px;
    border-top: 1px solid rgba(148, 163, 184, .28);
    text-align: center;
    font-size: .72rem;
    font-weight: 600;
    color: #64748B;
    line-height: 1.6;
}
.login-error {
    background: #FEE2E2;
    border: 1px solid #FCA5A5;
    color: #991B1B;
    border-radius: 13px;
    padding: 11px 13px;
    font-size: .8rem;
    font-weight: 700;
    margin-bottom: 16px;
    box-shadow: inset 2px 2px 5px rgba(185, 28, 28, .1), 0 2px 0 rgba(255, 255, 255, .8);
}

/* ------------------------------------------------------------------ impression */
@media print {
    .sidebar, .topbar, .page-head__actions, .matrix-toolbar, .no-print { display: none !important; }
    .app-shell { grid-template-columns: 1fr; }
    .content { padding: 0; }
    .card { border: 0; box-shadow: none; }
    .matrix-scroll { max-height: none; overflow: visible; }
    body { background: #fff; }
    table.matrix thead th { position: static; }
}

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1080px) {
    .app-shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .sidebar {
        position: static;
        height: auto;
        min-height: 0;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px 14px;
        padding: 10px 14px;
        overflow-x: auto;
    }
    .brand { border: 0; padding: 0; }
    .brand__sub { display: none; }
    .nav-group { flex-direction: row; }
    .nav-group__label, .sidebar__footer, .nav-link__badge { display: none; }
    .nav-link { padding: 8px 11px; font-size: .8rem; }
    .content { padding: 18px; }
    .topbar { padding: 14px 18px; }
    .userchip__meta { display: none; }
}

@media (max-width: 640px) {
    .page-head__actions { width: 100%; margin-left: 0; }
    .kv { grid-template-columns: 1fr; gap: 4px; }
    .kv dt { margin-top: 8px; }
    .stat__value { font-size: 1.6rem; }
    .login-console { padding: 28px 20px 22px; }
    .content { padding: 14px 12px 28px; }
    .topbar { padding: 12px; flex-wrap: wrap; gap: 8px; }
    .sidebar { align-items: flex-start; }
    .nav-group { max-width: 100%; overflow-x: auto; }
    .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .hide-sm { display: none !important; }
    .table th, .table td { padding: 8px 6px; font-size: .82rem; }
    .input, .select { font-size: 16px; }
    .portail-submit-bar { flex-direction: column; align-items: stretch !important; gap: 10px !important; }
    .portail-submit-bar .btn { width: 100%; justify-content: center; }
    .error-page { margin: 8px auto; padding: 28px 20px; border-radius: 18px; }
    .error-page__actions { align-items: stretch; }
    .error-page__actions .btn { flex: 1 1 100%; }
}

/* ------------------------------------------------------------------ réassort */
table.table tfoot .total-row td {
    background: #F7FAFF;
    font-weight: 800;
    border-top: 1px solid var(--line);
}
.qty-input.is-manual {
    background: #FFF7E8;
    border-color: #F2D48F;
    color: #92400E;
}

/* ------------------------------------------------------------------ catalogue / commande */
.cat-countdown {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    border: 1px solid #FECACA;
    border-radius: 10px;
    background: linear-gradient(135deg, #FFF7ED, #FFF1F2);
    color: #B42318;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(180, 35, 24, .08);
}

.cat-countdown__unit {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
}

.cat-countdown__unit strong,
.cat-countdown__days {
    color: #C2410C;
    font-size: 1.02rem;
    font-weight: 800;
    line-height: 1;
}

.cat-countdown__unit small,
.cat-countdown__days small {
    color: #9A3412;
    font-size: .62rem;
    font-weight: 700;
}

.cat-countdown__separator { color: #FB7185; font-weight: 800; }
.cat-countdown__seconds strong { color: #E11D48; }
.cat-countdown.is-expired {
    border-color: #CBD5E1;
    background: #F1F5F9;
    color: #64748B;
    font-weight: 700;
    box-shadow: none;
}

.cat-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 22px;
    align-items: start;
}

.cat-layout > main { min-width: 0; }

.cat-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.cat-toolbar .input { flex: 1; min-width: 220px; background: #fff; }

.cat-chips { display: flex; gap: 8px; flex-wrap: wrap; }

.chip.on {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}

.chip {
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    padding: 9px 15px;
    border-radius: 99px;
    background: #fff;
    border: 1px solid #D8E0EC;
    color: var(--ink);
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.chip:hover { border-color: var(--navy); }

.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
    gap: 16px;
}

.cat-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.cat-card.is-selected {
    border-color: var(--navy);
    box-shadow: 0 0 0 2px rgba(15, 28, 51, .12), var(--shadow);
}

.cat-card__photo {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4 / 3;
    background: #F4F7FC;
    border-bottom: 1px solid var(--line);
    overflow: hidden;
}

.cat-card__photo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.cat-card__noimg {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: .72rem;
    font-weight: 600;
    color: var(--muted-light);
}

.cat-card__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 13px 14px;
}

.cat-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.cat-card__style { font-weight: 800; color: var(--navy); font-size: .82rem; }

.tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 99px;
    background: #F1F5FB;
    border: 1px solid #E3E9F2;
    color: #475569;
    font-size: .66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.cat-card__name {
    font-weight: 700;
    font-size: .87rem;
    line-height: 1.25;
    color: var(--ink);
}

.cat-card__color { font-size: .78rem; color: var(--muted); }

.cat-card__price { font-size: .78rem; color: var(--muted); }
.cat-card__price strong { color: var(--ink); font-size: .9rem; }

.cat-step {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.cat-step button {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 10px;
    border: 1px solid #D8E0EC;
    background: #fff;
    color: var(--navy);
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.cat-step button:hover:not(:disabled) { background: var(--navy); border-color: var(--navy); color: #fff; }
.cat-step button:disabled { opacity: .45; cursor: not-allowed; }

.cat-qty {
    flex: 1;
    text-align: center;
    padding: 4px 6px;
    border-radius: 10px;
    background: #F4F7FC;
    border: 1px solid var(--line);
}

.cat-qty b { display: block; font-size: 1rem; color: var(--navy); font-variant-numeric: tabular-nums; }
.cat-qty small { font-size: .64rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

.cat-line {
    min-height: 16px;
    font-size: .74rem;
    font-weight: 700;
    color: var(--ok);
    text-align: center;
}

.cat-sizes { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.cat-sizes__label {
    width: 100%;
    font-size: .64rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em;
}
.cat-size {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 2px 6px;
    border: 1px solid #DBE3EF;
    border-radius: 6px;
    background: #F8FAFC;
    color: #334155;
    font-size: .7rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.cat-side {
    position: sticky;
    top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.cat-side h2 {
    margin: 0;
    font-size: .95rem;
    letter-spacing: .01em;
}

.cat-side .field { margin: 0; }
.cat-side .field label { font-size: .74rem; }

.cat-summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 13px 14px;
    border-radius: 12px;
    background: #F7FAFF;
    border: 1px solid var(--line);
}

.cat-summary .ln {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: .8rem;
    color: var(--muted);
}

.cat-summary .ln b { color: var(--navy); font-variant-numeric: tabular-nums; }

.cat-summary__total {
    padding-top: 8px;
    border-top: 1px dashed #D8E0EC;
    font-weight: 700;
}

.cat-summary__total span { color: var(--navy); font-weight: 700; }
.cat-summary__total b { font-size: 1.02rem !important; color: var(--red) !important; }

.cat-submit { width: 100%; justify-content: center; }

.cat-last {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 11px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    text-decoration: none;
    font-size: .8rem;
}

.cat-last:hover { border-color: var(--navy); background: #F7FAFF; }

.cat-thumb {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #F4F7FC;
}

.cat-thumb--empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted-light);
}

@media (max-width: 1100px) {
    .cat-layout { grid-template-columns: 1fr; }
    .cat-side { position: static; }
}

@media (max-width: 640px) {
    .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
    .cat-card__photo { aspect-ratio: 1 / 1; }
}
