/* ======================== */
/* GLOBAL STYLES        */
/* ======================== */
/* Reset và Box-sizing */
*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --primary-color: #ffffff;
    --secondary-color: #5a6268; /* Đã điều chỉnh để có độ tương phản tốt hơn */
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #d9ecee; /* Đã điều chỉnh để có độ tương phản tốt hơn */
    --dark-color: #212529; /* Đã điều chỉnh */
    --border-color: #dee2e6;
    --bg-color: #f8f9fa; /* Đã điều chỉnh */
    --btn-action-color: green;
    --header-background-color: #007000;
    --main-color: #f0f1f2;
    --footer-background-color: #006789;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --sidebar-width-desktop: 25%;
    --sidebar-width-mobile: 50%;
    --header-height: 60px;
    --footer-height: 50px;
}
body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    
}


/* ======================== */
/* MAIN LAYOUT           */
/* ======================== */
body::-webkit-scrollbar { 
    display: none; 
}
body {
    -ms-overflow-style: none; 
    scrollbar-width: none; 
}
.app-container {
    display: flex;
    min-height: 100vh;
}
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: var(--header-background-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}
.brands {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}
.scroll-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-right: 15px;
}
.toggle-img {
    width: 32px;
    height: 32px;
}

.sidebar {
    width: var(--sidebar-width-desktop);
    background-color: #ffffff;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    padding: 20px;
    transition: transform 0.3s ease-in-out;
    flex-shrink: 0;
    position: fixed;
    top: var(--header-height);
    /* ĐÃ SỬA: Chiều cao sidebar cố định giữa header và footer */
    height: calc(100vh - var(--header-height) - 60px);
    left: 0;
    z-index: 999;
    overflow-y: auto;
}
.scrollmenu { 
    height: 100%; 
    overflow-y: auto; 
}
.scrollmenu ul { 
    list-style: none; 
    padding: 0; 
    margin: 0; 
}
.scrollmenu ul li { 
    margin-bottom: 5px; 
}
.sidebar-btn {
    width: 100%;
    text-align: left;
    padding: 12px 15px;
    background-color: transparent;
    border: none;
    border-radius: 5px;
    color: var(--dark-color);
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-btn:hover, .sidebar-btn.active {
    background-color: var(--secondary-color);
    color: #fff;
}
.sidebar-btn i {
    width: 20px;
    text-align: center;
}
.main-content {
    flex-grow: 1;
    padding: 10px;    
    margin-left: var(--sidebar-width-desktop);
    width: calc(100% - var(--sidebar-width-desktop));
    transition: margin-left 0.3s ease-in-out;
    padding-top: calc(var(--header-height) + 20px);
    padding-bottom: var(--footer-height); 
}

footer {
    background-color: var(--footer-background-color);
    color: var(--light-color);
    height: var(--footer-height);
    text-align: center;    
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;

}

/* Ẩn/hiện các section một cách mượt mà */
.main-section {
    display: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out;
}
.main-section.active {
    display: block;
    opacity: 1;
    visibility: visible;
}

.card-content {
    background-color: #f9f9f9;
    border: 1px solid #ddd;    
    border-radius: 4px;
    padding: 5px;
    gap: 5;
    
}

.products-card {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px;    
    gap: 5;
}

/* ======================== */
/* RESPONSIVE DESIGN      */
/* ======================== */
@media (min-width: 769px) {
    /* Ẩn nút scroll-toggle trên desktop */
    .scroll-toggle { display: none !important; }
    /* Hiển thị menu điều hướng chính trên desktop */
    .main-nav {
        display: flex !important;
        flex-direction: row;
        gap: 15px;
        position: static;
        background: none;
        box-shadow: none;
        padding: 0;
    }
    /* Ẩn nút toggle menu trên desktop */
    .menu-toggle {
        display: none !important;
    }
    /* Reset style cho các link trong nav trên desktop */
    .main-nav a {
        padding: 8px 16px;
        border-bottom: none;
    }
}

@media (max-width: 768px) {
    /* Hiện điều hướng sidebar trên mobile */
    .scroll-toggle { display: block; }
    
    /* Điều chỉnh cho màn hình mobile */
    .header-right {
        display: flex;
        align-items: center;
        gap: 15px;
    }
    /* Hiển thị nút toggle trên mobile */
    .menu-toggle {
        display: block !important;
        color: var(--primary-color);
        font-size: 1.5rem;
    }
    /* Ẩn menu nav trên mobile theo mặc định */
    .main-nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: var(--header-height);
        right: 0;
        background-color: var(--secondary-color);
        width: 200px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        padding: 10px;
        border-radius: 0 0 5px 5px;
        z-index: 999;
    }
    /* Class 'show' để hiển thị menu nav khi toggle */
    .main-nav.show {
        display: flex;
    }
    /* Style cho các link trong menu mobile */
    .main-nav a {
        color: var(--primary-color);
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        padding: 10px 15px;
        display: block;
        text-align: left;
    }
    .main-nav a:last-child {
        border-bottom: none;
    }
    /* Đảm bảo các nút tab xuống dòng trên mobile */
    .tab-buttons {
        flex-wrap: wrap;
        gap: 5px; /* Giảm khoảng cách giữa các nút */
    }

    .tab-button {
        flex-grow: 1; /* Cho phép các nút tự động co giãn đều */
    }

    .main-content {
        /* Đã sửa: Trên mobile, nội dung chính không cần margin-left */
        margin-left: 0; 
        width: 100%;
    }

    /* Đảm bảo nội dung tab không bị tràn */
    .tab-content .card {
        padding: 10px; /* Giảm padding để nội dung không bị tràn */
    }

    .nav-button {       
        text-align: center;
    }

    .header-auth-controls #loginNav {
        display: none !important;
    }
}

