@import url('components/_datatable.css');
@import url('components/_select.css');
@import url('components/_multiselect.css');
@import url('components/_modal.css');
@import url('components/_card.css');
@import url('components/_button.css');
@import url('components/_select2.css');


:root {
    --bg-color: #e6e7ee;
    --blue-accent: #1da1f2;
    --text-primary: #5a6b7c;
    --text-main: #4a4a4a;
    --danger: #e74c3c;
    --gray: #b8b9be;
    --shadow-light: #ffffff;
    --shadow-dark: #b8b9be;
    --shadow-blue: rgba(29, 161, 242, 0.3);
    /* --- CÁC BIẾN ĐỒNG BỘ KÍCH THƯỚC KHUNG --- */
    --bs-height: 44px; /* Chốt cứng 1 thông số cho toàn bộ Input, Select, Button */
    --bs-border-radius: 10px; /* Độ bo góc chung cho các ô nhập liệu */
    /* --- CÁC BIẾN ĐỒNG BỘ HIỆU ỨNG NEUMORPHISM --- */
    /* Hiệu ứng nổi (Dùng cho Nút bấm, Card, Dropdown) */
    --neu-outset: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
    /* Hiệu ứng lõm (Dùng cho Input, Select, Checkbox) */
    --neu-inset: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
    --bs-font-size: 14px;
    --bs-font-weight: 550;
    --offset-height: 250px;
    --bs-font-family: 'Nunito Sans', 'sans-serif';
}

body {
    background-color: var(--bg-color);
    font-family: var(--bs-font-family)  !important;
    margin: 0;
    padding: 0;
}

* {
    -webkit-font-smoothing: antialiased !important; /* Làm mịn chữ trên Chrome/Safari/Edge */
    -moz-osx-font-smoothing: grayscale !important; /* Làm mịn chữ trên Firefox */
    text-rendering: optimizeLegibility !important; /* Ưu tiên render nét chữ đẹp, rõ ràng */
}

body,
input,
select,
textarea,
button,
.input-group-text,
.select2-container,
.select2-selection__rendered,
.select2-results__option,
.select2-search__field,
.custom-select-trigger,
.custom-option {
    font-family: var(--bs-font-family) !important; /* Gắn cứng tên font */
    font-size: var(--bs-font-size) !important;
    font-weight: var(--bs-font-weight) !important; 
    /*color: var(--text-primary) !important;*/ 
    letter-spacing: 0.2px !important; /* Tăng khoảng cách các chữ cái lên một xíu xiu để dễ đọc hơn */
}

/* Đồng bộ luôn phần chữ mờ (Placeholder) */
::placeholder,
.select2-container--default .select2-selection--single .select2-selection__placeholder {
    font-family: var(--bs-font-family) !important;
    font-size: var(--bs-font-size) !important;
    font-weight: var(--bs-font-weight) !important; /* Chữ placeholder nên mỏng hơn chữ thật một chút */
    color: var(--text-main) !important;
}



.container-neumorphic {
    flex: 1;
    display: flex;
    justify-content: center; /* Canh giữa ngang */
    align-items: center; /* Canh giữa dọc */
    height: 100vh;
}

.container-fullwidth {
    flex: 1;
    display: flex;
    justify-content: center; /* Canh giữa ngang */
    align-items: center; /* Canh giữa dọc */
    height: 100vh;
}

.container-login {
    width: 350px;
    padding: 40px;
    background-color: #e0e5ec;
    border-radius: 20px;
    /* Bóng tối ở góc dưới phải, bóng sáng ở góc trên trái */
    box-shadow: 9px 9px 16px rgb(163,177,198,0.6), -9px -9px 16px rgba(255,255,255, 0.5);
    text-align: center;
}

.grid-row {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 40px;
}

.card {
    padding: 10px;
    border-radius: 20px;
    flex: 1;
    min-width: 300px;
}

.card-modal {
    border-radius: 20px;
    height: 100%;
    width: 100%;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    text-align: center;
    padding: 10px;
}

.card-fullwidth {
    border-radius: 20px;
    height: 100%;
    width: 100%;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin: 10px;
}

