/* =================================================================
   QUẢN LÝ CHỢ - STYLE.CSS
   Phiên bản 2.0
   - Tối ưu và sắp xếp lại code.
   - Thêm biến màu (CSS Variables) để dễ dàng tùy chỉnh.
   - Thêm font chữ Google (Be Vietnam Pro) cho giao diện hiện đại.
   ================================================================= */

/* --- 1. BIẾN MÀU VÀ FONT CHỮ --- */
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #0d6efd;
    --dark-color: #343a40;
    --light-gray-color: #adb5bd;
    --white-color: #ffffff;
    --background-color: #f8f9fa;
    --sidebar-width: 250px;
    --transition-speed: 0.3s;
}

body {
    font-family: 'Be Vietnam Pro', sans-serif;
    background-color: var(--background-color);
    color: #212529;
}

/* --- 2. LAYOUT CHÍNH & SIDEBAR --- */
.sidebar {
    height: 100vh;
    width: var(--sidebar-width);
    position: fixed;
    top: 0;
    left: 0;
    background-color: var(--dark-color);
    transition: transform var(--transition-speed) ease-in-out;
    z-index: 1030; /* Nằm trên lớp phủ và nội dung */
}

.main-content {
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-speed) ease-in-out;
    width: calc(100% - var(--sidebar-width));
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1029; /* Nằm dưới sidebar */
}

/* --- 3. CÁC THÀNH PHẦN CỦA SIDEBAR --- */
.sidebar .nav-link {
    color: var(--light-gray-color);
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem; /* bo góc nhẹ */
}

.sidebar .nav-link.active,
.sidebar .nav-link:hover {
    color: var(--white-color);
    background-color: #495057;
}

.sidebar .bi {
    margin-right: 0.75rem; /* Tăng khoảng cách cho icon */
}

.sidebar-close-btn {
    position: absolute;
    top: 5px;
    right: 15px;
    font-size: 2.2rem;
    font-weight: 300;
    background: none;
    border: none;
    color: var(--light-gray-color);
    line-height: 1;
}

.sidebar-close-btn:hover {
    color: var(--white-color);
}


/* --- 4. CÁC COMPONENT TÙY CHỈNH --- */

/* Liên kết thẻ */
.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15);
}

/* Label thông tin */
.info-label {
    font-weight: 600;
    color: #6c757d;
    margin-right: 8px;
}

/* Text cảnh báo quá hạn */
.overdue {
    color: #dc3545;
    font-weight: bold;
}


/* --- 5. STYLE RIÊNG CHO TRANG ĐĂNG NHẬP --- */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background-color: #f0f2f5;
}

.login-card {
    width: 100%;
    max-width: 400px;
}


/* --- 6. RESPONSIVE - DÀNH CHO DI ĐỘNG --- */
@media (min-width: 992px) {
    .sidebar {
        transform: translateX(0); /* Luôn hiển thị sidebar trên desktop */
    }
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%); /* Mặc định ẩn sidebar */
    }

    .sidebar.active {
        transform: translateX(0); /* Hiện sidebar khi có class 'active' */
        box-shadow: 0 0.5rem 1rem rgba(0,0,0,.15);
    }

    /* Khi sidebar hiện, hiển thị lớp phủ */
    .sidebar.active ~ .sidebar-overlay {
        display: block;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }
}