@media (max-width: 500px) {
    /* Điều chỉnh font-size tổng thể để dễ đọc hơn */
    body {
        font-size: 14px;
    }

    /* Header: Đảm bảo các thành phần được xếp chồng lên nhau */
    .header {
        display: flex; /* Xếp các item theo chiều dọc */
        align-items: center; /* Căn giữa các item */
        padding: auto; /* Giảm padding để tiết kiệm không gian */
        font-size: medium;
    }

    /* Logo và tên thương hiệu */
    .header .brands {
        margin-bottom: 10px; /* Thêm khoảng cách giữa logo và nav-button */
        font-size: 1.2rem; /* Tăng kích thước logo để dễ nhìn */
    }

    /* Các nút điều hướng trên header */
    .header #nav-button {
        font-size: 0.9rem;
        padding: 5px 10px;
    }

    /* Căn chỉnh nội dung chính của trang */
    .main-content {
       padding-bottom: var(--footer-height);
       font-size: medium;
       margin: auto;
    }

    .sidebar {
        padding-bottom: var(--footer-height);   
    }
    /* Các form và input: Đảm bảo hiển thị toàn màn hình */
    .modal-content, .form-container {
        width: 95%;
        margin: 10px auto;
        padding: 15px;
    }

    .header-auth-controls #loginNav {
        display: none !important;
    }
}

/* Bổ sung một số style còn thiếu */
.main-nav { 
    display: flex; 
    gap: 20px; 
}
.main-nav a { 
    text-decoration: none; 
    color: var(--light-color); 
    transition: color 0.2s ease; 
}
.main-nav a:hover { 
    color: var(--primary-color); 
}
.header-auth-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}
.nav-button {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--light-color);
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    
    font-size: 1rem;
    font-weight: 500;

    /* Ngăn nút bị co lại trên màn hình nhỏ và đảm bảo chữ không xuống dòng */
    flex-shrink: 0;
    white-space: nowrap;
}

/* Hiệu ứng khi di chuột qua nút */
.nav-button:hover {
    background-color: var(--info-color);
    color: var(--light-color);
}

/* Hiệu ứng khi nhấn nút */
.nav-button:active {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}
/* Điều chỉnh cho nút profile trong header */
.header .profile-info {
    position: relative; /* Đã thêm để làm gốc định vị cho dropdown */
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0;
    font-family: var(--font-family);
    font-weight: 500;
}

.nav-group {
    display: none; /* Mặc định ẩn tất cả các nhóm nav */
    align-items: center;
    gap: 10px;
}

