/* =====================================================================
   AMARIAH STOCK — Design system de l'application
   Identité Amariah Digital : rouge #BA0000, noir, blanc, gris.
   ===================================================================== */

:root {
    --brand: #BA0000;
    --brand-600: #9C0000;
    --brand-700: #7F0000;
    --brand-50: #FDF3F3;
    --brand-100: #FAE1E1;
    --brand-ring: rgba(186, 0, 0, .16);

    --ink: #111111;
    --ink-2: #27272A;
    --text: #18181B;
    --text-2: #52525B;
    --muted: #71717A;
    --faint: #A1A1AA;

    --bg: #F7F7F7;
    --surface: #FFFFFF;
    --surface-2: #FAFAFB;
    --line: #E8E8EC;
    --line-2: #F0F0F3;

    --success: #157F3D;  --success-bg: #EAF7EF;
    --warning: #A15C07;  --warning-bg: #FFF5E0;
    --danger:  #B42318;  --danger-bg:  #FDECEA;
    --info:    #1F4FB8;  --info-bg:    #EDF3FF;

    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 20px;
    --shadow-xs: 0 1px 2px rgba(16, 24, 40, .04);
    --shadow-sm: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
    --shadow-md: 0 8px 24px -6px rgba(16, 24, 40, .12), 0 2px 6px rgba(16, 24, 40, .05);
    --shadow-lg: 0 24px 48px -12px rgba(16, 24, 40, .22);

    --sidebar-w: 264px;
    --topbar-h: 68px;
    --bottomnav-h: 66px;
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

    --bs-body-font-family: var(--font);
    --bs-body-color: var(--text);
    --bs-body-bg: var(--bg);
    --bs-border-color: var(--line);
    --bs-primary: var(--brand);
    --bs-primary-rgb: 186, 0, 0;
    --bs-link-color: var(--brand);
    --bs-link-hover-color: var(--brand-600);
    --bs-link-color-rgb: 186, 0, 0;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 14.5px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: 'cv11', 'ss01';
    overflow-x: hidden;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { color: var(--ink); font-weight: 700; letter-spacing: -.01em; }
.text-muted, .text-secondary { color: var(--muted) !important; }
.text-ink { color: var(--ink) !important; }
.text-brand { color: var(--brand) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.fw-semibold { font-weight: 600 !important; }
.small-2 { font-size: 12.5px; }
.tabular { font-variant-numeric: tabular-nums; }
.min-w-0 { min-width: 0; }
.text-truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
::selection { background: var(--brand-100); }

/* ---------------------------------------------------------------------
   Structure
   --------------------------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; min-height: 100dvh; }
.app-main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }
.app-content { padding: 28px 32px 40px; flex: 1; width: 100%; max-width: 1480px; margin: 0 auto; }

/* ---------------------------------------------------------------------
   Sidebar
   --------------------------------------------------------------------- */
/* Menu clair : l'interface reste majoritairement blanche, le rouge signale l'élément actif */
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 1040;
    background: #fff; color: var(--text-2); border-right: 1px solid var(--line);
    display: flex; flex-direction: column;
    transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 22px 22px 18px; color: var(--ink); }
.sidebar-brand:hover { color: var(--ink); }
.brand-mark {
    width: 38px; height: 38px; border-radius: 11px; background: var(--brand);
    display: grid; place-items: center; flex-shrink: 0;
    box-shadow: 0 6px 16px -6px rgba(186, 0, 0, .7);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-name { font-weight: 800; font-size: 17px; letter-spacing: -.02em; line-height: 1.1; }
.brand-name span { color: var(--brand); }
.brand-sub { font-size: 11.5px; color: var(--muted); font-weight: 500; }

.sidebar-company {
    margin: 0 16px 10px; padding: 10px 12px; border-radius: 12px;
    background: var(--bg); border: 1px solid var(--line-2);
    display: flex; align-items: center; gap: 10px;
}
.sidebar-company .co-logo {
    width: 32px; height: 32px; border-radius: 9px; background: var(--ink); color: #fff;
    display: grid; place-items: center; font-weight: 800; font-size: 13px; overflow: hidden; flex-shrink: 0;
}
.sidebar-company .co-logo img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-company .co-name { color: var(--ink); font-weight: 700; font-size: 13.5px; line-height: 1.2; }
.sidebar-company .co-plan { font-size: 11.5px; color: var(--muted); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 6px 12px 12px; scrollbar-width: thin; scrollbar-color: #D4D4D8 transparent; }
.nav-group-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--faint); font-weight: 700; padding: 16px 12px 6px; }
.nav-item-x {
    display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin: 1px 0;
    border-radius: 10px; color: var(--text-2); font-weight: 500; font-size: 14px; position: relative;
    transition: background .15s, color .15s;
}
.nav-item-x i { width: 20px; text-align: center; font-size: 15px; color: var(--faint); transition: color .15s; }
.nav-item-x:hover { background: var(--bg); color: var(--ink); }
.nav-item-x:hover i { color: var(--text-2); }
.nav-item-x.active { background: var(--brand-50); color: var(--brand); font-weight: 700; }
.nav-item-x.active i { color: var(--brand); }
.nav-item-x.active::before {
    content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
    border-radius: 0 3px 3px 0; background: var(--brand);
}
.nav-badge {
    margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px;
    background: var(--brand); color: #fff; font-size: 11px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.sidebar-footer { padding: 12px; border-top: 1px solid var(--line-2); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; }
.sidebar-user .u-name { color: var(--ink); font-weight: 600; font-size: 13.5px; line-height: 1.2; }
.sidebar-user .u-role { color: var(--muted); font-size: 12px; }
.sidebar-close { display: none; margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 20px; padding: 6px; }
.sidebar-backdrop {
    position: fixed; inset: 0; background: rgba(10, 10, 12, .5); z-index: 1035;
    opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; backdrop-filter: blur(2px);
}

/* ---------------------------------------------------------------------
   Topbar
   --------------------------------------------------------------------- */
.topbar {
    position: sticky; top: 0; z-index: 1020; height: var(--topbar-h);
    background: rgba(255, 255, 255, .88); backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: 14px; padding: 0 32px;
}
.topbar-burger {
    display: none; width: 42px; height: 42px; border-radius: 11px; border: 1px solid var(--line);
    background: #fff; color: var(--ink); font-size: 17px; flex-shrink: 0;
}
.topbar-title { display: none; font-weight: 700; font-size: 16.5px; color: var(--ink); min-width: 0; }
.topbar-search { position: relative; flex: 1; max-width: 440px; }
.topbar-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 14px; }
.topbar-search input {
    width: 100%; height: 42px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2);
    padding: 0 14px 0 40px; font-size: 14px; color: var(--text); transition: border-color .15s, box-shadow .15s, background .15s;
}
.topbar-search input:focus { outline: 0; background: #fff; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
    position: relative; width: 42px; height: 42px; border-radius: 11px; border: 1px solid var(--line);
    background: #fff; color: var(--ink-2); display: inline-grid; place-items: center; font-size: 16px;
    transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface-2); border-color: #DADADF; color: var(--ink); }
