/* ===================== BASE ===================== */
body {
    background: #f4f6f9;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    font-size: 14px;
}

/* ===================== LOGIN ===================== */
.login-body {
    background: #eef2f7;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-card {
    background: #fff;
    padding: 35px;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, .08);
    width: 380px;
}

/* ===================== SIDEBAR ===================== */
.sidebar {
    width: 250px;
    height: 100vh;
    background: #fff;
    border-right: 1px solid #e6e8eb;
    position: fixed;
    top: 0;
    left: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 40px;
    /* espace pour l'indicateur */
    z-index: 1000;
    scrollbar-width: thin;
    scrollbar-color: #c9ced6 #f4f6f9;
}

/* Scroll personnalisé (Chrome, Edge, Safari) */
.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f4f6f9;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #c9ced6;
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #0d6efd;
}

/* Marque */
.sidebar .brand {
    padding: 12px 16px;
    border-bottom: 1px solid #e6e8eb;
    font-weight: 600;
    color: #0d6efd;
    font-size: 13.5px;
    display: flex;
    align-items: center;
}

/* Liens */
.sidebar a {
    display: flex;
    align-items: center;
    padding: 6px 16px;
    color: #495057;
    text-decoration: none;
    font-size: 13px;
    border-left: 3px solid transparent;
    transition: background .15s;
}

.sidebar a i {
    margin-right: 10px;
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar a:hover {
    background: #f8f9fa;
    color: #0d6efd;
}

.sidebar a.active {
    background: #e7f1ff;
    color: #0d6efd;
    border-left-color: #0d6efd;
    font-weight: 500;
}

/* Sections */
.sidebar .nav-section {
    padding: 8px 16px 2px;
    font-size: 10px;
    text-transform: uppercase;
    color: #adb5bd;
    letter-spacing: .5px;
}

/* Indicateur visuel "défiler" en bas */
.sidebar::after {
    content: '↓ défiler';
    position: fixed;
    bottom: 0;
    left: 0;
    width: 250px;
    padding: 8px 0;
    text-align: center;
    font-size: 11px;
    color: #0d6efd;
    background: linear-gradient(to top, #fff 70%, rgba(255, 255, 255, 0));
    pointer-events: none;
    letter-spacing: .5px;
    font-weight: 500;
}

/* ===================== MAIN ===================== */
.main-content {
    margin-left: 250px;
    min-height: 100vh;
}

.topbar {
    height: 60px;
    background: #fff;
    border-bottom: 1px solid #e6e8eb;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 999;
}

.content {
    padding: 20px;
}

/* ===================== CARDS ===================== */
.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 18px;
    border: 1px solid #eef0f3;
}

.stat-card .stat-icon {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.card {
    border: 1px solid #eef0f3;
    border-radius: 10px;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #eef0f3;
    font-weight: 600;
}

/* ===================== TABLES ===================== */
.table thead th {
    background: #f8f9fa;
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    border-bottom: 1px solid #e6e8eb;
}

/* ===================== BOUTONS ===================== */
.btn-primary {
    background: #0d6efd;
    border-color: #0d6efd;
}

/* ===================== POS ===================== */
.pos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    max-height: 70vh;
    overflow-y: auto;
}

.pos-produit {
    background: #fff;
    border: 1px solid #e6e8eb;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    text-align: center;
    transition: .15s;
}

.pos-produit:hover {
    border-color: #0d6efd;
    box-shadow: 0 3px 10px rgba(13, 110, 253, .1);
}

.pos-produit .nom {
    font-weight: 500;
    font-size: 13px;
}

.pos-produit .prix {
    color: #0d6efd;
    font-weight: 600;
    margin-top: 5px;
}

.pos-produit .stock {
    font-size: 11px;
    color: #6c757d;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
    .sidebar {
        width: 70px;
    }

    .sidebar .brand span,
    .sidebar a span,
    .sidebar .nav-section {
        display: none;
    }

    .sidebar a {
        justify-content: center;
        padding: 12px 0;
    }

    .sidebar a i {
        margin-right: 0;
        font-size: 1.2rem;
    }

    .sidebar::after {
        width: 70px;
        font-size: 9px;
    }

    .main-content {
        margin-left: 70px;
    }
}

/* ===================== ÉCRANS COURTS ===================== */
/* Sur écran portable (hauteur entre 800 et 1000px), on compacte encore */
@media (min-height: 800px) and (max-height: 1000px) {
    .sidebar a {
        padding: 5px 16px;
        font-size: 12.5px;
    }

    .sidebar .nav-section {
        padding: 6px 16px 2px;
        font-size: 9.5px;
    }

    .sidebar .brand {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* Sur écran très court (< 800px), on compacte au maximum */
@media (max-height: 800px) {
    .sidebar a {
        padding: 4px 14px;
        font-size: 12px;
    }

    .sidebar .nav-section {
        padding: 5px 14px 1px;
        font-size: 9px;
    }

    .sidebar .brand {
        padding: 8px 14px;
        font-size: 12.5px;
    }
}