.user-avatar { 
    width: 32px; 
    height: 32px; 
    border-radius: 50%; 
    border: 2px solid var(--primary-color); 
}
.username-display { 
    font-weight: 500; 
}
/* Dropdown menu */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 160px;
    background-color: var(--main-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    z-index: 100;
}

.dropdown-menu.show {
    display: block;
}
.dropdown-item { 
    display: block; 
    padding: 10px 15px; 
    text-decoration: none; 
    color: var(--dark-color); 
    white-space: nowrap; 
    border: none; 
    background: none; 
    width: 100%; 
    text-align: left; 
    cursor: pointer; 
}
.dropdown-item:hover { 
    background-color: var(--bg-color);
}
.menu-toggle { 
    display: none; 
    background: none; 
    border: none; 
    cursor: pointer; 
}
@media (max-width: 768px) 
{ 
    .menu-toggle 
    { 
        display: block; 
    } 
}

/* CSS phần hiển thị danh sách ngân hàng */
.bank-buttons-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 10px; /* Khoảng cách giữa các nút */
    margin-top: 20px;
}

.btn-bank {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: #f9f9f9;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-bank:hover {
    background-color: #eee;
    border-color: #007bff;
}

.bank-logo {
    width: 24px;
    height: 24px;
}

/* CSS cho nút toggle thông tin nhạy cảm */
/* CSS cho các container chứa thông tin và nút */
.user-info-item {
    display: flex;
    align-items: center;
    gap: 10px; /* Tạo khoảng cách giữa văn bản và nút */
    margin-bottom: 8px;
}

/* CSS cho từng nút toggle thông tin */
.btn-toggle-info {
    border: none;
    background-color: transparent; /* Nền trong suốt */
    color: #333;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    line-height: 1; /* Căn chỉnh với văn bản */
}

.btn-toggle-info:hover {
    color: #007bff; /* Thay đổi màu khi di chuột vào */
}

/* Ẩn thông tin ban đầu */
.user-info-item span {
    font-weight: bold;
}

/* CSS cho Tab Button để hiển thị đúng */
.tab-buttons {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1rem;
}
.tab-button {
    padding: 12px 15px;
    border: none;
    background-color: transparent;
    cursor: pointer;
    font-weight: 500;
    color: var(--secondary-color);
    position: relative;
    transition: color 0.2s ease;
}
.tab-button::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 2px;
    background-color: transparent;
    transition: background-color 0.2s ease;
}
.tab-button.active {
    color: var(--main-color);
}
.tab-button.active::after {
    background-color: var(--primary-color);
}
.tab-pane {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}
.tab-pane.active {
    display: block;
    opacity: 1;
}

/* ======================== */
/* Profile Dropdown    */
/* ======================== */
.main-nav { display: none; }
.header-auth-controls { display: flex; align-items: center; gap: 15px; }
/* Các quy tắc hiển thị/ẩn nút login và profile */
#loginNav {
    display: flex;
    align-items: center;
    gap: 10px; 
    flex-wrap: nowrap; /* Đảm bảo các nút luôn ở trên một hàng */
}

.nav-button {
    /* Đảm bảo nút không bị co lại quá mức */
    flex-shrink: 0;
    white-space: nowrap; /* Ngăn chữ trong nút bị xuống dòng */
}
#profileNav {
    display: none;
    position: relative;
}
/* KHI ĐÃ ĐĂNG NHẬP: Dùng JavaScript để thêm class 'logged-in' vào thẻ header */
.header.logged-in #loginNav {
    display: none;
}
.header.logged-in #profileNav {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Thêm class này để hiện dropdown */
.user-profile-dropdown .dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    min-width: 160px;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    z-index: 100;
}
.user-profile-dropdown .dropdown-menu.show {
    display: block;
}
.user-profile-dropdown .dropdown-item {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: var(--dark-color);
    font-size: 14px;
}
.user-profile-dropdown .dropdown-item:hover {
    background-color: var(--light-color);
}

/* ======================== */
/* BANK CARD SECTION STYLE */
/* ======================== */

/* Container bao quanh mỗi thẻ */
.bank-card-wrapper {
    display: flex;
    justify-content: center;
    padding: 10px 0;
}

/* Các nút hành động của thẻ */
.card-actions,
.card-actions-back {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: 10px;
}