.icon-btn .dot-count {
    position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px;
    border-radius: 999px; background: var(--brand); color: #fff; font-size: 10.5px; font-weight: 700;
    display: grid; place-items: center; border: 2px solid #fff;
}
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.user-chip:hover { background: var(--surface-2); color: var(--ink); }
.user-chip .u-name { font-weight: 600; font-size: 13.5px; line-height: 1.15; }
.user-chip .u-role { font-size: 11.5px; color: var(--muted); }

.avatar {
    width: 36px; height: 36px; border-radius: 10px; background: var(--ink); color: #fff;
    display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; letter-spacing: .02em;
}
.avatar-sm { width: 30px; height: 30px; font-size: 11.5px; border-radius: 9px; }
.avatar-lg { width: 56px; height: 56px; font-size: 19px; border-radius: 16px; }
.avatar-brand { background: var(--brand); }
.avatar-soft { background: var(--line-2); color: var(--ink-2); }

/* Dropdowns */
.dropdown-menu {
    border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-md); padding: 6px;
    font-size: 14px; --bs-dropdown-link-active-bg: var(--brand-50); --bs-dropdown-link-active-color: var(--brand);
}
.dropdown-item { border-radius: 9px; padding: 8px 12px; display: flex; align-items: center; gap: 10px; color: var(--ink-2); }
.dropdown-item i { width: 18px; text-align: center; color: var(--muted); }
.dropdown-item:hover { background: var(--surface-2); }
.dropdown-item.text-danger i { color: var(--danger); }
.notif-menu { width: 370px; max-width: calc(100vw - 24px); padding: 0; overflow: hidden; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); color: var(--text); }
.notif-item:hover { background: var(--surface-2); color: var(--text); }
.notif-item.unread { background: #FFFBFB; }
.notif-item .n-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; font-size: 14px; }
.notif-item .n-title { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.notif-item .n-msg { font-size: 13px; color: var(--text-2); line-height: 1.35; }
.notif-item .n-time { font-size: 11.5px; color: var(--faint); margin-top: 2px; }
.notif-foot { padding: 10px; text-align: center; }

/* ---------------------------------------------------------------------
   En-tête de page
   --------------------------------------------------------------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; margin: 0; letter-spacing: -.025em; }
.page-head .page-sub { color: var(--muted); margin: 4px 0 0; font-size: 14.5px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 500; font-size: 13.5px; margin-bottom: 8px; }
.back-link:hover { color: var(--ink); }

/* ---------------------------------------------------------------------
   Boutons
   --------------------------------------------------------------------- */
.btn {
    --bs-btn-font-weight: 600; --bs-btn-font-size: 14px; --bs-btn-padding-y: 9px; --bs-btn-padding-x: 16px;
    --bs-btn-border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 42px; white-space: nowrap; transition: all .15s ease; letter-spacing: -.005em;
}
.btn-sm { --bs-btn-padding-y: 6px; --bs-btn-padding-x: 11px; --bs-btn-font-size: 13px; --bs-btn-border-radius: 9px; min-height: 34px; gap: 6px; }
.btn-lg { --bs-btn-padding-y: 13px; --bs-btn-padding-x: 22px; --bs-btn-font-size: 15.5px; --bs-btn-border-radius: 13px; min-height: 52px; }
.btn-primary {
    --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-600); --bs-btn-hover-border-color: var(--brand-600);
    --bs-btn-active-bg: var(--brand-700); --bs-btn-active-border-color: var(--brand-700);
    --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
    --bs-btn-focus-shadow-rgb: 186, 0, 0;
    box-shadow: 0 1px 2px rgba(186, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.btn-dark { --bs-btn-bg: var(--ink); --bs-btn-border-color: var(--ink); --bs-btn-hover-bg: #27272A; --bs-btn-hover-border-color: #27272A; }
.btn-light {
    --bs-btn-bg: #fff; --bs-btn-border-color: var(--line); --bs-btn-color: var(--ink-2);
    --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-border-color: #D9D9DE; --bs-btn-hover-color: var(--ink);
    --bs-btn-active-bg: var(--line-2); --bs-btn-active-border-color: #D4D4D8;
    box-shadow: var(--shadow-xs);
}
.btn-soft { --bs-btn-bg: var(--brand-50); --bs-btn-border-color: transparent; --bs-btn-color: var(--brand); --bs-btn-hover-bg: var(--brand-100); --bs-btn-hover-color: var(--brand-600); --bs-btn-hover-border-color: transparent; }
.btn-ghost { --bs-btn-color: var(--text-2); --bs-btn-hover-bg: var(--line-2); --bs-btn-hover-color: var(--ink); --bs-btn-border-color: transparent; --bs-btn-hover-border-color: transparent; }
.btn-danger { --bs-btn-bg: var(--danger); --bs-btn-border-color: var(--danger); --bs-btn-hover-bg: #93190F; --bs-btn-hover-border-color: #93190F; }
.btn-icon { width: 36px; height: 36px; min-height: 36px; padding: 0; border-radius: 10px; }
.btn.is-loading { pointer-events: none; opacity: .85; }
.btn.is-loading .btn-label, .btn.is-loading > i { visibility: hidden; }
.btn.is-loading { position: relative; }
.btn.is-loading::after {
    content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
    border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.row-actions { display: inline-flex; gap: 4px; }
.row-actions .btn-icon { width: 34px; height: 34px; min-height: 34px; color: var(--muted); border: 1px solid transparent; background: transparent; }
.row-actions .btn-icon:hover { background: var(--line-2); color: var(--ink); }
.row-actions .btn-icon.danger:hover { background: var(--danger-bg); color: var(--danger); }

/* ---------------------------------------------------------------------
   Cartes
   --------------------------------------------------------------------- */
.card-x { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.card-x-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; flex-wrap: wrap; }
.card-x-head h2, .card-x-head h3 { font-size: 16px; margin: 0; }
.card-x-head .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.card-x-body { padding: 18px 20px 20px; }
.card-x-foot { padding: 12px 20px; border-top: 1px solid var(--line); }
.card-link { font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }

/* KPI */
.kpi { padding: 18px 20px; height: 100%; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kpi-label { font-size: 13.5px; color: var(--text-2); font-weight: 500; }
.kpi-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 15px; background: var(--line-2); color: var(--ink-2); flex-shrink: 0; }
.kpi-icon.brand { background: var(--brand); color: #fff; }
.kpi-icon.dark { background: var(--ink); color: #fff; }
.kpi-icon.warn { background: var(--warning-bg); color: var(--warning); }
.kpi-icon.danger { background: var(--danger-bg); color: var(--danger); }
.kpi-icon.success { background: var(--success-bg); color: var(--success); }
.kpi-value { font-size: 27px; font-weight: 800; color: var(--ink); letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums;
    display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 4px; row-gap: 2px; min-width: 0; }
.kpi-value small { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.kpi-foot { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.trend { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 12px; padding: 2px 7px; border-radius: 999px; }
.trend.up { color: var(--success); background: var(--success-bg); }
.trend.down { color: var(--danger); background: var(--danger-bg); }
/* Carte mise en avant : rouge Amariah (accent), pas de grands aplats noirs */
.kpi.highlight { background: var(--brand); border-color: var(--brand); box-shadow: 0 10px 24px -12px rgba(186, 0, 0, .55); }
.kpi.highlight .kpi-label, .kpi.highlight .kpi-foot { color: rgba(255, 255, 255, .82); }
.kpi.highlight .kpi-value { color: #fff; }
.kpi.highlight .kpi-value small { color: rgba(255, 255, 255, .78); }
.kpi.highlight .kpi-icon { background: #fff; color: var(--brand); }
.kpi.highlight .trend.up, .kpi.highlight .trend.down { background: rgba(255, 255, 255, .18); color: #fff; }
/* Carte d'alerte (stock faible) : bien visible sans être agressive */
.kpi.kpi-alert { background: var(--warning-bg); border-color: #F5D9A8; }
.kpi.kpi-alert .kpi-value { color: var(--warning); }
@media (max-width: 767.98px) { .kpi-row > .kpi-wide { flex: 0 0 100%; max-width: 100%; } }
a.kpi-link { color: inherit; display: block; height: 100%; }
a.kpi-link:hover .card-x { border-color: #D4D4D8; box-shadow: var(--shadow-sm); }

/* Mini stats (pages de liste) */
.stat-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-mini { padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.stat-mini .kpi-icon { width: 40px; height: 40px; }
.stat-mini > span { min-width: 0; }
.stat-mini .v { font-size: clamp(15px, 1.3vw, 19px); font-weight: 800; color: var(--ink); line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-mini .l { font-size: 12.5px; color: var(--muted); }

/* ---------------------------------------------------------------------
   Badges
   --------------------------------------------------------------------- */
.badge-status {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.35;
}
.badge-status i { font-size: 10.5px; }
.badge-soft-success { background: var(--success-bg); color: var(--success); }
.badge-soft-warning { background: var(--warning-bg); color: var(--warning); }
.badge-soft-danger { background: var(--danger-bg); color: var(--danger); }
.badge-soft-info { background: var(--info-bg); color: var(--info); }
.badge-soft-muted { background: var(--line-2); color: var(--text-2); }
.badge-soft-dark { background: var(--ink); color: #fff; }
.badge-soft-brand { background: var(--brand-50); color: var(--brand); }
.pay-chip { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.pay-chip i { color: var(--muted); font-size: 12.5px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 8px; background: var(--line-2); color: var(--text-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.sku { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 12px; color: var(--muted); letter-spacing: .01em; }

/* ---------------------------------------------------------------------
   Vignettes produit
   --------------------------------------------------------------------- */
.prod-thumb {
    width: 44px; height: 44px; border-radius: 11px; background: var(--line-2); color: #6B6B74;
    display: inline-grid; place-items: center; font-size: 17px; flex-shrink: 0; overflow: hidden; border: 1px solid var(--line);
}
.prod-thumb img { width: 100%; height: 100%; object-fit: cover; }
.prod-thumb-sm { width: 36px; height: 36px; font-size: 14px; border-radius: 9px; }
.prod-thumb-lg { width: 96px; height: 96px; font-size: 34px; border-radius: 18px; }
.prod-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.prod-cell .p-name { font-weight: 600; color: var(--ink); line-height: 1.3; }
.prod-cell .p-meta { font-size: 12.5px; color: var(--muted); }

/* ---------------------------------------------------------------------
   Tableaux
   --------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-x { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table-x thead th {
    font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
    background: var(--surface-2); padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; text-align: left;
}
.table-x tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; color: var(--text); }
.table-x tbody tr:last-child td { border-bottom: 0; }
.table-x tbody tr { transition: background .12s; }
.table-x tbody tr:hover { background: #FBFBFC; }
.table-x .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-x .actions { text-align: right; white-space: nowrap; width: 1%; }
.table-x tr.clickable { cursor: pointer; }
.table-x tfoot td { padding: 13px 16px; border-top: 1px solid var(--line); font-weight: 700; color: var(--ink); background: var(--surface-2); }
.table-x.compact tbody td { padding: 10px 16px; }
.card-x > .table-wrap:first-child .table-x thead th:first-child { border-top-left-radius: var(--radius); }
.card-x > .table-wrap:first-child .table-x thead th:last-child { border-top-right-radius: var(--radius); }

/* Barre de filtres */
.filters { display: flex; gap: 10px; padding: 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.filters .search { position: relative; flex: 1 1 260px; min-width: 0; }
.filters .search i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.filters .search .form-control { padding-left: 38px; }
.filters .form-select, .filters .form-control { width: auto; min-width: 150px; }
.filters .search .form-control { width: 100%; }
.filter-count { font-size: 13px; color: var(--muted); margin-left: auto; white-space: nowrap; }

/* Onglets segmentés */
.seg { display: inline-flex; background: var(--line-2); border-radius: 11px; padding: 3px; gap: 2px; flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg a, .seg button, .seg label {
    border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; font-size: 13.5px; font-weight: 600;
    color: var(--text-2); white-space: nowrap; cursor: pointer; transition: all .15s; margin: 0;
}
.seg a:hover, .seg button:hover, .seg label:hover { color: var(--ink); }
.seg .active, .seg input:checked + label { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.seg input { display: none; }

/* Pagination */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pager-info { font-size: 13px; color: var(--muted); }
.pager-links { display: flex; gap: 4px; }
.pager-links a, .pager-links span {
    min-width: 36px; height: 36px; padding: 0 10px; border-radius: 10px; display: inline-grid; place-items: center;
    font-size: 13.5px; font-weight: 600; color: var(--ink-2); border: 1px solid var(--line); background: #fff;
}
.pager-links a:hover { background: var(--surface-2); color: var(--ink); }
.pager-links .current { background: var(--ink); border-color: var(--ink); color: #fff; }
.pager-links .disabled { color: var(--faint); background: var(--surface-2); }
.pager-links .gap { border: 0; background: transparent; min-width: 20px; }

/* États vides */
.empty-state { text-align: center; padding: 48px 20px; }
.empty-state .e-icon {
    width: 64px; height: 64px; border-radius: 18px; background: var(--line-2); color: var(--muted);
    display: inline-grid; place-items: center; font-size: 24px; margin-bottom: 16px;
}
.empty-state h3 { font-size: 16.5px; margin-bottom: 6px; }
.empty-state p { color: var(--muted); max-width: 380px; margin: 0 auto 16px; font-size: 14px; }

/* ---------------------------------------------------------------------
   Formulaires
   --------------------------------------------------------------------- */
.form-label { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.form-label .req { color: var(--brand); }
.form-control, .form-select {
    min-height: 44px; border-radius: 11px; border: 1px solid #E1E1E6; font-size: 14.5px; color: var(--text);
    padding: 9px 13px; background-color: #fff; transition: border-color .15s, box-shadow .15s;
}
.form-select { padding-right: 36px; }
textarea.form-control { min-height: 88px; }
.form-control::placeholder { color: #A1A1AA; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--danger); background-image: none; padding-right: 13px; }
.form-control.is-invalid:focus, .form-select.is-invalid:focus { box-shadow: 0 0 0 4px rgba(180, 35, 24, .14); }
.invalid-feedback { font-size: 12.5px; color: var(--danger); font-weight: 500; }
.form-text { font-size: 12.5px; color: var(--muted); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 4px var(--brand-ring); border-color: var(--brand); }
.form-switch .form-check-input { width: 2.4em; height: 1.3em; }
.input-group-text { border-radius: 11px; border-color: #E1E1E6; background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 600; }
.input-group > .form-control { min-width: 0; }
.form-section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 6px 0 12px; }
.pw-field { position: relative; }
.pw-field .form-control { padding-right: 46px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); width: 38px; height: 38px; border-radius: 9px; }
.pw-toggle:hover { color: var(--ink); background: var(--line-2); }

/* Zone d'image */
.image-drop {
    display: flex; align-items: center; gap: 14px; padding: 12px; border: 1.5px dashed #D4D4D8; border-radius: 13px;
    background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s;
}
.image-drop:hover { border-color: var(--brand); background: var(--brand-50); }
.image-drop .preview { width: 64px; height: 64px; border-radius: 12px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; color: var(--faint); font-size: 22px; flex-shrink: 0; }
.image-drop .preview img { width: 100%; height: 100%; object-fit: cover; }
.image-drop input { display: none; }

/* Choix d'icône (catégories) */
.icon-picker { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.icon-picker input { display: none; }
.icon-picker label {
    aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center;
    color: var(--text-2); cursor: pointer; font-size: 15px; transition: all .12s;
}
.icon-picker label:hover { border-color: #C9C9CF; color: var(--ink); }
.icon-picker input:checked + label { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------------------------------------------------------------------
   Modales
   --------------------------------------------------------------------- */
.modal { --bs-modal-border-radius: 20px; --bs-modal-border-width: 0; --bs-modal-padding: 22px; --bs-modal-header-padding: 20px 22px 6px; }
.modal-content { box-shadow: var(--shadow-lg); }
.modal-header { border-bottom: 0; align-items: flex-start; }
.modal-title { font-size: 18px; font-weight: 700; }
.modal-subtitle { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.modal-footer { border-top: 1px solid var(--line); padding: 14px 22px; gap: 8px; }
.modal-footer > * { margin: 0; }
.modal-backdrop.show { opacity: .45; }
.modal-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 21px; margin-bottom: 14px; }
.btn-close { width: 34px; height: 34px; border-radius: 10px; padding: 0; background-size: 12px; opacity: .6; flex-shrink: 0; }
.btn-close:hover { background-color: var(--line-2); opacity: 1; }

/* ---------------------------------------------------------------------
   Toasts
   --------------------------------------------------------------------- */
.toast-stack { position: fixed; top: 16px; right: 16px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; width: 380px; max-width: calc(100vw - 32px); pointer-events: none; }
.toast-x {
    pointer-events: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-md);
    display: flex; gap: 12px; padding: 14px 14px 14px 16px; position: relative; overflow: hidden;
    animation: toastIn .32s cubic-bezier(.2, .9, .3, 1.2);
}
.toast-x.hide { animation: toastOut .25s ease forwards; }
.toast-x .t-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; font-size: 14px; }
.toast-x.success .t-icon { background: var(--success-bg); color: var(--success); }
.toast-x.error .t-icon { background: var(--danger-bg); color: var(--danger); }
.toast-x.warning .t-icon { background: var(--warning-bg); color: var(--warning); }
.toast-x.info .t-icon { background: var(--info-bg); color: var(--info); }
.toast-x .t-title { font-weight: 700; font-size: 14px; color: var(--ink); }
.toast-x .t-msg { font-size: 13.5px; color: var(--text-2); line-height: 1.4; }
.toast-x .t-close { margin-left: auto; border: 0; background: none; color: var(--faint); padding: 0 4px; align-self: flex-start; font-size: 15px; }
.toast-x .t-bar { position: absolute; left: 0; bottom: 0; height: 3px; background: currentColor; opacity: .25; animation: toastBar linear forwards; }
.toast-x.success .t-bar { color: var(--success); }
.toast-x.error .t-bar { color: var(--danger); }
.toast-x.warning .t-bar { color: var(--warning); }
.toast-x.info .t-bar { color: var(--info); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px); } }
@keyframes toastBar { from { width: 100%; } to { width: 0; } }

/* ---------------------------------------------------------------------
   Graphiques
   --------------------------------------------------------------------- */
.chart-box { position: relative; height: 290px; }
.chart-box.sm { height: 220px; }
.chart-box.xs { height: 180px; }
.chart-box canvas { position: relative; z-index: 1; }
.chart-box.is-loading::before {
    content: ''; position: absolute; inset: 0; border-radius: 12px; z-index: 0;
    background: linear-gradient(90deg, var(--line-2) 0%, #FAFAFB 50%, var(--line-2) 100%); background-size: 200% 100%;
    animation: shimmer 1.3s infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.legend-x { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--text-2); }
.legend-x .sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 7px; vertical-align: -1px; }
.donut-legend { display: flex; flex-direction: column; gap: 10px; }
.donut-legend .row-l { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.donut-legend .row-l .name { color: var(--text-2); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-legend .row-l .val { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.donut-legend .row-l .pct { color: var(--muted); font-size: 12.5px; width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.donut-wrap { position: relative; }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; z-index: 2; }
.donut-center .v { font-size: 18px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.donut-center .l { font-size: 12px; color: var(--muted); }

/* Barres de classement */
.rank-list { display: flex; flex-direction: column; gap: 14px; }
.rank-item .r-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; margin-bottom: 6px; }
.rank-item .r-name { font-weight: 600; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-item .r-val { color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank-bar { height: 8px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.rank-bar span { display: block; height: 100%; border-radius: 999px; background: var(--ink); }
.rank-item:first-child .rank-bar span { background: var(--brand); }

/* ---------------------------------------------------------------------
   Alertes & listes
   --------------------------------------------------------------------- */
.alert-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line-2); color: var(--text); }
.alert-row:hover { background: var(--surface-2); color: var(--text); }
.alert-row .a-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; font-size: 14px; }
.alert-row .a-icon.out { background: var(--danger-bg); color: var(--danger); }
.alert-row .a-icon.low { background: var(--warning-bg); color: var(--warning); }
.alert-row .a-title { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.alert-row .a-msg { font-size: 13px; color: var(--text-2); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line-2); }
.stock-meter { height: 6px; border-radius: 999px; background: var(--line-2); overflow: hidden; width: 90px; }
.stock-meter span { display: block; height: 100%; border-radius: 999px; background: var(--success); }
.stock-meter.low span { background: #E3A008; }
.stock-meter.out span { background: var(--danger); }

.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: 13px; font-size: 13.5px; line-height: 1.45; }
.callout i { margin-top: 2px; }
.callout-info { background: var(--info-bg); color: #1E3A8A; }
.callout-warning { background: var(--warning-bg); color: #7C4A03; }
.callout-dark { background: var(--ink); color: #E4E4E7; }
.callout-brand { background: var(--brand-50); color: var(--brand-700); }

/* Détail (fiches) */
.detail-list { display: grid; grid-template-columns: 1fr; gap: 0; }
.detail-list .d-row { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.detail-list .d-row:last-child { border-bottom: 0; }
.detail-list .d-label { color: var(--muted); }
.detail-list .d-val { color: var(--ink); font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.profile-head { display: flex; align-items: center; gap: 16px; }
.contact-line { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); padding: 6px 0; overflow-wrap: anywhere; }
.contact-line i { width: 18px; color: var(--faint); text-align: center; }

/* Carte contact (fournisseurs / clients) */
.contact-card { padding: 18px; display: flex; flex-direction: column; gap: 14px; height: 100%; }
.contact-card .c-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.contact-card .c-name { font-weight: 700; color: var(--ink); line-height: 1.25; }
.contact-card .c-sub { font-size: 13px; color: var(--muted); }
.contact-card .c-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.contact-card .c-stat { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 11px; padding: 10px 12px; }
.contact-card .c-stat .v { font-weight: 700; color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; }
.contact-card .c-stat .l { font-size: 12px; color: var(--muted); }
.contact-card .c-actions { display: flex; gap: 8px; margin-top: auto; }
.contact-card .c-actions .btn { flex: 1; }

/* Paramètres */
.settings-nav { display: flex; flex-direction: column; gap: 2px; padding: 8px; position: sticky; top: calc(var(--topbar-h) + 20px); }
.settings-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: var(--text-2); font-weight: 500; }
.settings-nav a i { width: 18px; text-align: center; color: var(--muted); }
.settings-nav a:hover { background: var(--surface-2); color: var(--ink); }
.settings-nav a.active { background: var(--brand-50); color: var(--brand); font-weight: 600; }
.settings-nav a.active i { color: var(--brand); }
.settings-section { scroll-margin-top: calc(var(--topbar-h) + 20px); }

/* Rôles */
.role-card { padding: 16px; border: 1px solid var(--line); border-radius: 13px; height: 100%; }
.role-card ul { list-style: none; padding: 0; margin: 10px 0 0; font-size: 13px; color: var(--text-2); }
.role-card li { padding: 3px 0; display: flex; gap: 8px; }
.role-card li i { color: var(--success); margin-top: 4px; font-size: 11px; }

/* ---------------------------------------------------------------------
   Point de vente (nouvelle vente) & achats
   --------------------------------------------------------------------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; align-items: start; }
.pos-products { min-width: 0; }
.pos-toolbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.pos-search { position: relative; }
.pos-search i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.pos-search input { height: 50px; border-radius: 13px; padding-left: 44px; font-size: 15px; box-shadow: var(--shadow-xs); }
.cat-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.cat-chips::-webkit-scrollbar { display: none; }
.cat-chip {
    border: 1px solid var(--line); background: #fff; color: var(--text-2); padding: 7px 14px; border-radius: 999px;
    font-size: 13.5px; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; transition: all .15s;
}
.cat-chip:hover { border-color: #CFCFD4; color: var(--ink); }
.cat-chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.pos-tile {
    position: relative; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px;
    display: flex; flex-direction: column; gap: 10px; transition: border-color .15s, box-shadow .15s, transform .1s; cursor: pointer; min-width: 0;
}
.pos-tile:hover { border-color: #CFCFD4; box-shadow: var(--shadow-sm); }
.pos-tile:active { transform: scale(.98); }
.pos-tile.in-cart { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.pos-tile.disabled { opacity: .5; cursor: not-allowed; }
.pos-tile .prod-thumb { width: 100%; height: 84px; border-radius: 10px; font-size: 26px; }
.pos-tile .t-name { font-weight: 600; font-size: 13.5px; color: var(--ink); line-height: 1.3; min-height: 35px; }
.pos-tile .t-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.pos-tile .t-price { font-weight: 800; color: var(--ink); font-size: 14.5px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.pos-tile .t-stock { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.pos-tile .t-stock.low { color: var(--warning); font-weight: 600; }
.pos-tile .t-stock.out { color: var(--danger); font-weight: 600; }
.pos-tile .t-qty {
    position: absolute; top: 8px; right: 8px; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px;
    background: var(--brand); color: #fff; font-weight: 800; font-size: 12.5px; display: none; place-items: center; z-index: 2;
    box-shadow: 0 4px 10px -2px rgba(186, 0, 0, .5);
}
.pos-tile.in-cart .t-qty { display: grid; }

.cart { position: sticky; top: calc(var(--topbar-h) + 20px); display: flex; flex-direction: column; max-height: calc(100vh - var(--topbar-h) - 40px); }
.cart-head { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cart-head h2 { font-size: 16.5px; margin: 0; }
.cart-lines { flex: 1; overflow-y: auto; min-height: 120px; }
.cart-line { display: flex; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); align-items: center; }
.cart-line .l-name { font-weight: 600; font-size: 13.5px; color: var(--ink); line-height: 1.3; }
.cart-line .l-price { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cart-line .l-total { font-weight: 700; font-size: 14px; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; }
.stepper button { width: 32px; height: 32px; border: 0; background: transparent; color: var(--ink-2); font-size: 12px; }
.stepper button:hover { background: var(--line-2); }
.stepper input { width: 42px; height: 32px; border: 0; text-align: center; font-weight: 700; font-size: 14px; padding: 0; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { outline: 0; background: var(--brand-50); }
.cart-empty { text-align: center; padding: 36px 20px; color: var(--muted); font-size: 14px; }
.cart-empty i { font-size: 30px; color: #D4D4D8; margin-bottom: 10px; display: block; }
.cart-foot { padding: 16px 18px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.pay-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pay-options input { display: none; }
.pay-options label {
    border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 9px 4px; text-align: center; cursor: pointer;
    font-size: 11.5px; font-weight: 600; color: var(--text-2); display: flex; flex-direction: column; align-items: center; gap: 5px; transition: all .12s; line-height: 1.15;
}
.pay-options label i { font-size: 16px; color: var(--muted); }
.pay-options input:checked + label { border-color: var(--ink); background: var(--ink); color: #fff; }
.pay-options input:checked + label i { color: #fff; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; }
.cart-total .l { font-size: 14px; color: var(--text-2); font-weight: 600; }
.cart-total .v { font-size: 26px; font-weight: 800; color: var(--ink); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.cart-pay { display: flex; flex-direction: column; gap: 14px; }
.change-line { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--text-2); }
.change-line b { color: var(--success); font-variant-numeric: tabular-nums; }

.cart-bar { display: none; }
.success-check { width: 72px; height: 72px; border-radius: 50%; background: var(--success-bg); color: var(--success); display: grid; place-items: center; font-size: 30px; margin: 0 auto 16px; animation: pop .45s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.receipt-lines { font-size: 13.5px; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); padding: 10px 0; margin: 14px 0; text-align: left; }
.receipt-lines div { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }

/* Lignes d'achat */
.po-line { display: grid; grid-template-columns: minmax(0, 1fr) 110px 150px 140px 40px; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.po-line .po-total { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
.po-head { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 0 8px; border-bottom: 1px solid var(--line); }
.po-line .lbl { display: none; }

/* Document (reçu, bon d'achat) */
.doc { max-width: 820px; }
.doc-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 24px; border-bottom: 1px solid var(--line); }
.doc-brand { display: flex; gap: 12px; align-items: center; }
.doc-brand .co-logo { width: 46px; height: 46px; border-radius: 12px; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; overflow: hidden; }
.doc-brand .co-logo img { width: 100%; height: 100%; object-fit: cover; }
.doc-meta { text-align: right; }
.doc-meta .ref { font-size: 20px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.doc-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 20px 24px; }
.doc-parties .lbl { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.doc-totals { display: flex; justify-content: flex-end; padding: 16px 24px 24px; }
.doc-totals table { min-width: 280px; font-size: 14px; }
.doc-totals td { padding: 5px 0; }
.doc-totals td:last-child { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.doc-totals .grand td { font-size: 19px; font-weight: 800; color: var(--ink); padding-top: 10px; border-top: 1px solid var(--line); }

/* ---------------------------------------------------------------------
   Navigation mobile (barre inférieure + bouton flottant)
   --------------------------------------------------------------------- */
.bottom-nav { display: none; }
.fab { display: none; }

/* ---------------------------------------------------------------------
   Page d'erreur
   --------------------------------------------------------------------- */
.error-page { min-height: 60vh; display: grid; place-items: center; text-align: center; }
.error-page .code { font-size: 64px; font-weight: 800; color: var(--brand); letter-spacing: -.04em; line-height: 1; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (min-width: 1400px) and (max-width: 1699.98px) {
    .col-xxl-2 .kpi-value { font-size: 23px; }
}

@media (max-width: 1399.98px) {
    .pos { grid-template-columns: minmax(0, 1fr) 360px; }
}

@media (max-width: 1199.98px) {
    .app-main { margin-left: 0; }
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); width: min(300px, 86vw); }
    body.sidebar-open .sidebar { transform: none; }
    body.sidebar-open .sidebar-backdrop { opacity: 1; visibility: visible; }
    body.sidebar-open { overflow: hidden; }
    .sidebar-close { display: block; }
    .topbar-burger { display: inline-grid; place-items: center; }
    .topbar { padding: 0 24px; }
    .app-content { padding: 24px; }
    .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 991.98px) {
    .pos { grid-template-columns: 1fr; }
    .cart { position: static; max-height: none; }
    .settings-nav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
    .settings-nav a { white-space: nowrap; }
    .po-line { grid-template-columns: minmax(0, 1fr) 90px 130px 40px; }
    .po-line .po-total { display: none; }
}

/* ---- Smartphone ---- */
@media (max-width: 767.98px) {
    body { font-size: 14.5px; }
    :root { --topbar-h: 60px; }
    .topbar { padding: 0 16px; gap: 10px; padding-top: env(safe-area-inset-top); height: calc(var(--topbar-h) + env(safe-area-inset-top)); }
    .topbar-search, .topbar .desktop-only, .user-chip .u-meta { display: none !important; }
    .topbar-title { display: block; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .topbar-burger, .icon-btn { width: 40px; height: 40px; }
    .user-chip { padding: 2px; border: 0; }
    .app-content { padding: 18px 16px calc(var(--bottomnav-h) + 34px + env(safe-area-inset-bottom)); }
    .page-head { margin-bottom: 18px; align-items: flex-start; }
    .page-head h1 { font-size: 22px; }
    .page-head .page-sub { font-size: 13.5px; }
    .page-actions { width: 100%; }
    .page-actions .btn { flex: 1 1 auto; }
    .page-actions .btn.mobile-hide, .mobile-hide { display: none !important; }
    .kpi { padding: 14px; gap: 10px; }
    .kpi-value { font-size: 21px; }
    .kpi-value small { font-size: 12px; }
    .kpi-label { font-size: 12.5px; }
    .kpi-icon { width: 34px; height: 34px; font-size: 14px; border-radius: 10px; }
    .kpi-foot { font-size: 11.5px; }
    .card-x-head { padding: 16px 16px 0; }
    .card-x-body { padding: 16px; }
    .stat-strip { gap: 10px; margin-bottom: 16px; }
    .stat-mini { padding: 12px; gap: 8px; flex-direction: column; align-items: flex-start; }
    .stat-mini .kpi-icon { width: 34px; height: 34px; }
    .stat-mini .v { font-size: 15.5px; }
    .chart-box { height: 230px; }
    .alert-row, .list-row { padding: 12px 16px; }

    /* Filtres empilés */
    .filters { padding: 12px; gap: 8px; }
    .filters .search { flex-basis: 100%; }
    .filters .form-select, .filters .form-control:not(.search .form-control) { flex: 1 1 calc(50% - 4px); min-width: 0; }
    .filter-count { width: 100%; margin: 0; }

    /* Tableaux -> cartes */
    .table-cards thead { display: none; }
    .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
    .table-cards tbody tr { padding: 14px 16px; border-bottom: 1px solid var(--line); position: relative; display: flex; flex-direction: column; }
    .table-cards tbody tr:last-child { border-bottom: 0; }
    .table-cards tbody td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; min-height: 28px; }
    .table-cards tbody td::before { content: attr(data-label); font-size: 12.5px; color: var(--muted); font-weight: 500; text-align: left; flex-shrink: 0; }
    .table-cards tbody td.td-main { padding: 0 0 8px; display: block; text-align: left; }
    .table-cards tbody td.td-main::before, .table-cards tbody td.no-label::before { display: none; }
    .table-cards tbody td.td-main.has-actions { padding-right: 90px; }
    .table-cards tbody td.actions { width: 100%; justify-content: flex-end; padding-top: 8px; margin-top: 4px; border-top: 1px dashed var(--line); }
    .table-cards tbody td.actions::before { display: none; }
    .table-cards tbody td.actions-top { position: absolute; top: 10px; right: 10px; width: auto; padding: 0; margin: 0; border: 0; }
    .table-cards tbody td.num { text-align: right; }
    .table-cards tfoot { display: block; }
    .table-cards tfoot tr { display: flex; justify-content: space-between; }
    .table-cards tfoot td { display: block; border: 0; }
    .table-cards tfoot td.hide-sm { display: none; }
    .table-cards .empty-cell::before { display: none; }
    .table-cards .empty-cell { display: block !important; text-align: center !important; }

    .pager { justify-content: center; padding: 12px; }
    .pager-info { width: 100%; text-align: center; }
    .pager-links .hide-sm { display: none; }

    /* Modales en bas d'écran (bottom sheet) */
    .modal-dialog:not(.modal-keep) { margin: 0; position: fixed; bottom: 0; left: 0; right: 0; max-width: none; width: 100%; min-height: 0; height: auto; display: flex; align-items: flex-end; }
    .modal-dialog:not(.modal-keep) .modal-content { border-radius: 22px 22px 0 0; max-height: 94vh; max-height: 94dvh; }
    .modal-dialog:not(.modal-keep) .modal-body { overflow-y: auto; }
    .modal.fade .modal-dialog:not(.modal-keep) { transform: translateY(100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
    .modal.show .modal-dialog:not(.modal-keep) { transform: none; }
    .modal-dialog:not(.modal-keep) .modal-content::before { content: ''; width: 40px; height: 4px; border-radius: 4px; background: #D4D4D8; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); }
    .modal { --bs-modal-padding: 18px; --bs-modal-header-padding: 22px 18px 4px; }
    .modal-footer { padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); }
    .modal-footer .btn { flex: 1; }

    .toast-stack { top: calc(10px + env(safe-area-inset-top)); left: 12px; right: 12px; width: auto; max-width: none; }

    /* Barre de navigation inférieure */
    .bottom-nav {
        display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
        height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
        background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
    }
    .bottom-nav a, .bottom-nav button {
        border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
        font-size: 11px; font-weight: 600; color: var(--muted); position: relative; padding: 0;
    }
    .bottom-nav a i, .bottom-nav button i { font-size: 18px; }
    .bottom-nav .active { color: var(--ink); }
    .bottom-nav .active::after { content: ''; position: absolute; top: 0; width: 24px; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }
    .bottom-nav .bn-main { color: var(--ink); }
    .bottom-nav .bn-main .bn-circle {
        width: 52px; height: 52px; border-radius: 17px; background: var(--brand); color: #fff; display: grid; place-items: center;
        margin-top: -24px; box-shadow: 0 10px 22px -8px rgba(186, 0, 0, .75); border: 4px solid #fff;
    }
    .bottom-nav .bn-main .bn-circle i { font-size: 19px; }
    .bottom-nav .bn-main.active::after { display: none; }
    .bottom-nav .bn-badge { position: absolute; top: 7px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 10px; display: grid; place-items: center; }

    .fab {
        display: inline-flex; align-items: center; gap: 9px; position: fixed; right: 16px; z-index: 1025;
        bottom: calc(var(--bottomnav-h) + 16px + env(safe-area-inset-bottom));
        background: var(--ink); color: #fff; border: 0; border-radius: 16px; padding: 0 20px; height: 52px;
        font-weight: 700; font-size: 14.5px; box-shadow: 0 12px 28px -10px rgba(0, 0, 0, .55);
    }
    .fab i { font-size: 16px; }
    .fab:active { transform: scale(.97); }

    /* Point de vente mobile */
    .pos-page .app-content { padding-bottom: calc(var(--bottomnav-h) + 110px + env(safe-area-inset-bottom)); }
    .pos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .pos-tile { padding: 10px; gap: 8px; }
    .pos-tile .prod-thumb { height: 70px; }
    .pos-tile .t-name { font-size: 13px; }
    .pos-search input { height: 48px; }
    .cart {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 1045; border-radius: 22px 22px 0 0; max-height: 92vh; max-height: 92dvh;
        transform: translateY(105%); transition: transform .32s cubic-bezier(.2, .8, .2, 1); border: 0; box-shadow: var(--shadow-lg);
    }
    body.cart-open .cart { transform: none; }
    body.cart-open .sidebar-backdrop { opacity: 1; visibility: visible; }
    .cart-head { padding-top: 22px; position: relative; }
    .cart-head::before { content: ''; width: 40px; height: 4px; border-radius: 4px; background: #D4D4D8; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); }
    .cart { overflow-y: auto; overscroll-behavior: contain; }
    .cart-lines { flex: none; overflow: visible; min-height: 0; }
    .cart-foot { border-radius: 0; padding-bottom: 0; }
    .cart-pay {
        position: sticky; bottom: 0; z-index: 2; margin: 0 -18px; gap: 10px;
        padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); background: var(--surface-2);
        border-top: 1px solid var(--line); box-shadow: 0 -10px 20px -14px rgba(0, 0, 0, .25);
    }
    .cart-head { position: sticky; top: 0; z-index: 2; background: #fff; }
    .cart-bar {
        display: flex; align-items: center; gap: 12px; position: fixed; left: 12px; right: 12px; z-index: 1028;
        bottom: calc(var(--bottomnav-h) + 12px + env(safe-area-inset-bottom));
        background: var(--ink); color: #fff; border: 0; border-radius: 16px; padding: 10px 10px 10px 16px; box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .6);
        text-align: left;
    }
    .cart-bar .cb-count { width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .12); display: grid; place-items: center; font-weight: 800; flex-shrink: 0; }
    .cart-bar .cb-label { font-size: 12px; color: #A1A1AA; line-height: 1.1; }
    .cart-bar .cb-total { font-size: 17px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
    .cart-bar .cb-go { margin-left: auto; background: var(--brand); color: #fff; border-radius: 12px; padding: 10px 14px; font-weight: 700; font-size: 14px; display: inline-flex; gap: 8px; align-items: center; }
    .cart-bar.empty .cb-go { background: rgba(255, 255, 255, .12); }

    .po-head { display: none; }
    .po-line { grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; margin-bottom: 10px; background: var(--surface-2); position: relative; }
    .po-line > :first-child { grid-column: 1 / -1; padding-right: 44px; }
    .po-line .po-remove { position: absolute; top: 14px; right: 12px; }
    .po-line .lbl { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }

    .doc-head { padding: 18px; }
    .doc-meta { text-align: left; }
    .doc-parties { grid-template-columns: 1fr; padding: 16px 18px; }
    .doc-totals { padding: 14px 18px 18px; }
    .doc-totals table { width: 100%; min-width: 0; }
    .icon-picker { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 380px) {
    .kpi-value { font-size: 19px; }
    .pay-options label { font-size: 10.5px; }
}

/* Impression (reçus, bons, rapports) */
@media print {
    .sidebar, .topbar, .bottom-nav, .fab, .page-actions, .no-print, .toast-stack, .back-link { display: none !important; }
    .app-main { margin: 0 !important; }
    .app-content { padding: 0 !important; max-width: none; }
    body { background: #fff; }
    .card-x { box-shadow: none; border-color: #ddd; }
    .doc { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Ma boutique : carte du lien public */
.shop-link-card { background: var(--ink); border-color: var(--ink); color: #fff; padding: 22px; }
.shop-link-card .kpi-label, .shop-link-card .kpi-foot { color: #A1A1AA; font-size: 13.5px; }
.shop-link-card .kpi-icon { background: var(--brand); color: #fff; }

/* =====================================================================
   Deux espaces : Gestion de stock / Ma boutique en ligne
   ===================================================================== */
.space-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 12px 0 4px; }
.space-switch a { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 10px 9px; border-radius: 12px; border: 1px solid var(--line); color: var(--text-2); font-size: 12.5px; font-weight: 600; line-height: 1.2; transition: background .15s, border-color .15s, color .15s; }
.space-switch a i { font-size: 15px; color: var(--faint); }
.space-switch a small { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); margin-bottom: 2px; }
.space-switch a:hover { color: var(--ink); background: var(--bg); }
.space-switch a.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.space-switch a.active i { color: #fff; }
.space-switch a.active small { color: rgba(255, 255, 255, .78); }

.space-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; background: var(--line-2); color: var(--ink); font-size: 12.5px; font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.space-chip i { color: var(--brand); }
.space-chip:hover { color: var(--ink); background: #E7E7EB; }
@media (max-width: 575.98px) {
    .space-chip { padding: 0; width: 36px; height: 36px; justify-content: center; }
    .space-chip span { display: none; }
}

/* Accueil : choix de l'espace */
.home-hello { margin-bottom: 18px; }
.home-hello h1 { font-size: clamp(24px, 4vw, 32px); margin-bottom: 4px; }
.home-hello p { color: var(--muted); font-size: 16px; margin: 0; }
.space-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 992px) { .space-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.space-card { display: flex; flex-direction: column; gap: 16px; padding: 22px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-xs); }
.space-card.dark { background: var(--ink); border-color: var(--ink); color: #D4D4D8; }
.space-card-top { display: flex; align-items: center; gap: 14px; }
.space-card-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 22px; background: var(--brand); color: #fff; flex-shrink: 0; }
.space-card.dark .space-card-icon { background: #fff; color: var(--brand); }
.space-card h2 { font-size: 20px; margin: 0; letter-spacing: -.02em; }
.space-card.dark h2 { color: #fff; }
.space-card .sub { font-size: 14px; color: var(--muted); }
.space-card.dark .sub { color: #A1A1AA; }
.space-feats { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.space-feats li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--line-2); font-size: 13px; font-weight: 600; color: var(--text-2); }
.space-card.dark .space-feats li { background: rgba(255, 255, 255, .08); color: #E4E4E7; }
.space-figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.space-fig { border-radius: 14px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line-2); min-width: 0; }
.space-card.dark .space-fig { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .08); }
.space-fig .v { font-size: 18px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.space-card.dark .space-fig .v { color: #fff; }
.space-fig .l { font-size: 12.5px; color: var(--muted); }
.space-card .btn-lg { margin-top: auto; }

/* Lien de la boutique très visible */
.shop-link-hero { display: flex; flex-direction: column; gap: 14px; }
.shop-link-url { font-size: clamp(16px, 2.4vw, 21px); font-weight: 800; color: #fff; word-break: break-all; letter-spacing: -.01em; }
.share-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 768px) { .share-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.share-grid .btn { justify-content: center; }

/* Nuancier de couleurs */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch span { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; color: #fff; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); transition: transform .12s; }
.swatch span i { opacity: 0; }
.swatch input:checked + span { transform: scale(1.06); box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ink); }
.swatch input:checked + span i { opacity: 1; }
.swatch input:focus-visible + span { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--brand); }
.layout-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.layout-option { position: relative; margin: 0; }
.layout-option input { position: absolute; opacity: 0; }
.layout-option span { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; height: 100%; }
.layout-option span i { font-size: 18px; color: var(--muted); }
.layout-option input:checked + span { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.layout-option input:checked + span i { color: var(--brand); }

/* Aperçu de la boutique (personnalisation) */
.shop-preview { border: 1px solid var(--line); border-radius: 22px; overflow: hidden; background: #F6F6F8; max-width: 360px; margin: 0 auto; }
.shop-preview-top { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: #fff; border-bottom: 1px solid var(--line); font-weight: 800; font-size: 13px; color: var(--ink); }
.shop-preview-top .lg { width: 26px; height: 26px; border-radius: 8px; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 10px; overflow: hidden; }
.shop-preview-top .lg img { width: 100%; height: 100%; object-fit: cover; }
.shop-preview-hero { margin: 10px; border-radius: 16px; padding: 18px 14px; color: #fff; background: var(--pv, #BA0000) center/cover no-repeat; position: relative; overflow: hidden; }
.shop-preview-hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .15), rgba(0, 0, 0, .55)); }
.shop-preview-hero.no-cover::before { background: none; }
.shop-preview-hero > * { position: relative; }
.shop-preview-hero b { font-size: 17px; display: block; }
.shop-preview-hero small { opacity: .85; }
.shop-preview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 10px 12px; }
.shop-preview-grid.list { grid-template-columns: 1fr; }
.shop-preview-item { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.shop-preview-grid.list .shop-preview-item { flex-direction: row; align-items: center; }
.shop-preview-item .im { aspect-ratio: 1; border-radius: 8px; background: var(--line-2); }
.shop-preview-grid.list .shop-preview-item .im { width: 46px; flex-shrink: 0; }
.shop-preview-item .bt { background: var(--pv, #BA0000); color: #fff; border-radius: 7px; text-align: center; font-size: 11px; font-weight: 700; padding: 4px; }
.shop-preview-grid.list .shop-preview-item .bt { margin-left: auto; padding: 4px 10px; }
.shop-preview-item .nm { font-size: 11.5px; font-weight: 700; color: var(--ink); }

/* Alertes en direct */
.toast-x.live .t-icon { background: var(--brand); color: #fff; }
.toast-x .t-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-weight: 700; font-size: 13.5px; color: var(--brand); }

/* Options de livraison (vendeur) */
.zone-row { display: grid; grid-template-columns: minmax(0, 1fr) 160px auto; gap: 8px; align-items: center; }
@media (max-width: 575.98px) { .zone-row { grid-template-columns: minmax(0, 1fr) auto; } .zone-row .input-group { grid-column: 1; } .zone-row > button { grid-row: 1 / span 2; grid-column: 2; } }

/* À réapprovisionner (page Stock / Alertes) */
.restock { border-color: #F3C9C9; }
.restock-grid { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 6px 16px 16px; }
@media (min-width: 992px) { .restock-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.restock-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 13px; border: 1px solid var(--line); background: #fff; min-width: 0; }
.restock-item .r-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.restock-item.low .r-icon { background: var(--warning-bg); color: var(--warning); }
.restock-item.out .r-icon { background: var(--danger-bg); color: var(--danger); }
.restock-item .r-name { font-weight: 700; color: var(--ink); }
.restock-item .r-msg { font-size: 13px; color: var(--text-2); }
.restock-item.out .r-msg { color: var(--danger); font-weight: 600; }
@media (max-width: 420px) { .restock-item { flex-wrap: wrap; } .restock-item .btn { width: 100%; } }

/* Caisse : baisse du stock montrée après la vente */
.stock-update { text-align: left; background: var(--bg); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; }
.stock-update .su-title { font-size: 12.5px; font-weight: 700; color: var(--success); display: flex; align-items: center; gap: 7px; }
.space-card { min-width: 0; }
.space-card-top > div { min-width: 0; }
@media (max-width: 360px) {
    .space-card { padding: 16px; }
    .space-card h2 { font-size: 18px; }
    .space-card-icon { width: 46px; height: 46px; font-size: 19px; }
    .space-figs { grid-template-columns: minmax(0, 1fr); }
}
.space-card .btn { white-space: normal; text-align: center; }
