/* =================================================================
   eStock · Liquid Glass (Aurora) — Sidebar + Contenu clair
   ================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Marque */
    --brand:        #155bd0;
    --brand-2:      #1049ad;
    --brand-soft:   #edf4ff;

    /* Texte */
    --ink:          #0f172a;
    --ink-2:        #334155;
    --ink-3:        #64748b;
    --ink-4:        #94a3b8;

    /* Glass */
    --glass-bg:     rgba(255, 255, 255, 0.25);
    --glass-strong: rgba(255, 255, 255, 0.42);
    --glass-border: rgba(255, 255, 255, 0.65);
    --glass-blur:   8px;
    --glass-sat:    190%;

    /* Surfaces opaques (pour les éléments où le glass ne convient pas) */
    --surface:      #ffffff;
    --line:         rgba(255, 255, 255, 0.45);
    --line-2:       rgba(255, 255, 255, 0.3);

    /* Sidebar */
    --side-bg:      #1e293b;
    --side-bg-dark: #0f172a;
    --side-ink:     #cbd5e1;
    --side-ink-2:   #94a3b8;
    --side-active:  rgba(99, 102, 241, .18);
    --side-active-border: rgba(99, 102, 241, .60);
    --side-hover:   rgba(255, 255, 255, .06);
    --side-border:  rgba(255, 255, 255, .07);

    /* États */
    --green:        #10b981;
    --red:          #ef4444;
    --amber:        #f59e0b;
    --sky:          #0ea5e9;

    /* Ombres douces */
    --sh-sm:  0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
    --sh:     0 1px 3px rgba(15, 23, 42, .05), 0 8px 24px -8px rgba(15, 23, 42, .10);
    --sh-lg:  0 4px 12px rgba(15, 23, 42, .06), 0 24px 48px -12px rgba(15, 23, 42, .18);

    --radius:    10px;
    --radius-sm: 7px;
    --radius-xs: 4px;
    --sidebar-w: 256px;
    --main-offset: 256px;
}

* { -webkit-tap-highlight-color: transparent; box-sizing: border-box; }

/* =================================================================
   FOND AURORA ANIMÉ + Base
   ================================================================= */
html, body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink-2);
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
body {
    background: linear-gradient(135deg, #e0e7ff 0%, #f5f3ff 40%, #fdf2f8 100%);
    background-attachment: fixed;
    position: relative;
}

/* Orbes lumineuses flottantes */
body::before {
    content: '';
    position: fixed;
    top: -15%; left: -10%;
    width: 140%; height: 140%;
    z-index: -1;
    background:
        radial-gradient(circle at 15% 25%, rgba(99, 102, 241, .40), transparent 50%),
        radial-gradient(circle at 80% 15%, rgba(217, 70, 239, .32), transparent 45%),
        radial-gradient(circle at 72% 80%, rgba(56, 189, 248, .30), transparent 50%),
        radial-gradient(circle at 22% 85%, rgba(244, 114, 182, .25), transparent 45%);
    animation: auroraFloat 25s ease-in-out infinite alternate;
    pointer-events: none;
}
@keyframes auroraFloat {
    0%   { transform: translate(0, 0)    scale(1);    }
    50%  { transform: translate(-2%, 3%) scale(1.07); }
    100% { transform: translate(2%, -2%) scale(1.03); }
}

h1, h2, h3, h4, h5, h6 { color: var(--ink); font-weight: 700; letter-spacing: -0.01em; }

::selection { background: rgba(99, 102, 241, .22); color: var(--ink); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(99, 102, 241, .30); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99, 102, 241, .50); }

/* =================================================================
   GLASS — les classes .card, .stat-card, .modal, .app-topbar
   appliquent directement le verre via les props ci-dessus.
   ================================================================= */

/* =================================================================
   LAYOUT
   ================================================================= */
.app-shell { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(175deg, #0f172a 0%, #1a1f35 60%, #151b2e 100%);
    color: var(--side-ink);
    position: fixed;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    z-index: 1040;
    border-right: 1px solid rgba(255, 255, 255, .06);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    overflow: hidden;
}

/* --- Brand --- */
.sidebar-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 18px 16px 16px;
    font-weight: 800; font-size: 1.05rem; color: #fff;
    letter-spacing: -.02em; flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    position: relative; z-index: 2;
}
.sidebar-brand .logo-img {
    width: 40px; height: 40px; border-radius: 10px;
    object-fit: contain; flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(99, 102, 241, .35);
}
.sidebar-brand .brand-text {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* --- Navigation scrollable --- */
.sidebar-nav {
    padding: 6px 10px 10px; flex: 1; overflow-y: auto;
    position: relative; z-index: 2;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .08) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .10); border-radius: 99px; }

/* --- Nav links --- */
.sidebar-nav .nav-link {
    display: flex; align-items: center; gap: 11px;
    padding: 8px 10px; color: #94a3b8;
    border-radius: 8px; font-weight: 500; font-size: .875rem;
    margin-bottom: 1px;
    text-decoration: none;
    transition: background .18s ease, color .18s ease, transform .12s ease;
    position: relative;
}
.sidebar-nav .nav-link .nav-icon {
    width: 30px; height: 30px; border-radius: 7px;
    display: grid; place-items: center; flex-shrink: 0;
    font-size: .95rem; background: rgba(255, 255, 255, .06);
    transition: background .18s ease, color .18s ease;
}
.sidebar-nav .nav-link:hover {
    background: rgba(255, 255, 255, .06); color: #e2e8f0;
    transform: translateX(2px);
}
.sidebar-nav .nav-link:hover .nav-icon {
    background: rgba(255, 255, 255, .10);
}
.sidebar-nav .nav-link.active {
    background: rgba(99, 102, 241, .16); color: #c7d2fe;
    box-shadow: inset 3px 0 0 #6366f1;
}
.sidebar-nav .nav-link.active .nav-icon {
    background: rgba(99, 102, 241, .25); color: #a5b4fc;
}