.btn {
    padding: 6px 12px;
    border: 1px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
}

.btn-primary {
    background-color: #007bff;
    color: #fff;
}

.btn-secondary {
    background-color: #6c757d;
    color: #fff;
}

/* Container lật thẻ */
.card-display-row {
    position: relative;
    width: 350px;
    height: 220px;

    transition: transform 0.8s;
    transform-style: preserve-3d;
}

/* Hiệu ứng lật thẻ khi hover */
.card-item:hover .card-display-row {
    transform: rotateY(180deg);
}

.bank-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 10px;
    backface-visibility: hidden;
    border-radius: 10px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    color: #fff;
    font-family: 'Courier New', Courier, monospace;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Định dạng riêng cho mặt trước thẻ */
.atm-card-front,
.visa-card-front,
.master-card-front {
    background: linear-gradient(135deg, #004d40, #009688);
    height: 100%;
}

.visa-card-front {
    background: linear-gradient(135deg, #1a237e, #3f51b5);
}

.master-card-front {
    background: linear-gradient(135deg, #088797, #a2d16d);
}

/* Định dạng riêng cho mặt sau thẻ */
.atm-card-back,
.visa-card-back,
.master-card-back {
    background: linear-gradient(135deg, #004d40, #009688);
    transform: rotateY(180deg);
    align-items: center;
    height: 100%;
    padding-top: 20px;
}

.visa-card-back {
    background: linear-gradient(135deg, #1a237e, #3f51b5);
}

.master-card-back {
    background: linear-gradient(135deg, #1a237e, #a7b901);
}
/* --- Bố cục mặt trước thẻ --- */
.card-top-elements {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.card-logo img {
    height: 36px;
}

.card-type p {
    margin: 0;
    font-size: 0.9rem;
    font-weight: bold;
}

.card-number {
    font-size: 1.2rem;
    letter-spacing: 1px;
    text-align: center;
    margin: 5px 0;
}

/* CHỈNH SỬA: Căn lề trái cho phần tử giữa */
.card-middle-elements {
    display: flex;
    justify-content: flex-start; /* Căn wrapper sang trái */
    padding-left: 10px; /* Thêm khoảng đệm từ lề */
}
.card-chip-container {
    display: flex;
    align-items: center; /* Căn giữa theo chiều dọc */
    gap: 8px; /* Khoảng cách giữa chip và biểu tượng */
}
.card-chip img {
    width: 32px;
    height: 25px;
    background-color: #b8a25c;
    border-radius: 5px;
   
}

.card-contactless-symbol img {
    width: 25px;
    height: 25px;
}

.card-holder {
    padding: 10px;
    width: 100%;
}

.card-holder label,
.card-details label {
    font-size: 0.6rem;
    opacity: 0.8;
    display: block;
    margin-bottom: 2px;
}

.card-holder span,
.card-details span {
    font-size: 0.8rem;
    font-weight: bold;
}

/* Thêm quy tắc CSS cho container mới ở dưới cùng */
.card-bottom-elements {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
    margin-top: auto;
}

/* Điều chỉnh các quy tắc cho card-details để căn trái */
.card-details {
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
    gap: 10px;
    width: auto;
    margin: auto;
}

/* Đảm bảo các label và span hiển thị trên cùng một dòng trong Flexbox */
.card-details > div {
    display: flex;
    flex-direction: column;    
}

/* Điều chỉnh lại .card-logo-container để phù hợp với bố cục mới */
.card-logo-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: auto;
    
}

.card-logo.visa-logo img,
.card-logo.atm-logo img {
    height: 55px;
}

.card-logo-back img {
    height: 32px;
}

/* --- Bố cục mặt sau thẻ --- */
.card-magnetic-stripe {
    width: calc(100% + 24px);
    height: 40px;
    background-color: #333;
    margin: -12px 0 15px 0;
}

.card-signature {
    text-align: left;
    width: 90%;
    margin-top: 5px;
}

.card-signature label {
    font-size: 0.6rem;
    opacity: 0.8;
}

.card-signature span {
    display: block;
    width: 100%;
    height: 35px;
    border-radius: 5px;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.card-cvv-strip {
    display: flex;
    align-items: center;
    width: 90%;
    margin-top: 10px;
}

.cvv-strip-line {
    flex-grow: 1;
    height: 25px;
    background-color: #fff;
    margin-right: 10px;
    border-radius: 4px;
}

.cvv-strip-text {
    background-color: #f0f0f0;
    color: #333;
    padding: 3px 8px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cvv-strip-text label {
    font-size: 0.5rem;
    margin: 0;
}

.cvv-strip-text span {
    font-size: 0.7rem;
    font-weight: bold;
    color: #333;
}

/* Hiệu ứng khi thẻ bị khóa */
.bank-card-wrapper .card-item.locked .bank-card::after {
    content: 'ĐÃ KHÓA';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-25deg);
    background: rgba(255, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 20px;
    z-index: 10;
    text-shadow: 1px 1px 2px black;
}
.bank-card-wrapper .card-item.locked .bank-card {
    filter: grayscale(100%);
    opacity: 0.7;
}

/* ======================== */
/* FOOTER STYLE             */
/* ======================== */
.footer-content {
    min-height: 50px;
    max-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--footer-background-color);
    color: #fff;

    position: relative;
    padding: 0 12px;
}

.footer-toggle-container {
    position: relative;
}

.toggle-btn {
    display: none;
}

.footer-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
}

.footer-nav ul li button {
    background: none;
    color: var(--light-color);
    padding: 1px 10px;
    margin: 0;
    border: none;
    cursor: pointer;
}

/* Quy tắc trên màn hình nhỏ */
@media (max-width: 500px) {
    
    .footer-content {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        z-index: 1000;
        justify-content: space-between;
        /* Loại bỏ overflow: hidden */
    }
    
    .toggle-btn {
        display: block;
        background: none;
        color: #fff;
        border: none;
        cursor: pointer;
        font-size: 1.5rem;
    }

    .footer-nav {
        /* Menu bị ẩn mặc định, không chiếm không gian */
        display: block;
        position: absolute;
        bottom: 50px;
        right: 0;
        background-color: #333;
        padding: 10px;
        border-radius: 5px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        z-index: 1000;
        width: 150px;

        /* Ẩn menu bằng cách đẩy xuống dưới và làm mờ */
        transform: translateY(100%);
        opacity: 0;
        pointer-events: none; /* Ngăn chặn click khi menu ẩn */
        transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    }

    .footer-nav ul {
        flex-direction: column;
        text-align: right;
    }

    .footer-nav ul li {
        width: 100%;
    }

    /* Khi nav có class active thì hiển thị menu */
    .footer-nav.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto; /* Cho phép click khi menu hiển thị */
    }
}

/* ============================================= */
/* MODAL - FORM - BUTTON VÀ CÁC THÀNH PHẦN KHÁC */
/* ============================================= */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    color: var(--dark-color);
    /* Bỏ padding và overflow tại đây */
    overflow-y: auto;
}

.modal.show {
    display: flex;
    align-items: center; /* Căn giữa dọc */
    justify-content: center; /* Căn giữa ngang */
    padding: 1rem;
}

.modal-dialog {
    position: relative;
    /* Loại bỏ margin: auto để tránh khoảng trống */
    margin: 0 auto; 
    width: 90%;
    max-width: 500px;
    color: #333;
    animation: fadeIn 0.3s ease-out;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
}

.modal-dialog.modal-xl {
    max-width: 90%;
}

.modal-content {
    background-color: var(--primary-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    flex: 1; /* Cho phép modal-content mở rộng */
}

.modal-header {
    background-color: #043e00;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
}

.modal-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.close-button {
    font-size: 2rem;
    font-weight: 300;
    color: var(--light-color);
    background-color: transparent;
    border: none;
    cursor: pointer;
    line-height: 1;
    padding: 0 5px;
    transition: color 0.2s ease;
}

.close-button:hover {
    color: var(--dark-color);
}

.modal-body {
    background-color: var(--light-color);
    padding: 10px 20px;
    /* Bỏ overflow-y: auto để nó không bị xung đột với modal-dialog */
    flex-grow: 1;
}

.modal-footer {
    background-color: #043e00;
    padding: 10px 20px;
    border-top: 1px solid var(--border-color);
    text-align: right;
    display: flex;
    justify-content: flex-end;
    gap: 20px;
}

/* --- Form --- */
.form-group {
    margin: 1rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.form-control {
    width: 100%;
    padding: 10px 12px;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--dark-color);
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    box-sizing: border-box;
}
.form-control:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}
textarea.form-control {
    resize: vertical;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    padding: 10px 20px;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 5px;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.btn:hover {
    filter: brightness(1.1); /* Hiệu ứng sáng hơn khi hover */
}
.btn-primary {
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}
.btn-secondary {
    color: var(--dark-color);
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}
.btn-block {
    display: block;
    width: 100%;
}
.btn-sm {
    padding: 5px 10px;
    font-size: 0.875rem;
}

/* --- Layout và Utilities --- */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -15px;
    margin-right: -15px;
}
.d-flex {
    display: flex;
}
.align-items-end {
    align-items: flex-end;
}
.text-center {
    text-align: center;
}
.lead {
    font-size: 1.25rem;
    font-weight: 300;
}
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mx-2 { margin-left: 1rem; margin-right: 1rem; }
.me-2 { margin-right: 1rem; }

/* --- Accordion --- */
.accordion {
    background-color: #eee;
    color: #444;
    cursor: pointer;
    padding: 18px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 1rem;
    transition: 0.4s;
    border-radius: 5px;
    margin-bottom: 5px;
    border: 1px solid var(--border-color);
}
.accordion.active, .accordion:hover {
    background-color: #ccc;
}
.panel {
    padding: 0 18px;
    background-color: var(--main-color);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 5px 5px;
    margin-bottom: 10px;
}
.panel .container {
    padding-top: 15px;
    padding-bottom: 15px;
}
/* --- Text thông báo --- */
.text-success {
    color: #28a745 !important;
}
.text-danger {
    color: #dc3545 !important;
}

/* --- Trạng thái và thông báo --- */
.status-icon {
    font-size: small;
    line-height: 1;
    margin-bottom: auto;
}
.status-icon.success::before {
    content: "✔️";
    color: var(--success-color);
    font-size: 3rem;
    display: block;
    text-align: center;
}
.status-icon.error::before {
    content: "❌";
    color: var(--danger-color);
    font-size: 3rem;
    display: block;
    text-align: center;
}
.status-icon.pending::before {
    content: "🕒";
    color: var(--warning-color);
    font-size: 3rem;
    display: block;
    text-align: center;
}
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 5px;
    display: none;
}
.alert.show {
    display: block;
}
/* Trạng thái và thông báo */
.alert-success {
    color: green; /* Màu chữ xanh đậm */
    background-color: #d4edda; /* Nền xanh nhạt, phù hợp với success */
    border-color: #c3e6cb;
}
.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* --- Responsive Layout --- */
/* Cải thiện cho màn hình nhỏ hơn 768px */
@media (max-width: 768px) {
    /* Hiệu chỉnh sidebar */
    .header {
        position: fixed;
    }
    .app-container {
        flex-direction: column;
    }
    .main-content {
        margin-left: 0;
        padding-top: calc(var(--header-height) + 20px);
    }
    .sidebar {
        width: 100%;
        position: fixed;
        top: var(--header-height);
        left: 0;
        height: calc(100vh - var(--header-height));
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }
    .sidebar.show {
        transform: translateX(0);
    }
}
/* Grid cho màn hình lớn hơn 768px */
@media (min-width: 768px) {
    .col-md-2 { flex: 0 0 auto; width: 16.666667%; }
    .col-md-3 { flex: 0 0 auto; width: 25%; }
    .col-md-4 { flex: 0 0 auto; width: 33.333333%; }
}


/* ======================== */
/* PROFILE SECTION STYLES */
/* ======================== */
#profileSection {
    padding: 20px;
}
.tab-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.tab-button {
    background-color: var(--light-color);
    border: 1px solid var(--border-color);
    color: var(--dark-color);
    padding: 10px 15px;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s, color 0.2s;
    flex-grow: 1;
    text-align: center;
}
.tab-button.active {
    background-color: var(--primary-color);
    border-bottom: 2px solid var(--header-color);
    color: var(--header-color);
    z-index: 1;
}
.tab-button:hover:not(.active) {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}
.tab-content {
    margin-top: 20px;
}
.tab-pane {
    display: none;
}
.tab-pane.active {
    display: block;
}

/* Các thành phần chung */
.card {
    background-color: var(--primary-color);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 20px;
    margin: auto;
}

/* ======================== */
/* ACCOUNT OVERVIEW TAB   */
/* ======================== */
.profile-account {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}
.profile-avatar {
    position: relative; /* Đã thêm để làm gốc định vị cho status-badge */
}

.profile-avatar .avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--header-color);
    object-fit: cover;
}
.status-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color); /* Đã thêm để làm nổi bật hơn */
}
.online-status {
    background-color: var(--success-color);
}
.profile-info {
    flex-grow: 1;
}
.profile-info p {
    margin: 5px 0;
    font-size: 0.9rem;
}
.profile-info strong {
    color: var(--secondary-color);
}
.profile-info .balance-item {
    padding: 10px;
    background-color: var(--bg-color);
    border-radius: 5px;
    margin-top: 10px;
}