.section-title {
    color: var(--blue-accent);
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 18px;
}
/* LỚP TIỆN ÍCH NEUMORPHISM */
.neumorphic-outset {
    background: var(--bg-color);
    /*box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-blue);*/
    box-shadow: 6px 6px 12px var(--shadow-blue);
}

.neumorphic-inset {
    background: var(--bg-color);
    box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
}

/* THANH ĐIỀU HƯỚNG CHÍNH */
.navbar {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px 5px;
    border-radius: 0 0 15px 15px;
    margin-bottom: 20px;
    position: sticky;
    top: 0;
    z-index: 1000; /* Đảm bảo menu luôn nằm trên cùng che đi các nội dung bên dưới */
    height: 65px;
}

.brand {
    position: absolute;
    left: 40px;
    font-size: 20px;
    font-weight: bold;
    color: var(--blue-accent);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-radius: 15px;
    transition: all 0.3s ease;
}

    .brand:hover {
        box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
    }

/* NÚT HAMBURGER (ẨN TRÊN PC) */
.menu-toggle {
    display: none;
    font-size: 24px;
    color: var(--blue-accent);
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 12px;
}

/* MENU CHÍNH */
.nav-menu {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-item {
    position: relative;
}

    .nav-item > a {
        text-decoration: none;
        color: var(--text-gray);
        font-weight: var(--bs-font-weight);
        padding: 12px 20px;
        border-radius: 15px;
        display: flex;
        align-items: center;
        gap: 8px;
        /*transition: all 0.3s ease;*/
    }

        .nav-item > a:hover {
            color: var(--blue-accent);
            box-shadow: var(--neu-inset);
        }

        .nav-item > a i.fa-angle-down {
            transition: transform 0.3s ease;
        }

/* MENU CON (DROPDOWN) - MÀN HÌNH LỚN */
.sub-menu {
    list-style: none;
    padding: 15px 10px;
    margin: 0;
    position: absolute;
    top: 150%;
    left: 50%; /* Bắt đầu từ giữa menu cha */
    transform: translateX(-50%) translateY(15px); /* Căn giữa hoàn toàn và tạo khoảng cách mượt */
    border-radius: 15px;
    min-width: 260px;
    width: max-content;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 999;
}

    .sub-menu li a {
        white-space: nowrap; /* Buộc text luôn hiển thị trên 1 dòng */
        display: block; /* Đảm bảo thẻ a chiếm toàn bộ không gian của li */
    }

/* HOVER CHỈ ÁP DỤNG TRÊN MÀN HÌNH LỚN (PC) */
@media (hover: hover) and (pointer: fine) {
    .nav-item:hover .sub-menu {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }

    .nav-item:hover > a i.fa-angle-down {
        color: var(--blue-accent);
        transform: rotate(180deg);
    }

    .nav-item.has-dropdown:hover > a {
        /*color: var(--blue-accent);*/
        box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
    }

    /* ĐÃ SỬA LỖI Ở ĐÂY: Thêm opacity và visibility cho User Menu */
    .user-menu:hover .sub-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .user-menu:hover .user-profile i.fa-angle-down {
        transform: rotate(180deg);
    }
}

/* CLASS ĐỂ MỞ MENU CON BẰNG JS THAY VÌ HOVER (DÙNG CHO TRẠNG THÁI ACTIVE TRÊN CẢ MOBILE VÀ PC NẾU CẦN) */
/* Đảm bảo transform căn giữa luôn được áp dụng cho màn hình lớn khi active */
.nav-item.active .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.nav-item.active > a i.fa-angle-down {
    transform: rotate(180deg);
}

.sub-menu li a {
    text-decoration: none;
    color: var(--text-gray);
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 10px;
    font-weight: 500;
    /*transition: all 0.3s ease;*/
}

    .sub-menu li a i {
        color: var(--blue-accent);
        width: 20px;
        text-align: center;
    }

    .sub-menu li a:hover {
        color: var(--blue-accent);
        background: var(--bg-color);
        box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
    }
/* khắc phục "Dropdown Gap" (Khoảng trống menu lọt chuột)*/
.sub-menu::before {
    content: '';
    position: absolute;
    top: -20px; /* Độ cao kéo ngược lên để lấp đầy khoảng trống. Bạn có thể tăng/giảm con số này (ví dụ -15px, -25px) sao cho vừa khít với khoảng cách thực tế */
    left: 0;
    width: 100%;
    height: 20px; /* Phải bằng với con số ở top */
    background-color: transparent; /* Giữ nó hoàn toàn trong suốt */
    z-index: 10; /* Đảm bảo cầu nối nằm phía trên cùng để nhận tương tác chuột */
}
/* Hỗ trợ thao tác click (Active) */
.nav-item.active .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.nav-item.active > a i.fa-angle-down {
    transform: rotate(180deg);
}

.sub-menu li a {
    text-decoration: none;
    color: var(--text-gray);
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 10px;
    font-weight: 500;
    /*transition: all 0.3s ease;*/
    margin-bottom: 5px;
}

    .sub-menu li a i {
        color: var(--blue-accent);
        width: 20px;
        text-align: center;
    }

    .sub-menu li a:hover {
        color: var(--blue-accent);
        box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
    }

    /* CLASS RIÊNG CHO MỤC MENU CON ĐANG ĐƯỢC CHỌN (Giống mục Văn bản đi trong hình) */
    .sub-menu li a.active-sub {
        color: var(--blue-accent);
        box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
    }
/* MENU NGƯỜI DÙNG BÊN PHẢI */
.user-menu {
    position: absolute;
    right: 40px;
}

.user-profile {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--blue-accent); /* Đổi màu xanh giống Brand (nếu muốn xám thì đổi thành var(--text-gray)) */
    font-weight: bold; /* In đậm giống Brand */
    padding: 10px 20px; /* Padding đồng bộ với Brand */
    border-radius: 15px; /* Bo góc đồng bộ với Brand */
    transition: all 0.3s ease;
}

    .user-profile:hover {
        box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
    }

    /* Hiệu ứng mượt cho mũi tên ở User menu */
    .user-profile i.fa-angle-down {
        transition: transform 0.3s ease;
    }

.avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--blue-accent);
}

.user-menu .sub-menu {
    left: auto;
    right: 0;
    transform: translateY(15px);
    width: 200px;
    min-width: auto;
}

/* --- RESPONSIVE CHO ĐIỆN THOẠI --- */
.menu-toggle {
    display: none;
    font-size: 24px;
    color: var(--blue-accent);
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 12px;
    position: absolute;
    right: 40px;
}

.mobile-user-menu {
    display: none;
    border-top: 1px solid var(--shadow-dark);
    margin-top: 10px;
    padding-top: 10px;
}

@media screen and (max-width: 992px) {
    .navbar {
        justify-content: flex-start;
        padding: 15px 20px;
    }

    .brand {
        position: relative;
        left: 0;
    }

    .menu-toggle {
        display: block;
        right: 20px;
    }

    .user-menu {
        display: none;
    }

    .mobile-user-menu {
        display: block;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        flex-direction: column;
        gap: 0;
        background: var(--bg-color);
        border-radius: 0 0 20px 20px;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-in-out;
        margin: 0; /* Bỏ margin auto trên mobile */
    }

        .nav-menu.show {
            max-height: 800px;
            padding: 20px 0;
            box-shadow: 6px 6px 12px var(--shadow-dark);
            overflow-y: auto;
        }

    .nav-item {
        width: 100%;
    }

        .nav-item > a {
            padding: 15px 30px;
            justify-content: space-between;
            border-radius: 0;
        }

    .sub-menu {
        position: static;
        transform: none !important;
        box-shadow: none;
        padding: 0 0 0 30px;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-in-out;
        opacity: 1;
        visibility: visible;
    }

    .nav-item.active .sub-menu {
        max-height: 400px;
        padding-bottom: 10px;
    }
}

@media screen and (min-width: 993px) {
    .nav-menu {
        max-height: none !important;
        overflow: visible;
    }
}

/* ĐẢM BẢO TRẠNG THÁI KHÔI PHỤC KHI QUAY LẠI MÀN HÌNH LỚN */
@media screen and (min-width: 993px) {
    /* Reset các trạng thái di động nếu chúng vẫn còn khi cửa sổ thay đổi kích thước */
    .nav-menu {
        max-height: none !important;
        position: relative;
        top: auto;
        left: auto;
        width: auto;
        flex-direction: row;
        background-color: transparent;
        box-shadow: none !important;
    }
    /* Xóa class active trên di động khi thay đổi kích thước sang màn hình lớn */
    .nav-item.active .sub-menu {
        position: absolute;
        max-height: none;
        padding-bottom: 0;
    }
}