/* --- Sections pliables (groupes de navigation) --- */
.nav-section { margin-bottom: 2px; }
.nav-section-head {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    width: 100%; padding: 8px 10px 7px; margin-top: 4px;
    background: none; border: 0; border-radius: 8px;
    color: var(--side-ink-2);
    font-size: .70rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    font-family: inherit; text-align: left; cursor: pointer; user-select: none;
    transition: background .18s ease, color .18s ease;
}
.nav-section-head:hover { color: #e2e8f0; background: rgba(255, 255, 255, .05); }
.nav-section-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.nav-section-title i { font-size: .80rem; }
.nav-section-chevron { font-size: .70rem; transition: transform .20s ease; }
.nav-section.open .nav-section-chevron { transform: rotate(180deg); }
.nav-section-body { display: none; padding-bottom: 4px; }
.nav-section.open .nav-section-body { display: block; }

/* Couleurs d'icônes par catégorie */
.nav-icon.clr-indigo { background: rgba(99, 102, 241, .18) !important; color: #a5b4fc !important; }
.nav-icon.clr-emerald { background: rgba(16, 185, 129, .16) !important; color: #6ee7b7 !important; }
.nav-icon.clr-sky { background: rgba(14, 165, 233, .16) !important; color: #7dd3fc !important; }
.nav-icon.clr-rose { background: rgba(244, 63, 94, .16) !important; color: #fda4af !important; }
.nav-icon.clr-amber { background: rgba(245, 158, 11, .16) !important; color: #fcd34d !important; }
.nav-icon.clr-violet { background: rgba(139, 92, 246, .16) !important; color: #c4b5fd !important; }
.nav-icon.clr-slate { background: rgba(100, 116, 139, .16) !important; color: #94a3b8 !important; }

/* --- Sidebar footer --- */
.sidebar-footer {
    padding: 10px 10px 12px; border-top: 1px solid rgba(255, 255, 255, .06);
    flex-shrink: 0; position: relative; z-index: 2;
}
.side-user {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: 9px;
    background: rgba(255, 255, 255, .03);
    text-decoration: none; color: var(--side-ink);
    transition: background .18s ease, transform .12s ease;
    margin-bottom: 2px;
}
.side-user:hover { background: rgba(255, 255, 255, .07); transform: translateX(2px); }
.side-user .avatar {
    width: 34px; height: 34px; border-radius: 9px;
    display: grid; place-items: center; color: #fff; font-weight: 700;
    flex-shrink: 0; font-size: .82rem;
}
.avatar-initial {
    background: linear-gradient(135deg, #818cf8, var(--brand-2));
    box-shadow: 0 4px 10px rgba(99, 102, 241, .35);
}
.avatar-accent {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    box-shadow: 0 4px 10px rgba(99, 102, 241, .35);
}
.avatar-logout {
    background: rgba(148, 163, 184, .15); color: var(--side-ink-2) !important;
}
.side-user .meta { line-height: 1.2; min-width: 0; }
.side-user .meta .nm { color: #fff; font-weight: 600; font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.side-user .meta .rl { color: var(--side-ink-2); font-size: .70rem; display: block; }
.side-user.active { background: var(--side-active); }

/* ---------- Backdrop (JS) ---------- */
.sidebar-backdrop {
    display: none; position: fixed; inset: 0;
    background: rgba(2, 6, 23, .50); z-index: 1035;
    backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
    opacity: 0; transition: opacity .25s ease;
}
.sidebar-backdrop.visible { display: block; opacity: 1; }

/* ---------- Topbar en verre ---------- */
.app-main {
    flex: 1; min-width: 0;
    margin-left: var(--main-offset);
    display: flex; flex-direction: column;
}
.app-topbar {
    position: sticky; top: 0; z-index: 1020;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(18px) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(18px) saturate(var(--glass-sat));
    border-bottom: 1px solid var(--glass-border);
    padding: 14px 28px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.app-topbar h1 { margin: 0; font-size: 1.35rem; font-weight: 700; }
.app-topbar .crumb { color: var(--ink-3); font-size: .82rem; }

/* Network status badge */
#connectionBadge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .82rem;
    line-height: 1;
    white-space: nowrap;
    transition: background-color .3s, color .3s;
}
.app-content { padding: 28px; flex: 1; }

/* Burger mobile */
.burger {
    display: none;
    background: var(--glass-strong);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    width: 40px; height: 40px; border-radius: 12px;
    align-items: center; justify-content: center; cursor: pointer;
    color: var(--ink); font-size: 1.2rem;
    box-shadow: var(--sh-sm);
}

/* =================================================================
   CARTES EN VERRE GIVRÉ
   ================================================================= */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--sh);
    color: var(--ink-2);
}
.card-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.50);
    padding: 16px 20px;
    border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0 !important;
}
.card-header.bg-white { background: rgba(255, 255, 255, 0.30) !important; }
.card-body { padding: 20px; }

/* ---------- Cartes stat avec halo ---------- */
.stat-card {
    border-radius: var(--radius);
    padding: 22px;
    overflow: hidden;
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    border: 1px solid var(--glass-border);
    box-shadow: var(--sh);
    color: var(--ink-2);
    height: 100%;
    transition: transform .2s ease, box-shadow .2s ease;
}
/* Halo coloré derrière la carte */
.stat-card::after {
    content: '';
    position: absolute;
    top: -30px; right: -30px;
    width: 120px; height: 120px;
    border-radius: 50%;
    filter: blur(36px);
    opacity: .50;
    background: var(--accent, #6366f1);
    pointer-events: none;
    transition: opacity .3s;
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--sh-lg);
}
.stat-card:hover::after { opacity: .70; }

.is-primary { --accent: #6366f1; }
.is-success { --accent: #10b981; }
.is-info    { --accent: #0ea5e9; }
.is-warning { --accent: #f59e0b; }
.is-danger  { --accent: #ef4444; }

.stat-card .stat-label {
    font-size: .78rem; text-transform: uppercase; letter-spacing: .05em;
    color: var(--ink-3); font-weight: 600;
}
.stat-card .stat-value {
    font-size: 1.9rem; font-weight: 800; color: var(--ink);
    letter-spacing: -.02em; line-height: 1.1; margin-top: 6px;
}
.stat-icon {
    width: 46px; height: 46px; border-radius: 13px;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.3rem;
}
.is-primary .stat-icon { background: linear-gradient(135deg, #818cf8, var(--brand-2)); box-shadow: 0 8px 20px rgba(99,102,241,.35); }
.is-success .stat-icon { background: linear-gradient(135deg, #34d399, #059669); box-shadow: 0 8px 20px rgba(16,185,129,.30); }
.is-info    .stat-icon { background: linear-gradient(135deg, #38bdf8, #0284c7); box-shadow: 0 8px 20px rgba(14,165,233,.30); }
.is-warning .stat-icon { background: linear-gradient(135deg, #fbbf24, #d97706); box-shadow: 0 8px 20px rgba(245,158,11,.30); }
.is-danger  .stat-icon { background: linear-gradient(135deg, #fb7185, #e11d48); box-shadow: 0 8px 20px rgba(244,63,94,.30); }

/* =================================================================
   FORMULAIRES en verre
   ================================================================= */
.form-label { font-size: .82rem; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.form-text { color: var(--ink-3); font-size: .78rem; }
.form-control, .form-select, textarea.form-control {
    background: var(--glass-strong);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: .9rem;
    color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
}
.form-control::placeholder { color: var(--ink-4); }
.form-control:focus, .form-select:focus {
    background: var(--glass-strong);
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .12);
    color: var(--ink);
}
.input-group-text {
    background: rgba(255, 255, 255, 0.50);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-right: none;
    color: var(--ink-3);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    padding: 10px 14px;
}
.input-group:not(.has-validation) > .form-control:not(:last-child),
.input-group > .form-control { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group-lg .form-control { font-size: 1.05rem; padding: 14px 16px; }
.input-group-lg .input-group-text { font-size: 1.05rem; }

/* =================================================================
   BOUTONS
   ================================================================= */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 600; font-size: .88rem;
    padding: 9px 16px;
    transition: all .15s ease;
    display: inline-flex; align-items: center; gap: 7px;
    border: 1px solid transparent;
}
.btn i { font-size: 1rem; line-height: 1; }
.btn-sm { padding: 6px 11px; font-size: .8rem; border-radius: var(--radius-xs); }
.btn-lg { padding: 13px 22px; font-size: 1rem; }
.btn-primary {
    background: var(--brand); border-color: var(--brand); color: #fff;
    box-shadow: 0 1px 2px rgba(99,102,241,.25), 0 6px 16px -4px rgba(99,102,241,.4);
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--brand-2); border-color: var(--brand-2);
    box-shadow: 0 2px 4px rgba(99,102,241,.3), 0 10px 22px -4px rgba(99,102,241,.5);
    transform: translateY(-1px);
}
.btn-success {
    background: var(--green); border-color: var(--green); color: #fff;
    box-shadow: 0 1px 2px rgba(16,185,129,.25), 0 6px 16px -4px rgba(16,185,129,.4);
}
.btn-success:hover { background: #059669; border-color: #059669; transform: translateY(-1px); box-shadow: 0 2px 4px rgba(16,185,129,.3), 0 10px 22px -4px rgba(16,185,129,.5); }
.btn-danger {
    background: var(--red); border-color: var(--red); color: #fff;
    box-shadow: 0 1px 2px rgba(239,68,68,.25), 0 6px 16px -4px rgba(239,68,68,.4);
}
.btn-danger:hover { background: #dc2626; border-color: #dc2626; transform: translateY(-1px); box-shadow: 0 2px 4px rgba(239,68,68,.3), 0 10px 22px -4px rgba(239,68,68,.5); }
.btn-outline-primary { color: var(--brand); border-color: var(--glass-border); background: var(--glass-strong); }
.btn-outline-primary:hover { background: rgba(99,102,241,.12); border-color: var(--brand); color: var(--brand-2); }
.btn-outline-secondary { color: var(--ink-2); border-color: var(--glass-border); background: var(--glass-strong); }
.btn-outline-secondary:hover { background: rgba(255,255,255,.85); border-color: var(--glass-border); color: var(--ink); }
.btn-outline-danger { color: var(--red); border-color: #fecdd3; background: var(--glass-strong); }
.btn-outline-danger:hover { background: var(--red); border-color: var(--red); color: #fff; }
.btn-light { background: var(--glass-strong); border-color: var(--glass-border); color: var(--ink-2); }
.btn-light:hover { background: rgba(255,255,255,.9); border-color: var(--glass-border); color: var(--ink); transform: translateY(-1px); box-shadow: 0 2px 4px rgba(0,0,0,.08); }
.btn-light:focus { box-shadow: 0 0 0 .2rem rgba(99,102,241,.15); }
.btn:active { transform: translateY(0); }

/* =================================================================
   TABLES — fines, translucides
   ================================================================= */
.table { color: var(--ink-2); --bs-table-bg: transparent; margin-bottom: 0; font-size: .88rem; }
.card .table thead th,
.table-light th {
    background: rgba(255, 255, 255, 0.35) !important;
    color: var(--ink-3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.40) !important;
    font-weight: 600; text-transform: uppercase; font-size: .7rem;
    letter-spacing: .06em; padding: 12px 16px;
}
.table > :not(caption) > * > * { padding: 13px 16px; vertical-align: middle; border-color: rgba(255,255,255,.35); }
.table > :not(caption) > * + * > * { border-top: 1px solid rgba(255,255,255,.30); }
.table tbody tr { transition: background .12s; }
.table-hover > tbody > tr:hover > * { background: rgba(99, 102, 241, .06); }
tr.clickable { cursor: pointer; }
.code-tag {
    font-family: 'SF Mono', 'Cascadia Code', Consolas, monospace;
    font-size: .8rem; background: rgba(255,255,255,.50); color: var(--ink-2);
    padding: 2px 8px; border-radius: 6px;
}

/* =================================================================
   BADGES & ALERTES
   ================================================================= */
.badge { border-radius: 99px; font-weight: 600; font-size: .72rem; padding: 4px 11px; }
.badge-statut-Payee, .text-bg-success { background: rgba(16,185,129,.18); color: #047857; }
.badge-statut-Annulee, .text-bg-danger { background: rgba(239,68,68,.18); color: #b91c1c; }
.text-bg-primary { background: rgba(99,102,241,.18); color: #4338ca; }
.text-bg-warning { background: rgba(245,158,11,.20); color: #92400e; }
.text-bg-secondary { background: rgba(255,255,255,.50); color: var(--ink-2); }
.text-bg-info { background: rgba(14,165,233,.18); color: #0369a1; }
.text-bg-light { background: rgba(255,255,255,.50); color: var(--ink-2); }

.alert { border-radius: var(--radius-sm); border: 1px solid var(--glass-border); padding: 12px 16px; font-size: .88rem; font-weight: 500; }
.alert-success { background: rgba(16,185,129,.12); color: #065f46; border-color: rgba(16,185,129,.30); }
.alert-danger  { background: rgba(239,68,68,.12);  color: #991b1b; border-color: rgba(239,68,68,.30); }
.alert-warning { background: rgba(245,158,11,.14); color: #92400e; border-color: rgba(245,158,11,.35); }
.alert-info    { background: rgba(14,165,233,.12); color: #075985; border-color: rgba(14,165,233,.30); }
.alert-stock-low { border-left: 3px solid var(--red); }

.list-group-item { background: var(--glass-bg); border-color: var(--glass-border); color: var(--ink-2); padding: 14px 16px; }
.list-group-item-action:hover { background: rgba(99,102,241,.08); }

/* =================================================================
   MODAL en verre
   ================================================================= */
.modal-content {
    background: var(--glass-strong);
    backdrop-filter: blur(24px) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(24px) saturate(var(--glass-sat));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--sh-lg);
    color: var(--ink-2);
}
.modal-header, .modal-footer { border-color: var(--glass-border); padding: 18px 22px; }
.modal-title { color: var(--ink); font-weight: 700; }

/* =================================================================
   CAISSE / POS
   ================================================================= */
.scan-zone { position: sticky; top: 16px; z-index: 10; }
#scanInput {
    font-size: 1.1rem; font-weight: 600; letter-spacing: .5px;
    border: 2px solid var(--glass-border);
    background: var(--glass-strong);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
#scanInput:focus { border-color: var(--brand); }
#scanInput.is-invalid { animation: shake .4s; border-color: var(--red) !important; }
@keyframes shake {
    0%,100% { transform: translateX(0); }
    25%     { transform: translateX(-6px); }
    75%     { transform: translateX(6px); }
}
.panier-table th, .panier-table td { vertical-align: middle; }
.qty-badge { min-width: 2.2rem; display: inline-block; }
.pay-head {
    background: linear-gradient(135deg, #1e1b4b, var(--brand-2)) !important;
    color: #fff !important; border-bottom: none !important;
}
kbd {
    background: var(--brand-soft); color: var(--brand-2);
    border-radius: 6px; border: 1px solid #e0e7ff; font-size: .72rem; padding: 2px 7px; font-family: inherit;
}

/* =================================================================
   TICKET (impression opaque)
   ================================================================= */
.ticket {
    max-width: 80mm; margin: 0 auto;
    font-family: 'Courier New', monospace; font-size: 12px;
    color: #000; background: #fff; padding: 12px;
    border: 1px solid #e2e8f0; border-radius: var(--radius-sm);
}
.ticket.ticket-80mm { max-width: 80mm; }
.ticket.ticket-58mm { max-width: 58mm; font-size: 11px; }
.ticket h2 { font-size: 18px; margin: 0; color: #000; }
.ticket.ticket-58mm h2 { font-size: 16px; }
.ticket table { width: 100%; color: #000; }
.ticket .hr-dashed { border-top: 1px dashed #000; margin: 6px 0; }

/* (bloc @media print fusionné — voir fin de fichier) */

/* =================================================================
   RESPONSIVE
   ================================================================= */
@media (max-width: 991.98px) {
    :root { --main-offset: 0px; }
    .sidebar { transform: translateX(-100%); box-shadow: var(--sh-lg); }
    .sidebar.open { transform: translateX(0); }
    .burger { display: inline-flex; }
    .app-content { padding: 18px; }
    .app-topbar { padding: 12px 18px; }
}
@media (max-width: 575.98px) {
    .stat-card .stat-value { font-size: 1.5rem; }
    #scanInput { font-size: 1rem; }
    .d-flex .btn,
    .btn-group .btn { width: 100%; justify-content: center; }
    .btn-sm { width: auto; }
}

/* =================================================================
   UTILITAIRES — classes extraites des templates
   ================================================================= */
.avatar-profile {
    width: 4rem; height: 4rem; font-size: 1.8rem;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--brand); color: #fff; border-radius: 50%;
}
.col-date { width: 160px; }
.col-action { width: 140px; }
.col-ip { width: 120px; }
.col-permission { min-width: 300px; }
.col-role { width: 120px; }

/* =================================================================
   PÉREMPTIONS — Liquid Glass renforcé
   ================================================================= */

/* --- Badge-compacte en verre (compteurs) --- */
.glass-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 99px;
    font-weight: 600;
    font-size: .85rem;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    border: 1px solid var(--glass-border);
    box-shadow: var(--sh-sm);
    transition: transform .15s ease, box-shadow .15s ease;
    white-space: nowrap;
}
.glass-badge:hover {
    transform: translateY(-2px);
    box-shadow: var(--sh);
}
.glass-badge i { font-size: 1rem; opacity: .85; }

.glass-badge.is-danger {
    color: #991b1b;
    border-color: rgba(239, 68, 68, .28);
    background: rgba(239, 68, 68, .10);
}
.glass-badge.is-warning {
    color: #92400e;
    border-color: rgba(245, 158, 11, .30);
    background: rgba(245, 158, 11, .10);
}
.glass-badge.is-success {
    color: #065f46;
    border-color: rgba(16, 185, 129, .28);
    background: rgba(16, 185, 129, .10);
}

/* --- Carte tableau en verre (header coloré translucide) --- */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--sh);
    overflow: hidden;
    transition: box-shadow .2s ease;
}
.glass-card:hover {
    box-shadow: var(--sh-lg);
}

.glass-card .glass-header {
    padding: 16px 20px;
    font-weight: 700;
    font-size: .95rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, .40);
    position: relative;
    overflow: hidden;
}
.glass-card .glass-header::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: .12;
    pointer-events: none;
}
.glass-card .glass-header i { font-size: 1.1rem; }

.glass-card.is-danger .glass-header {
    color: #991b1b;
    background: rgba(239, 68, 68, .08);
}
.glass-card.is-danger .glass-header::before {
    background: linear-gradient(135deg, #ef4444, #f87171);
}
.glass-card.is-warning .glass-header {
    color: #92400e;
    background: rgba(245, 158, 11, .08);
}
.glass-card.is-warning .glass-header::before {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

/* --- Tableaux en verre --- */
.glass-card .table {
    --bs-table-bg: transparent;
}
.glass-card .table thead th {
    background: rgba(255, 255, 255, .30) !important;
    color: var(--ink-3);
    font-weight: 600;
    text-transform: uppercase;
    font-size: .70rem;
    letter-spacing: .06em;
    border-bottom: 1px solid rgba(255, 255, 255, .35) !important;
}
.glass-card .table > :not(caption) > * > * {
    padding: 13px 16px;
}
.glass-card .table tbody tr {
    transition: background .12s ease;
}
.glass-card .table-hover > tbody > tr:hover > * {
    background: rgba(99, 102, 241, .06);
}

/* --- Lignes de séparation subtiles --- */
.glass-card .table > :not(caption) > * + * > * {
    border-top: 1px solid rgba(255, 255, 255, .30);
}

/* --- Badge quantité en verre --- */
.glass-badge-qty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 4px 10px;
    border-radius: 8px;
    font-weight: 700;
    font-size: .82rem;
    background: var(--glass-bg);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid var(--glass-border);
}
.glass-badge-qty.is-danger {
    background: rgba(239, 68, 68, .14);
    color: #991b1b;
    border-color: rgba(239, 68, 68, .25);
}
.glass-badge-qty.is-warning {
    background: rgba(245, 158, 11, .16);
    color: #92400e;
    border-color: rgba(245, 158, 11, .28);
}
.glass-badge-qty.is-info {
    background: rgba(14, 165, 233, .14);
    color: #075985;
    border-color: rgba(14, 165, 233, .25);
}
.glass-badge-qty.is-success {
    background: rgba(16, 185, 129, .14);
    color: #065f46;
    border-color: rgba(16, 185, 129, .25);
}
.glass-badge-qty.is-secondary {
    background: rgba(148, 163, 184, .14);
    color: #64748b;
    border-color: rgba(148, 163, 184, .25);
}

/* ============================================================
   Multi-Paiements — Caisse
   ============================================================ */
.btn-mode-paiement {
    flex: 1;
    padding: 6px 8px;
    font-size: .78rem;
    font-weight: 600;
    border: 1.5px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    color: #475569;
    border-radius: var(--radius-sm);
    transition: all .2s;
}
.btn-mode-paiement:hover {
    background: rgba(99, 102, 241, .08);
    border-color: var(--brand);
    color: var(--brand);
}
.btn-mode-paiement.active {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
    box-shadow: 0 2px 8px rgba(99, 102, 241, .25);
}

/* ============================================================
   Impression Thermique — Ticket 80mm
   ============================================================ */
.ticket-thermal {
    max-width: 80mm;
    margin: 0 auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    color: #000;
    background: #fff;
    padding: 8mm 4mm;
    line-height: 1.4;
}
.ticket-thermal h1 {
    font-size: 16px;
    text-align: center;
    margin: 0 0 2mm;
    font-weight: 700;
}
.ticket-thermal .shop-info {
    text-align: center;
    font-size: 11px;
    margin-bottom: 3mm;
}
.ticket-thermal .hr-dashed {
    border-top: 1px dashed #000;
    margin: 3mm 0;
}
.ticket-thermal table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}
.ticket-thermal td, .ticket-thermal th {
    padding: 1mm 0;
}
.ticket-thermal .text-right { text-align: right; }
.ticket-thermal .text-center { text-align: center; }
.ticket-thermal .fw-bold { font-weight: 700; }
.ticket-thermal .total-line {
    font-size: 13px;
    font-weight: 700;
}
.ticket-thermal .payment-line {
    font-size: 11px;
}
.ticket-thermal .footer-msg {
    text-align: center;
    font-size: 10px;
    margin-top: 3mm;
}

/* Animations d'interface adaptées au thème clair */
#particleCanvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}
body > main, body > .container, body > .container-fluid {
    position: relative;
    z-index: 1;
}
.animate-on-scroll {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .45s ease, transform .45s ease;
}
.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}
@keyframes rippleEffect { to { transform: scale(4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
    .animate-on-scroll { opacity: 1; transform: none; }
    #particleCanvas { display: none; }
}

@media print {
    body { background: #fff !important; }
    body::before { display: none !important; }
    .sidebar, .sidebar-backdrop, .app-topbar, .no-print, .burger { display: none !important; }
    .app-main { margin: 0 !important; }
    .app-content { padding: 0 !important; }
    .app-shell { display: block !important; }
    .card, .stat-card {
        background: #fff !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        box-shadow: none !important;
        border: none !important;
    }
    body * { visibility: hidden; }
    .ticket, .ticket * { visibility: visible; }
    .invoice-a5, .invoice-a5 * { visibility: visible; }
    .inv-action-bar { visibility: hidden; }
    .ticket { position: absolute; left: 0; top: 0; width: 100%; border: none; }
    .ticket-thermal {
        max-width: 80mm;
        padding: 0;
        border: none;
        box-shadow: none;
    }
    .ticket-thermal * { visibility: visible; }
}

/* Refonte du cadre de travail : en-tête horizontal, navigation par menus */
:root {
    --brand: #155bd0;
    --brand-2: #1049ad;
    --brand-soft: #edf4ff;
    --ink: #172033;
    --ink-2: #344054;
    --ink-3: #667085;
    --surface-canvas: #f3f5f8;
    --surface-card: #ffffff;
    --line: #dce1e8;
    --radius: 20px;
    --radius-sm: 12px;
    --radius-xs: 9px;
}
html, body { font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
body { background: #e9eef5; color: var(--ink-2); }
body::before { animation-duration: 16s; opacity: .78; }
.app-shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); grid-template-rows: 76px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; background: rgba(239,243,249,.72); position: relative; }
.app-header {
    grid-column: 1 / -1;
    grid-row: 1;
    position: sticky;
    top: 0;
    z-index: 1040;
    background: radial-gradient(ellipse at 0% 0%, rgba(39,107,206,.44), transparent 50%), linear-gradient(155deg, #18365f, #0d1f3b);
    border-bottom: 1px solid rgba(255,255,255,.12);
    box-shadow: 0 10px 32px rgba(13,31,59,.20), inset 0 1px rgba(255,255,255,.06);
    backdrop-filter: blur(26px) saturate(175%);
    -webkit-backdrop-filter: blur(26px) saturate(175%);
}
.app-header-main {
    min-height: 76px;
    max-width: 1760px;
    margin: 0 auto;
    padding: 12px clamp(20px, 3.2vw, 54px);
    display: flex;
    align-items: center;
    gap: 22px;
}
.app-brand { display: inline-flex; align-items: center; gap: 12px; flex-shrink: 0; color: #fff; text-decoration: none; }
.app-brand-mark {
    width: 44px; height: 44px; display: grid; place-items: center; overflow: hidden;
    border: 1px solid rgba(255,255,255,.16); border-radius: 14px; background: rgba(255,255,255,.08);
    box-shadow: 0 4px 12px rgba(5,18,39,.18);
    transition: transform .25s ease, box-shadow .25s ease;
}
.app-brand:hover .app-brand-mark { transform: rotate(-5deg) scale(1.06); box-shadow: 0 8px 18px rgba(21,91,208,.2); }
.app-brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.app-brand-copy { display: grid; gap: 1px; line-height: 1.2; }
.app-brand-copy strong { color: #fff; font-size: 1rem; font-weight: 750; }
.app-brand-copy small { color: #b6c9e3; font-size: .68rem; font-weight: 500; }
.app-header-tools { margin-left: auto; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.logo-upload-panel { display: flex; align-items: center; gap: 16px; padding: 16px; border: 1px solid rgba(21,91,208,.12); border-radius: 16px; background: linear-gradient(120deg, rgba(237,244,255,.75), rgba(255,255,255,.58)); }
.logo-upload-preview { width: 88px; height: 88px; display: grid; place-items: center; flex: 0 0 88px; overflow: hidden; border: 1px solid rgba(21,91,208,.12); border-radius: 14px; background: #fff; box-shadow: 0 5px 16px rgba(23,54,95,.08); }
.logo-upload-preview img { width: 100%; height: 100%; object-fit: contain; }
.logo-upload-controls { min-width: 0; flex: 1; }
.logo-upload-controls .form-control { max-width: 440px; }
@media (max-width: 575.98px) { .logo-upload-panel { align-items: flex-start; flex-direction: column; } .logo-upload-preview { width: 72px; height: 72px; flex-basis: 72px; } }
.connection-status { margin-right: 4px; }
.store-switcher { max-width: 220px; }
.quick-pos { min-height: 40px; padding-inline: 16px; border-radius: 12px; box-shadow: 0 5px 13px rgba(16,185,129,.22); }
.tool-icon { width: 40px; height: 40px; justify-content: center; padding: 0; border-radius: 12px; }
.account-link {
    position: relative; display: inline-flex; align-items: center; gap: 11px; margin-left: 3px; padding: 5px 10px 5px 5px;
    min-height: 50px; border: 1px solid rgba(255,255,255,.15); border-radius: 16px;
    background: linear-gradient(145deg, rgba(255,255,255,.12), rgba(255,255,255,.06));
    box-shadow: inset 0 1px rgba(255,255,255,.10), 0 5px 16px rgba(5,18,39,.10);
    color: #f7faff; text-decoration: none; backdrop-filter: blur(18px) saturate(165%); -webkit-backdrop-filter: blur(18px) saturate(165%);
    transition: background .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.account-link:hover { border-color: rgba(255,255,255,.28); background: linear-gradient(145deg, rgba(255,255,255,.19), rgba(255,255,255,.10)); box-shadow: inset 0 1px rgba(255,255,255,.16), 0 9px 22px rgba(5,18,39,.18); transform: translateY(-1px); }
.account-link:focus-visible { outline: 2px solid rgba(147,197,253,.85); outline-offset: 2px; }
.account-link .avatar { width: 39px; height: 39px; display: grid; place-items: center; flex: 0 0 39px; border: 1px solid rgba(255,255,255,.96); border-radius: 13px; background: linear-gradient(145deg, #e5f0ff, #b9d4fb); box-shadow: inset 0 1px rgba(255,255,255,.95), 0 3px 10px rgba(42,94,163,.16); color: #174a86; font-size: .74rem; font-weight: 750; letter-spacing: .035em; }
.account-meta { display: grid; gap: 4px; min-width: 0; max-width: 150px; line-height: 1.1; }
.account-meta strong { overflow: hidden; color: #f7faff; font-size: .75rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.account-meta small { display: flex; align-items: center; gap: 5px; width: fit-content; padding: 3px 7px; border: 1px solid rgba(147,197,253,.20); border-radius: 999px; background: rgba(59,130,246,.16); color: #d7e7fa; font-size: .62rem; font-weight: 600; }
.account-meta small i { color: #93c5fd; font-size: .66rem; }
.account-caret { color: #afc0d6; font-size: .65rem; transition: color .2s ease, transform .2s ease; }
.account-link:hover .account-caret { color: var(--brand); transform: translateX(2px); }
.logout-form { margin: 0; }
.logout-button, .burger {
    width: 40px; height: 40px; display: inline-grid; place-items: center;
    border: 1px solid rgba(255,255,255,.16); border-radius: 12px; background: rgba(255,255,255,.08); color: #dbe7f5; font-size: 1.08rem;
    transition: color .18s ease, border-color .18s ease, background-color .18s ease, transform .18s ease;
}
.logout-button:hover { color: #c43245; border-color: #f1c5cc; background: #fff5f6; transform: translateY(-1px); }
.app-header .btn-outline-secondary { color: #e2ebf6; border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.08); }
.app-header .btn-outline-secondary:hover { color: #fff; border-color: rgba(255,255,255,.34); background: rgba(255,255,255,.16); }
.app-header .btn-outline-warning, .app-header .btn-outline-danger { background: rgba(255,255,255,.08); }
.app-header .logout-button:hover { color: #fecdd3; border-color: rgba(251,113,133,.52); background: rgba(190,24,93,.20); }
.app-header .burger:hover { color: #fff; border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.16); }
.burger { display: none; cursor: pointer; }
.primary-nav {
    grid-column: 1;
    grid-row: 2;
    position: sticky;
    top: 76px;
    align-self: start;
    width: 264px;
    height: calc(100vh - 76px);
    height: calc(100dvh - 76px);
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 1px solid #dce1e8;
    background: radial-gradient(ellipse at 0% 0%, rgba(39,107,206,.44), transparent 50%), linear-gradient(155deg, #18365f, #0d1f3b);
    border-right-color: rgba(255,255,255,.20);
    box-shadow: inset -1px 0 rgba(255,255,255,.06), 8px 0 30px rgba(20,38,67,.08);
    backdrop-filter: blur(24px) saturate(155%);
    -webkit-backdrop-filter: blur(24px) saturate(155%);
}
.primary-nav::after {
    content: ''; position: fixed; inset: 76px auto 0 0; width: 264px; pointer-events: none; opacity: .8;
    background: radial-gradient(240px circle at var(--mouse-x, -300px) var(--mouse-y, -300px), rgba(21,91,208,.065), transparent 72%);
}
.primary-nav-inner {
    position: relative; z-index: 1; min-height: 100%; margin: 0;
    padding: 18px 14px 28px; display: flex; align-items: stretch; flex-direction: column; gap: 5px;
}
.nav-home, .nav-section-head {
    min-height: 42px; display: flex; align-items: center; gap: 9px; padding: 0 12px;
    border: 1px solid transparent; border-radius: 11px; background: transparent; color: #aab6c8;
    font: 600 .81rem/1 Poppins, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-decoration: none; white-space: nowrap; cursor: pointer;
    transition: color .18s ease, background-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.nav-caption { padding: 0 12px 10px; color: #718096; font-size: .64rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.nav-home i, .nav-section-title > i { color: #91b8ef; font-size: 1rem; transition: color .18s ease, transform .25s ease; }
.nav-home:hover, .nav-section-head:hover { color: #f7faff; background: rgba(255,255,255,.07); }
.nav-home:hover i, .nav-section-head:hover .nav-section-title > i { color: var(--brand); transform: translateY(-1px); }
.nav-home.active { color: #fff; background: linear-gradient(105deg, #2368df, #3478eb); box-shadow: 0 7px 18px rgba(21,91,208,.25); }
.nav-section.has-active > .nav-section-head { color: #f7faff; background: rgba(255,255,255,.07); }
.nav-home.active i, .nav-section.has-active > .nav-section-head .nav-section-title > i { color: #84b5ff; }
.nav-section { position: relative; margin: 0; }
.nav-section-head { width: 100%; justify-content: space-between; }
.nav-section-title { display: inline-flex; align-items: center; gap: 9px; }
.nav-section-title > span { color: inherit; }
.nav-section-chevron { margin-left: 1px; color: #708097; font-size: .67rem; transition: transform .24s ease, color .18s ease; }
.nav-section.open > .nav-section-head { color: #fff; background: rgba(255,255,255,.07); }
.nav-section.open .nav-section-chevron { transform: rotate(180deg); color: var(--brand); }
.nav-section-body {
    position: static; z-index: auto;
    display: none; grid-template-columns: minmax(0, 1fr); gap: 3px;
    width: auto; min-width: 0; max-width: none; margin: 3px 0 8px 10px; padding: 6px;
    border: 0; border-left: 1px solid rgba(255,255,255,.12); border-radius: 0 0 0 12px; background: transparent;
    opacity: 1; transform: none; transform-origin: top left;
    pointer-events: auto; visibility: visible;
    transition: opacity .2s ease, transform .2s ease;
}
.nav-section.open > .nav-section-body { display: grid; animation: sidebarMenuIn .2s ease both; }
@keyframes sidebarMenuIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
.nav-menu-caption { grid-column: 1 / -1; padding: 5px 9px 9px; color: #718096; font-size: .67rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.primary-nav .nav-link {
    display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 43px; padding: 6px 9px;
    border-radius: 10px; color: #aab6c8; font-size: .77rem; font-weight: 500; text-decoration: none;
    transition: color .16s ease, background-color .16s ease, transform .16s ease;
}
.primary-nav .nav-link:hover { color: #fff; background: rgba(255,255,255,.07); transform: translateX(3px); }
.primary-nav .nav-link.active { color: #fff; background: linear-gradient(100deg, rgba(37,107,222,.38), rgba(37,107,222,.17)); box-shadow: inset 3px 0 #70adff, inset 0 0 0 1px rgba(112,173,255,.10), 0 5px 16px rgba(10,34,72,.16); font-weight: 650; }
.primary-nav .nav-icon { width: 29px; height: 29px; display: grid; place-items: center; flex: 0 0 29px; border-radius: 9px; background: rgba(88,145,224,.13); color: #a8c9f8; font-size: .83rem; transition: color .18s ease, background-color .18s ease, transform .18s ease; }
.primary-nav .nav-link:hover .nav-icon { transform: scale(1.06); color: #c8dcff; }
.primary-nav .nav-link.active .nav-icon { color: #8abaff; background: rgba(45,112,226,.24); }
.primary-nav .badge { padding: 4px 7px; font-size: .65rem; }
.sidebar-backdrop { display: none; }
.app-main { grid-column: 2; grid-row: 2; min-width: 0; min-height: calc(100vh - 76px); min-height: calc(100dvh - 76px); margin: 0; padding: 0; display: flex; flex-direction: column; }
.page-heading { width: 100%; max-width: 1480px; margin: 0 auto; padding: 27px clamp(24px, 3.5vw, 52px) 16px; }
.page-heading-crumb { display: flex; align-items: center; gap: 9px; color: #929bac; font-size: .72rem; font-weight: 550; }
.page-heading-crumb > i:first-child { color: var(--brand); font-size: .86rem; }
.page-heading-crumb > i:nth-of-type(2) { color: #bcc3ce; font-size: .58rem; }
.page-heading-crumb strong { color: #586477; font-weight: 600; }
.page-heading-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-top: 12px; }
.page-heading h1 { margin: 0; color: #172033; font-size: clamp(1.55rem, 2.3vw, 2rem); font-weight: 700; letter-spacing: -.035em; line-height: 1.15; text-wrap: balance; }
.page-heading p { margin: 7px 0 0; color: #768195; font-size: .88rem; text-wrap: pretty; }
.page-date { display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border: 1px solid rgba(255,255,255,.84); border-radius: 12px; background: rgba(255,255,255,.50); color: #647085; font-size: .75rem; font-weight: 600; white-space: nowrap; box-shadow: inset 0 1px rgba(255,255,255,.8), 0 5px 15px rgba(30,48,76,.045); backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%); }
.page-date i { color: var(--brand); }
.app-content { width: 100%; max-width: 1480px; margin: 0 auto; padding: 8px clamp(24px, 3.5vw, 52px) 48px; flex: 1; position: relative; z-index: auto; }
.card, .stat-card, .glass-card {
    border: 1px solid rgba(255,255,255,.88);
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(255,255,255,.82), rgba(248,250,253,.60));
    color: #344054;
    box-shadow: 0 2px 5px rgba(23,32,51,.035), 0 14px 32px rgba(34,54,86,.075), inset 0 1px rgba(255,255,255,.92);
    backdrop-filter: blur(22px) saturate(165%);
    -webkit-backdrop-filter: blur(22px) saturate(165%);
}
.card-header { border-bottom-color: rgba(255,255,255,.62); }
.form-control, .form-select, textarea.form-control { border-color: #cbd5e1; background: #fff; }
.form-control:focus, .form-select:focus, textarea.form-control:focus { border-color: #155bd0; box-shadow: 0 0 0 3px rgba(21,91,208,.15); }
.btn-primary { background: #155bd0; border-color: #155bd0; }
.btn-primary:hover, .btn-primary:focus { background: #1049ad; border-color: #1049ad; }
.btn:focus-visible, a:focus-visible, .nav-section-head:focus-visible { outline: 2px solid #155bd0; outline-offset: 2px; }
.animate-on-scroll { opacity: 0; transform: translateY(24px) scale(.985); transition: opacity .65s cubic-bezier(.2,.7,.2,1), transform .65s cubic-bezier(.2,.7,.2,1); }
.animate-on-scroll.is-visible { opacity: 1; transform: translateY(0) scale(1); }
.app-content .row > [class*="col-"]:nth-child(1) .animate-on-scroll { transition-delay: 40ms; }
.app-content .row > [class*="col-"]:nth-child(2) .animate-on-scroll { transition-delay: 100ms; }
.app-content .row > [class*="col-"]:nth-child(3) .animate-on-scroll { transition-delay: 160ms; }
.app-content .row > [class*="col-"]:nth-child(4) .animate-on-scroll { transition-delay: 220ms; }
.stat-card { transition: transform .28s cubic-bezier(.2,.7,.2,1), box-shadow .28s ease; }
.stat-card:hover { transform: translateY(-5px); box-shadow: 0 14px 35px rgba(23,32,51,.12); }

/* Accueil: bannière de bienvenue et composition des indicateurs */
    .dashboard-hero {
    position: relative; isolation: isolate; overflow: hidden; min-height: 194px;
    display: flex; align-items: center; justify-content: space-between; gap: 30px;
    margin: 2px 0 22px; padding: 22px clamp(26px, 3vw, 42px);
    border-radius: 18px; color: #fff;
    background: linear-gradient(112deg, #122b52 0%, #174b91 56%, #315fb0 100%);
    box-shadow: 0 16px 36px rgba(20,55,105,.18);
}
.dashboard-hero::before, .dashboard-hero::after { content: ''; position: absolute; z-index: -1; border-radius: 50%; pointer-events: none; }
.dashboard-hero::before { width: 420px; height: 420px; right: 4%; top: -280px; border: 0; background: radial-gradient(circle, rgba(120,170,255,.19), transparent 68%); animation: heroHalo 9s ease-in-out infinite alternate; }
.dashboard-hero::after { width: 300px; height: 300px; right: -80px; bottom: -220px; background: rgba(120,172,255,.22); filter: blur(4px); }
.dashboard-hero-copy { position: relative; z-index: 2; max-width: 570px; }
.dashboard-hero-kicker { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 11px; color: rgba(255,255,255,.79); font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.dashboard-hero-kicker i { color: #c6dcff; font-size: 1rem; animation: sparklePulse 2.4s ease-in-out infinite; }
.dashboard-hero h2 { margin: 0; color: #fff; font-size: clamp(1.65rem, 2.7vw, 2.25rem); font-weight: 700; letter-spacing: -.04em; text-wrap: balance; }
.dashboard-hero p { margin: 8px 0 16px; color: rgba(255,255,255,.78); font-size: .86rem; }
.dashboard-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.dashboard-hero-actions .btn { min-height: 42px; display: inline-flex; align-items: center; gap: 9px; padding: 0 15px; border-radius: 12px; font-size: .78rem; font-weight: 650; transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease; }
.hero-primary-action { color: #154ca8; background: #fff; box-shadow: 0 5px 14px rgba(12,35,85,.18); }
.hero-primary-action:hover { color: #103d8b; background: #edf4ff; transform: translateY(-2px); box-shadow: 0 8px 18px rgba(12,35,85,.25); }
.hero-primary-action .bi-arrow-up-right { margin-left: 4px; transition: transform .2s ease; }
.hero-primary-action:hover .bi-arrow-up-right { transform: translate(2px,-2px); }
.hero-secondary-action { border: 1px solid rgba(255,255,255,.38); color: #fff; background: rgba(255,255,255,.10); }
.hero-secondary-action:hover { color: #fff; background: rgba(255,255,255,.2); transform: translateY(-2px); }
.dashboard-hero-art { position: relative; width: 260px; height: 154px; flex: 0 0 260px; margin-right: 2%; display: grid; place-items: center; }
.hero-chart-panel { width: 100%; height: 100%; padding: 12px 15px 10px; border: 1px solid rgba(255,255,255,.38); border-radius: 16px; background: linear-gradient(145deg, rgba(255,255,255,.17), rgba(12,37,76,.22)); box-shadow: inset 0 1px rgba(255,255,255,.3), 0 14px 30px rgba(5,22,53,.16); backdrop-filter: blur(18px) saturate(155%); -webkit-backdrop-filter: blur(18px) saturate(155%); }
.hero-chart-heading, .hero-chart-footer, .hero-chart-footer > span { display: flex; align-items: center; justify-content: space-between; }
.hero-chart-heading { color: rgba(255,255,255,.72); font-size: .58rem; font-weight: 700; letter-spacing: .1em; }
.hero-chart-heading i { color: #9bcbff; font-size: .9rem; animation: chartActivity 2s ease-in-out infinite; }
.hero-chart-area { position: relative; height: 88px; margin-top: 3px; overflow: hidden; }
.hero-chart-gridline { position: absolute; right: 0; left: 0; height: 1px; background: rgba(255,255,255,.1); }
.hero-chart-gridline-one { top: 33%; }
.hero-chart-gridline-two { top: 68%; }
.hero-chart-bars { position: absolute; inset: 0 0 0 2px; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.hero-chart-bars i { display: block; flex: 1; height: var(--bar-height); min-width: 7px; border-radius: 4px 4px 1px 1px; background: linear-gradient(180deg, rgba(182,220,255,.82), rgba(115,168,245,.18)); transform: scaleY(0); transform-origin: bottom; animation: barRise .75s cubic-bezier(.2,.8,.2,1) var(--bar-delay) forwards; }
.hero-chart-bars i:nth-child(1) { --bar-height: 35%; --bar-delay: .08s; }
.hero-chart-bars i:nth-child(2) { --bar-height: 52%; --bar-delay: .14s; }
.hero-chart-bars i:nth-child(3) { --bar-height: 42%; --bar-delay: .2s; }
.hero-chart-bars i:nth-child(4) { --bar-height: 66%; --bar-delay: .26s; }
.hero-chart-bars i:nth-child(5) { --bar-height: 56%; --bar-delay: .32s; }
.hero-chart-bars i:nth-child(6) { --bar-height: 77%; --bar-delay: .38s; }
.hero-chart-bars i:nth-child(7) { --bar-height: 64%; --bar-delay: .44s; }
.hero-chart-bars i:nth-child(8) { --bar-height: 88%; --bar-delay: .5s; }
.hero-chart-bars i:nth-child(9) { --bar-height: 78%; --bar-delay: .56s; }
.hero-chart-trend { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.hero-chart-trend path { fill: none; stroke: #fff; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 360; stroke-dashoffset: 360; filter: drop-shadow(0 0 4px rgba(188,221,255,.72)); animation: chartDraw 1.6s cubic-bezier(.25,.75,.3,1) .45s forwards; }
.hero-chart-point { position: absolute; top: 10%; right: 0; width: 7px; height: 7px; border: 2px solid #fff; border-radius: 50%; background: #83bdff; box-shadow: 0 0 0 4px rgba(131,189,255,.2); opacity: 0; animation: pointAppear .3s ease 1.9s forwards, pointPulse 2.8s ease-in-out 2.2s infinite; }
.hero-chart-footer { margin-top: 3px; color: rgba(255,255,255,.62); font-size: .58rem; }
.hero-chart-footer > span:first-child { justify-content: flex-start; gap: 6px; }
.hero-chart-footer i { width: 6px; height: 6px; border-radius: 50%; background: #61dbaf; box-shadow: 0 0 0 3px rgba(97,219,175,.14); }
.hero-float { position: absolute; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.42); border-radius: 11px; background: rgba(255,255,255,.17); color: #fff; font-size: .85rem; box-shadow: 0 8px 24px rgba(13,38,94,.18); backdrop-filter: blur(6px); }
.hero-float-stock { top: -9px; left: -10px; animation: floatOne 4.5s ease-in-out infinite; }
.hero-float-cash { right: -10px; bottom: -8px; animation: floatTwo 5s ease-in-out infinite; }
@keyframes heroHalo { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(-18px,14px,0) scale(1.06); } }
@keyframes sparklePulse { 0%,100% { opacity: .65; transform: scale(.9) rotate(-8deg); } 50% { opacity: 1; transform: scale(1.12) rotate(8deg); } }
@keyframes orbitSpin { to { transform: rotate(360deg); } }
@keyframes barRise { to { transform: scaleY(1); } }
@keyframes chartDraw { to { stroke-dashoffset: 0; } }
@keyframes chartActivity { 0%,100% { opacity: .65; } 50% { opacity: 1; transform: scale(1.1); } }
@keyframes pointAppear { to { opacity: 1; } }
@keyframes pointPulse { 0%,100% { box-shadow: 0 0 0 4px rgba(131,189,255,.18); } 50% { box-shadow: 0 0 0 7px rgba(131,189,255,.08); } }
@keyframes floatOne { 0%,100% { transform: translateY(0) rotate(-5deg); } 50% { transform: translateY(-8px) rotate(2deg); } }
@keyframes floatTwo { 0%,100% { transform: translateY(0) rotate(4deg); } 50% { transform: translateY(7px) rotate(-4deg); } }
@keyframes floatThree { 0%,100% { transform: translateY(0) rotate(3deg); } 50% { transform: translateY(-6px) rotate(-4deg); } }
.dashboard-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 0 0 14px; }
.dashboard-section-heading > div > span { color: #68758a; font-size: .65rem; font-weight: 750; letter-spacing: .11em; }
.dashboard-section-heading h2 { margin: 5px 0 0; color: #172033; font-size: 1.16rem; font-weight: 700; letter-spacing: -.02em; }
.dashboard-updated { display: inline-flex; align-items: center; gap: 7px; color: #68758a; font-size: .72rem; font-weight: 550; }
.dashboard-updated i { color: var(--brand); }
.dashboard-metrics { --bs-gutter-x: 1rem; --bs-gutter-y: 1rem; }
.dashboard-metrics > [class*="col-"] { display: flex; }
.dashboard-metric { width: 100%; min-height: 124px; padding: 20px; border-top: 2px solid var(--metric-accent, #155bd0); border-color: rgba(255,255,255,.9); background: linear-gradient(145deg, rgba(255,255,255,.86), rgba(247,250,254,.62)); box-shadow: 0 3px 8px rgba(26,43,69,.04), 0 14px 30px rgba(33,55,88,.07), inset 0 1px rgba(255,255,255,.96); backdrop-filter: blur(20px) saturate(165%); -webkit-backdrop-filter: blur(20px) saturate(165%); }
.dashboard-metric::after { display: none; }
.dashboard-metric::before { content: ''; position: absolute; z-index: 0; inset: 0; border-radius: inherit; pointer-events: none; opacity: .7; background: linear-gradient(112deg, rgba(255,255,255,.66), transparent 42%, transparent 68%, rgba(255,255,255,.12)); background-size: 220% 100%; background-position: 100% 0; }
.dashboard-metric > * { position: relative; z-index: 1; }
.dashboard-metric:hover::before { animation: glassSheen .8s ease both; }
@keyframes glassSheen { from { background-position: 100% 0; } to { background-position: 0 0; } }
.dashboard-metric.is-primary { --metric-accent: #155bd0; }
.dashboard-metric.is-success { --metric-accent: #078052; }
.dashboard-metric.is-info { --metric-accent: #167ab6; }
.dashboard-metric.is-warning { --metric-accent: #b87508; }
.dashboard-metric .stat-label { color: #5f6c80; font-size: .73rem; font-weight: 650; letter-spacing: .04em; }
.dashboard-metric .stat-value { margin-top: 12px; color: #172033; font-size: clamp(1.4rem, 1.9vw, 1.85rem); font-weight: 720; font-variant-numeric: tabular-nums; }
.dashboard-metric .stat-icon { width: 40px; height: 40px; border-radius: 12px; color: var(--metric-accent); font-size: 1.05rem; box-shadow: none !important; }
.dashboard-metric.is-primary .stat-icon { background: #edf4ff; }
.dashboard-metric.is-success .stat-icon { background: #eaf7f0; }
.dashboard-metric.is-info .stat-icon { background: #eaf5fb; }
.dashboard-metric.is-warning .stat-icon { background: #fff4df; }
.dashboard-activity-heading { margin-top: 30px; }
.dashboard-activity .card { overflow: hidden; }
.dashboard-activity .card-header { min-height: 65px; padding: 18px 21px; border-bottom-color: #edf0f5; }
.dashboard-activity .card-header h5 { margin: 0; color: #253047; font-size: .9rem; font-weight: 700; }
.dashboard-activity .card-header h5 i { margin-right: 7px; }
.dashboard-activity .table { font-size: .8rem; }
.dashboard-activity .table thead th { background: #f8f9fc !important; color: #788397; font-size: .65rem; letter-spacing: .06em; }
.dashboard-activity .list-group-item { padding: 15px 18px; border-color: #edf0f5; }
.dashboard-empty-state { min-height: 108px; display: flex; align-items: center; gap: 14px; padding: 20px 22px; color: #344054; }
.dashboard-empty-icon { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 42px; border-radius: 14px; background: #e5f4eb; color: #087443; font-size: 1.25rem; }
.dashboard-empty-state strong { display: block; color: #1e293b; font-size: .86rem; font-weight: 700; }
.dashboard-empty-state p { margin: 3px 0 0; color: #5f6c80; font-size: .78rem; }
@media (max-width: 1199.98px) {
    .app-header-main { gap: 14px; }
    .app-header-tools { gap: 7px; }
    .account-meta { max-width: 132px; }
}
@media (max-width: 991.98px) {
    .app-shell { display: block; min-height: 100vh; min-height: 100dvh; }
    .app-header { display: block; }
    .primary-nav { display: none; position: fixed; top: 78px; left: 12px; right: 12px; z-index: 1050; width: auto; height: auto; max-height: calc(100dvh - 94px); overflow: auto; border: 1px solid #e4e9f1; border-radius: 20px; background: #f8f9fb; box-shadow: 0 24px 64px rgba(17,27,45,.2); opacity: 0; transform: translateY(-10px) scale(.985); transition: opacity .22s ease, transform .22s ease; }
    .primary-nav-inner { min-height: 0; padding: 12px; gap: 4px; }
    .app-main { min-height: calc(100dvh - 68px); }
    .app-header-main { min-height: 68px; padding: 10px 18px; }
    .burger { display: inline-grid; order: 3; flex-shrink: 0; margin-left: 2px; color: #344054; }
    .app-header-tools { gap: 6px; }
    .account-meta, .account-caret { display: none; }
    .connection-status { display: none !important; }
    .store-switcher { max-width: 42px; overflow: hidden; }
    .store-switcher .d-none { display: none !important; }
    .primary-nav.open { display: block; opacity: 0; transform: translateY(-10px) scale(.985); }
    .primary-nav.open.is-visible { opacity: 1; transform: translateY(0) scale(1); }
    .primary-nav-inner { display: flex; align-items: stretch; flex-direction: column; }
    .nav-home, .nav-section-head { width: 100%; min-height: 46px; justify-content: flex-start; padding: 0 13px; }
    .nav-section-head { justify-content: space-between; }
    .nav-section-body { position: static; display: none; width: auto; min-width: 0; max-width: none; margin: 3px 0 8px 8px; padding: 7px; grid-template-columns: 1fr; border-radius: 0 0 0 13px; border-left: 1px solid #dce1e8; background: transparent; box-shadow: none; opacity: 1; transform: none; visibility: visible; pointer-events: auto; }
    .nav-section.open > .nav-section-body { display: grid; }
    .nav-menu-caption { display: none; }
    .sidebar-backdrop.visible { display: block; position: fixed; inset: 0; z-index: 1035; opacity: 1; background: rgba(17,27,45,.38); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
    .app-main { min-height: calc(100dvh - 68px); }
}
@media (max-width: 767.98px) {
    .dashboard-hero { min-height: 225px; }
    .dashboard-hero-art { width: 180px; height: 170px; flex-basis: 180px; margin-right: -10px; transform: scale(.86); }
    .dashboard-metric { min-height: 126px; padding: 17px; }
    .dashboard-metric .stat-icon { width: 38px; height: 38px; }
}
@media (max-width: 575.98px) {
    .app-brand { gap: 8px; }
    .app-brand-mark { width: 38px; height: 38px; border-radius: 12px; }
    .app-brand-copy strong { font-size: .91rem; }
    .app-brand-copy small { font-size: .62rem; }
    .app-header-main { gap: 8px; padding-inline: 12px; }
    .app-header-tools { gap: 4px; }
    .quick-pos { width: 36px; min-height: 36px; padding: 0; justify-content: center; }
    .quick-pos span { display: none; }
    .account-link { margin-left: 0; padding: 2px; }
    .account-link .avatar { width: 35px; height: 35px; }
    .tool-icon, .logout-button, .burger { width: 36px; height: 36px; }
    .page-heading { padding: 24px 18px 14px; }
    .page-heading-row { align-items: flex-start; flex-direction: column; gap: 12px; }
    .page-heading h1 { font-size: 1.65rem; }
    .app-content { padding: 8px 16px 36px; }
    .dashboard-hero { min-height: 260px; align-items: flex-start; padding: 25px 21px; }
    .dashboard-hero-copy { max-width: 100%; }
    .dashboard-hero p { max-width: 270px; }
    .dashboard-hero-art { position: absolute; right: -64px; bottom: -55px; transform: scale(.7); opacity: .46; }
    .dashboard-hero-actions { position: relative; z-index: 2; }
    .dashboard-hero-actions .btn { font-size: .72rem; }
    .dashboard-section-heading { align-items: flex-start; }
    .dashboard-updated { margin-top: 4px; font-size: .65rem; }
}
@media (prefers-reduced-motion: reduce) {
    body::before { animation: none; }
    .animate-on-scroll { opacity: 1; transform: none; transition: none; }
    .dashboard-hero::before, .hero-float, .hero-chart-heading i, .hero-chart-bars i, .hero-chart-trend path, .hero-chart-point, .dashboard-hero-kicker i { animation: none !important; }
    .hero-chart-bars i { transform: scaleY(1); }
    .hero-chart-trend path { stroke-dashoffset: 0; }
    .hero-chart-point { opacity: 1; }
}
@media print {
    .app-header, .sidebar-backdrop, .page-heading, .burger { display: none !important; }
    .app-shell, .app-main { display: block !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; }
    .app-content { max-width: none !important; padding: 0 !important; }
}