/* ======================== */
/* BALANCE TAB            */
/* ======================== */
.balance-section {
    padding: 0;
}
.balance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}
.balance-item {
    background-color: var(--bg-color);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
}

.balance-item .label {
    font-size: 0.8rem;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.balance-item .value {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--dark-color);
}
.balance-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}
.btn {
    padding: 10px 15px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s, color 0.2s;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.btn-login {
    background-color: var(--btn-action-color);
    color: var(--primary-color);
}
.btn-otp {
    background-color: var(--btn-action-color);
    color: var(--primary-color);
}
.btn-primary {
    background-color: var(--btn-action-color);
    color: var(--primary-color);
}
.btn-secondary {
    background-color: var(--btn-action-color);
    color: var(--primary-color);
}
.btn-deposit {
    background-color: var(--success-color);
    color: var(--primary-color);
}
.btn-withdraw {
    background-color: var(--warning-color);
    color: var(--dark-color);
}
.btn-transfer {
    background-color: var(--info-color);
    color: var(--primary-color);
}
.btn:hover {
    opacity: 0.9;
}
.btn-block {
    width: 100%;
}

/* ======================== */
/* PROFILE DETAILS TAB    */
/* ======================== */
.profile-details {
    padding: 0;
}
.profile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 15px;
}
@media (min-width: 768px) {
    .profile-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
.profile-card {
    background-color: var(--bg-color);
    padding: 15px;
    border-radius: 8px;
}
.profile-card h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--header-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}
.profile-card p {
    margin: 5px 0;
    font-size: 0.9rem;
}
.profile-card strong {
    color: var(--secondary-color);
}
.profile-actions {
    margin-top: 20px;
    text-align: center;
}
.btn-edit-profile {
    background-color: var(--info-color);
    color: var(--primary-color);
}