/*Các thành phần khác*/
/* --- 2. LỚP TIỆN ÍCH (UTILITIES) --- */


.text-blue {
    color: var(--blue-accent);
}

.font-bold {
    font-weight: bold;
}


/* 1. TẮT VIỀN VÀ BÓNG XANH MẶC ĐỊNH CỦA BOOTSTRAP KHI FOCUS */
.input-group > .form-control:focus {
    box-shadow: none !important;
    border-color: transparent !important;
    background-color: transparent !important;
}

/* 2. LÀM TRONG SUỐT Ô NHẬP VÀ Ô CHỨA ICON ĐỂ LỘ NỀN NEUMORPHISM */
.input-group > .form-control,
.input-group-prepend .input-group-text {
    background-color: transparent !important;
    border: none !important;
}


/* --- TẮT MÀU NỀN MẶC ĐỊNH KHI AUTOFILL TRÊN TRÌNH DUYỆT --- */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    /* Đóng băng màu nền trong suốt bằng cách delay 5000 giây */
    transition: background-color 5000s ease-in-out 0s !important;
    /* Giữ nguyên màu chữ của bạn (đổi mã màu nếu cần) */
    -webkit-text-fill-color: var(--text-main, #4a4a4a) !important;
    /* Xóa viền mặc định của autofill nếu có */
    -webkit-box-shadow: none !important;
    caret-color: var(--text-main, #4a4a4a); /* Giữ màu con trỏ chuột nhấp nháy */
}
/* Dropdown Select (Custom Box) */
.select-box {
    padding: 12px 20px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 20px;
    font-weight: 600;
    color: var(--blue-accent);
    cursor: pointer;
    user-select: none;
}

    .select-box:active {
        box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
    }

.select2-search--dropdown {
    display: none !important;
}
/* --- 5. TOGGLES & RADIO BUTTONS --- */
/* Radio Buttons */
.radio-group {
    display: flex;
    gap: 20px;
    align-items: center;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
}

.radio-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.radio-inner {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--blue-accent);
    display: none; /* Ẩn đi mặc định */
}
/* Trạng thái checked ảo */
.radio-label input[type="radio"] {
    display: none;
}

    .radio-label input[type="radio"]:checked + .radio-btn .radio-inner {
        display: block;
    }

/* Toggles (Công tắc ON/OFF) */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    font-weight: 500;
}

.toggle-switch {
    width: 70px;
    height: 34px;
    border-radius: 17px;
    display: flex;
    align-items: center;
    padding: 0 4px;
    transition: all 0.3s ease;
}

.toggle-thumb {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--bg-color);
    transition: all 0.3s ease;
}

.toggle-label input[type="checkbox"] {
    display: none;
}
/* Khi Tắt (Off) */
.toggle-switch {
    justify-content: flex-start;
}
/* Khi Bật (On) */
.toggle-label input[type="checkbox"]:checked + .toggle-switch {
    background-color: var(--blue-accent);
    justify-content: flex-end;
    box-shadow: 4px 4px 8px rgba(29, 161, 242, 0.3), -4px -4px 8px rgba(255,255,255,0.5);
}



/* =========================================================
   CÁC CLASS TIỆN ÍCH DÀN TRANG (FLEXBOX UTILITIES)
   ========================================================= */

/* 1. Canh đều giãn ra 2 bên (Thích hợp cho thanh công cụ, header) */
.flex-between {
    display: flex;
    align-items: flex-start; /* Canh giữa theo chiều dọc */
    justify-content: space-between; /* Đẩy các phần tử xa nhau ra sát mép */
    gap: 15px; /* Khoảng cách an toàn giữa các khối */
    width: 100%;
    flex-wrap: wrap; /* Tự động rớt dòng nếu màn hình nhỏ */
    margin-bottom: 15px;
}

/* 2. Dồn các thành phần nằm sát nhau (Thường dồn về bên trái hoặc phải) */
.flex-group {
    display: flex;
    align-items: center;
    gap: 15px; /* Các nút cách nhau 15px đều đặn */
}

