:root{
    --dark:#0f172a;
    --dark2:#1e293b;
    --blue:#2563eb;
    --green:#16a34a;
    --orange:#f59e0b;
    --red:#dc2626;
    --bg:#f1f5f9;
    --card:#ffffff;
    --text:#0f172a;
    --muted:#64748b;
    --border:#e2e8f0;
}

*{
    box-sizing:border-box;
}

body{
    margin:0;
    background:var(--bg);
    color:var(--text);
    font-family:Segoe UI, Arial, sans-serif;
}

/* =========================
   MENU DESKTOP
========================= */

.sidebar{
    position:fixed;
    left:0;
    top:0;
    width:260px;
    height:100vh;
    background:linear-gradient(180deg,var(--dark),#111827);
    padding:24px;
    color:white;
    z-index:1000;
}

.brand{
    display:flex;
    align-items:center;
    gap:12px;
    margin-bottom:35px;
}

.brand-logo{
    width:46px;
    height:46px;
    border-radius:14px;
    background:var(--blue);
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:800;
}

.brand-title{
    font-size:22px;
    font-weight:800;
}

.brand-subtitle{
    font-size:12px;
    color:#94a3b8;
}

.nav-menu a{
    display:flex;
    gap:10px;
    align-items:center;
    color:#cbd5e1;
    text-decoration:none;
    padding:13px 14px;
    border-radius:12px;
    margin-bottom:8px;
    transition:0.2s ease;
}

.nav-menu a:hover{
    background:var(--dark2);
    color:white;
}

/* =========================
   CONTENU
========================= */

.main-content{
    margin-left:260px;
    padding:32px;
}

.page-title{
    font-size:30px;
    font-weight:800;
}

.page-subtitle{
    color:var(--muted);
    margin-bottom:25px;
}

.card,
.stat-card{
    border:1px solid var(--border);
    border-radius:18px;
    background:var(--card);
    box-shadow:0 8px 25px rgba(15,23,42,0.08);
}

.stat-card{
    padding:22px;
}

.stat-label{
    color:var(--muted);
}

.stat-value{
    font-size:34px;
    font-weight:800;
}

.sticky-card{
    position:sticky;
    top:30px;
}

.table{
    margin-bottom:0;
}

.badge{
    border-radius:10px;
    padding:7px 10px;
}

/* =========================
   BOUTONS MOBILE CACHÉS DESKTOP
========================= */

.mobile-menu-btn,
.mobile-panier-btn,
.mobile-close-panier,
.menu-overlay,
.panier-overlay{
    display:none;
}

/* =========================
   RESPONSIVE MOBILE
========================= */

@media(max-width:900px){

    body{
        overflow-x:hidden;
    }

    .main-content{
        margin-left:0;
        padding:76px 14px 22px 14px;
    }

    .page-title{
        font-size:24px;
        line-height:1.2;
    }

    .page-subtitle{
        font-size:14px;
        margin-bottom:18px;
    }

    .card{
        padding:16px !important;
    }

    .stat-card{
        padding:16px;
    }

    .stat-value{
        font-size:26px;
    }

    .table{
        font-size:14px;
    }

    .sticky-card{
        position:static;
    }

    /* =========================
       MENU MOBILE
    ========================= */

    .mobile-menu-btn{
        display:block;
        position:fixed;
        top:12px;
        left:12px;
        z-index:3001;
        background:var(--dark);
        color:white;
        border:none;
        border-radius:12px;
        padding:11px 15px;
        font-weight:700;
        box-shadow:0 8px 25px rgba(0,0,0,0.25);
    }

    .sidebar{
        position:fixed;
        left:-280px;
        top:0;
        width:260px;
        height:100vh;
        padding:80px 22px 22px 22px;
        z-index:3000;
        transition:left 0.28s ease;
        overflow-y:auto;
    }

    .sidebar.open{
        left:0;
    }

    .sidebar .brand{
        margin-bottom:25px;
    }

    .menu-overlay{
        display:block;
        position:fixed;
        inset:0;
        background:rgba(15,23,42,0.55);
        z-index:2999;
        opacity:0;
        pointer-events:none;
        transition:opacity 0.25s ease;
    }

    .menu-overlay.open{
        opacity:1;
        pointer-events:auto;
    }

    /* =========================
       STOCK MOBILE
    ========================= */

    .stock-layout{
        flex-direction:column;
    }

    .stock-table-zone,
    .stock-panier-zone{
        width:100%;
    }

    .stock-table-zone{
        order:1;
    }

    .stock-panier-zone{
        order:2;
    }

    .stock-table-zone .d-flex{
        flex-direction:column;
    }

    .stock-table-zone select{
        max-width:none !important;
        width:100%;
    }

    /* =========================
       PANIER MOBILE
    ========================= */

    .mobile-close-panier{
        display:inline-block;
    }

    .mobile-panier-btn{
        display:block;
        position:fixed;
        right:14px;
        bottom:14px;
        z-index:2500;
        border:none;
        border-radius:999px;
        background:var(--green);
        color:white;
        padding:14px 19px;
        font-weight:800;
        box-shadow:0 10px 30px rgba(0,0,0,0.30);
    }

    .panier-overlay{
        display:block;
        position:fixed;
        inset:0;
        background:rgba(15,23,42,0.60);
        z-index:2390;
        opacity:0;
        pointer-events:none;
        transition:opacity 0.25s ease;
    }

    .panier-overlay.open{
        opacity:1;
        pointer-events:auto;
    }

    .stock-panier-zone{
        display:block !important;
        position:fixed;
        left:10px;
        right:10px;
        bottom:0;
        z-index:2400;
        max-height:78vh;
        overflow:auto;
        transform:translateY(115%);
        opacity:0;
        pointer-events:none;
        transition:
            transform 0.30s ease,
            opacity 0.30s ease;
    }

    .stock-panier-zone.open{
        transform:translateY(-72px);
        opacity:1;
        pointer-events:auto;
    }

    .stock-panier-zone .card{
        border-radius:24px;
        box-shadow:0 20px 60px rgba(0,0,0,0.35);
    }

    /* =========================
       FORMULAIRES MOBILE
    ========================= */

    input,
    select,
    textarea,
    button{
        font-size:16px !important;
    }

    .btn{
        white-space:nowrap;
    }
}

.menu-badge{
    margin-left:auto;
    background:#dc2626;
    color:white;
    font-size:12px;
    font-weight:800;
    padding:3px 8px;
    border-radius:999px;
}
/* Le menu Actions passe au-dessus des cartes */
.table-responsive{
    overflow: visible !important;
}

.card{
    overflow: visible !important;
}

.dropdown-menu{
    z-index: 9999 !important;
    box-shadow: 0 10px 30px rgba(0,0,0,.2);
}