/* ======================== */
/* TRANSACTIONS TAB       */
/* ======================== */
.transactions-section {
    padding: 0;
}
.transaction-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.transaction-list li {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.transaction-list li:last-child {
    border-bottom: none;
}

/* ========================================================== */
/* STYLE CHO TAB QR CODE */
/* ========================================================== */

/* Định dạng chung cho form và output */
#createQrCodeContainer,
#qrOutputContainer {
    max-width: 500px;
    margin: 20px auto;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

#createQrCodeContainer .form-group {
    margin-bottom: 15px;
    text-align: left;
}

#createQrCodeContainer label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

#createQrCodeContainer input.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
}

#qrOutputContainer h3 {
    text-align: center;
    color: #007bff;
    margin-top: 0;
}

#qrcodeCanvas {
    display: block;
    width: 200px;
    height: 200px;
    margin: 20px auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#qrOutputText {
    text-align: center;
    font-size: 0.9em;
    color: #777;
    word-wrap: break-word; /* Đảm bảo văn bản không tràn */
}

#downloadQrBtn {
    display: block;
    margin: 15px auto 0;
}

/* ========================================================== */
/* STYLE CHO KHUNG QUÉT VÀ HIỆU ỨNG           */
/* ========================================================== */

/* Lớp phủ cho video và khung quét */
.qr-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    pointer-events: none; /* Đảm bảo không chặn các sự kiện chuột */
}