/* 3. Tự động giãn dài chiếm hết khoảng trống (Dùng cho ô tìm kiếm) */
.flex-grow {
    flex: 1;
}

/* Xóa margin thừa để chống lệch dòng */
.no-margin {
    margin: 0 !important;
}

.form-control {
    display: block;
    width: 100%;
    height: calc(1.5em + 1.2rem + 0.0625rem);
    padding: 0.6rem 0.75rem;
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.5;
    color: #44476A;
    background-color: #e6e7ee;
    background-clip: padding-box;
    border: 0.0625rem solid #D1D9E6;
    border-radius: 0.55rem;
    box-shadow: inset 2px 2px 5px #b8b9be;
    transition: all 0.3s ease-in-out;
}

/* --- CLASS GỐC: KHỞI TẠO LƯỚI --- chia cột*/
.form-layout {
    display: grid;
    column-gap: 24px; /* Khoảng cách ngang giữa các cột */
    row-gap: 20px; /* Khoảng cách dọc giữa các hàng (Chỉnh số này nhỏ lại nếu muốn gần hơn) */
    width: 100%;
}
    /* Xóa bỏ khoảng cách thừa của Bootstrap khi nằm trong Grid */
    .form-layout .form-group {
        margin-bottom: 0 !important;
    }

    .form-layout input,
    .form-layout select {
        height: 44px !important; /* Đặt một chiều cao cố định (có thể đổi số này theo ý bạn) */
        min-height: 44px !important;
        box-sizing: border-box !important; /* Đảm bảo padding không cộng dồn làm tăng chiều cao */
        margin: 0 !important;
        border: none !important; /* Xóa viền mặc định của thẻ */
        background: transparent !important; /* Giữ trong suốt để thấy nền Neumorphism */
    }

/* Class tiện ích để ép 1 ô chiếm trọn 2 cột */
.col-span-2 {
    grid-column: span 2;
}

.col-span-3 {
    grid-column: span 3;
}

.col-span-4 {
    grid-column: span 4;
}
/* --- CÁC CLASS CHIA CỘT --- */
/* Dùng hàm repeat() để viết code ngắn gọn hơn */
/* Chia 2 cột đều nhau */
.grid-col-2 {
    grid-template-columns: repeat(2, 1fr);
}
/* Chia 3 cột đều nhau */
.grid-col-3 {
    grid-template-columns: repeat(3, 1fr);
}
/* Chia 4 cột đều nhau */
.grid-col-4 {
    grid-template-columns: repeat(4, 1fr);
}
/* --- RESPONSIVE TRÊN CÁC THIẾT BỊ --- */
/* 1. Trên màn hình Tablet (Dưới 992px) */
@media (max-width: 992px) {
    /* Màn hình nhỏ lại thì form 3, 4 cột sẽ bị chật, nên ta ép nó về 2 cột */
    .grid-col-3,
    .grid-col-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}
/* 2. Trên màn hình Mobile (Dưới 768px) */
@media (max-width: 768px) {
    /* Tất cả các form dù 2, 3 hay 4 cột đều bị ép thành 1 cột xếp dọc */
    .form-layout {
        grid-template-columns: 1fr !important;
    }

    .col-span-2 {
        grid-column: span 1; /* Về mobile thì tự động thu lại thành 1 cột */
    }
}

.datepicker-dropdown {
    z-index: 9999 !important;
}

    .datepicker-dropdown table {
        width: 100%;
    }
/* LỚP VỎ BỌC CANH GIỮA TOÀN MÀN HÌNH */
.center-wrapper {
    position: fixed;
    inset: 0; /* Viết tắt cho: top: 0; bottom: 0; left: 0; right: 0; */
    display: grid;
    place-items: center; /* Lệnh ma thuật canh giữa cả dọc lẫn ngang */
    z-index: 1050;
    /* Cho phép click chuột xuyên qua lớp vỏ tàng hình này nếu cần */
    pointer-events: none;
}
    /* Đảm bảo nội dung bên trong vẫn click được bình thường */
    .center-wrapper > * {
        pointer-events: auto;
        max-width: 90vw;
        max-height: 90vh;
    }