/* Khung viền cho khung quét */
.qr-scanner-frame {
    width: 70%;
    height: 70%;
    border: 3px solid #00f081; /* Màu xanh lá cây nổi bật */
    box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.6); /* Lớp phủ mờ xung quanh */
    position: relative; /* Quan trọng để định vị tia quét */
    overflow: hidden; /* Đảm bảo tia quét không tràn ra ngoài */
}

/* Tia quét động */
.qr-scanner-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #00f081;
    animation: scan-line 2s infinite linear; /* Hiệu ứng tia quét di chuyển */
}

@keyframes scan-line {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(100%);
    }
}

/* ========================================================== */
/* QUẢN LÝ PHẦN TỬ QUÉT MÃ QR                       */
/* ========================================================== */

#qrcodeSection {
    padding: 20px;
    background-color: #f9f9f9;
    min-height: 80vh;
    display: none; /* Mặc định ẩn, sẽ hiển thị bằng JS */
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

#qrcodeSection.active {
    display: block;
    opacity: 1;
}

#qrcodeSection h2 {
    text-align: center;
    color: #333;
    margin-bottom: 25px;
    font-size: 1.8em;
    font-weight: 600;
}

.qr-scanner-container {
    max-width: 500px;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
    text-align: center;
    border: 1px solid #e0e0e0;
}

.qr-video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px 12px 0 0;
    transform: scaleX(-1); /* Lật ngang video để người dùng thấy hình ảnh phản chiếu */
}

.qr-result-container {
    padding: 15px;
    background-color: #fff;
    border-top: 1px solid #e0e0e0;
}

#qr-result {
    font-weight: bold;
    color: #007bff;
    font-size: 1.1em;
}

/* Kiểu cho các nút */
#qrcodeSection .btn-group {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

#qrcodeSection .btn {
    padding: 12px 25px;
    font-size: 1em;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#startScanBtn.btn-primary {
    background-color: #007bff;
    color: #fff;
}

#startScanBtn.btn-primary:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

#stopScanBtn.btn-secondary {
    background-color: #dc3545;
    color: #fff;
}

#stopScanBtn.btn-secondary:hover {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

/* Các lớp trạng thái */
.status-success {
    color: #28a745;
    font-weight: bold;
}

.status-error {
    color: #dc3545;
    font-weight: bold;
}

/* ======================== */
/* ACCORDION STYLES       */
/* ======================== */
.accordion {
    background-color: var(--primary-color);
    color: var(--dark-color);
    cursor: pointer;
    padding: 18px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 1rem;
    transition: 0.4s;
    font-weight: bold;
}
.accordion:after {
    content: '\25BC'; /* Biểu tượng mũi tên xuống */
    font-size: 1.2rem;
    color: #777;
    float: right;
    margin-left: 5px;
    transform: rotate(-90deg);
    transition: transform 0.4s ease;
}
.accordion.active:after {
    transform: rotate(0deg);
}
.panel {
    padding: 0 18px;
    background-color: var(--primary-color);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out;
}

/* ======================== */
/* Notification message Style */
/* ======================== */
.container-msg {
    display: flex;
    align-items: center; /* Căn chỉnh các phần tử theo chiều dọc */
    gap: 10px; /* Thêm khoảng cách giữa các phần tử */
}

.container-msg img {
    /* Đảm bảo hình ảnh không bị co dãn */
    flex-shrink: 0;
}

.container-msg p {
    flex-grow: 1; /* Cho phép thẻ p chiếm hết không gian còn lại */
    display: flex;
    justify-content: space-between; /* Đẩy "time-right" về phía cuối */
    align-items: center;
    margin: 0;
}

.container-msg .time-right {
    margin-left: 10px;
}

/* ========================================================== */
/* CSS PHẦN BẢO MẬT TÀI KHOẢN  */
/* ========================================================== */
.security-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.security-section li {
    margin-bottom: 10px;
}

.security-section li button {
    width: 100%;
    text-align: left;
    background-color: #f0f2f5;
    color: #333;
    font-size: 16px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.security-section li button:hover {
    background-color: #e9ecef;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}