body {
    margin: 0;
    background: var(--bg-page);
    color: var(--text-main);
	display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== HEADER ===== */
.header {
    height: 60px;
    background: var(--bg-panel);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    font-weight: bold;
    position: relative;
    z-index: 1000;
}

/* ===== LAYOUT ===== */
.main {
    display: flex;
    min-height: calc(100vh - 60px);
    align-items: stretch;
}

/* ===== MENU LEFT ===== */
.sidebar {
    width: 250px;
    background: var(--bg-panel);
    padding: 20px;
    border-right: 1px solid var(--border-main);
}

/* ===== CONTENT ===== */
.content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.menu-item {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    font-weight: 500;
}

.menu-item:hover {
    background: var(--bg-hover-menu);
}

/* ===== CARD ===== */
.card {
    background: var(--bg-panel);
    border: none;
    border-radius: 12px;
}

/* ===== LOGO ===== */
.logo img {
    height: 50px;
    object-fit: contain;
}

/* MOBILE */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -250px;
        top: 60px;
        height: 100%;
        transition: 0.3s;
        z-index: 999;
    }
    .sidebar.show {
        left: 0;
    }
}

/* ===== MODAL ===== */
.modal-custom {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--shadow-modal);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-box {
    background: var(--bg-panel);
    padding: 20px;
    border-radius: 12px;
    width: 300px;
}

/* submenu */
.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.01s ease;
    padding: 0;
    border: none;
    margin-bottom: 0;
}

.menu-item.active {
    background: var(--bg-hover-menu);
}

.submenu.show {
    max-height: 300px;
    background: var(--bg-deep);
    border: 1px solid var(--border-main);
    border-radius: 10px;
    padding: 8px;
    margin-bottom: 10px;
    box-shadow: 0 4px 15px var(--shadow-submenu);
}

.submenu-item {
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    background: var(--bg-deep);
    color: var(--text-muted);
    transition: 0.5s;
}

.submenu-item:hover {
    background: var(--bg-hover-menu);
    font-weight: 700;
}

.submenu-item.active {
    background: var(--bg-submenu-active);
}

.sidebar .menu-item.active {
    background: var(--bg-hover-menu) !important;
    border-left: 3px solid var(--border-active);
}

/* SweetAlert2 custom theme */
.swal2-popup {
    background: var(--bg-panel) !important;
    color: var(--text-main) !important;
}
.swal2-title {
    color: var(--text-main) !important;
}
.swal2-html-container {
    color: var(--text-muted) !important;
}

/* chạy thông báo */
.marquee-box {
    height: 28px;
    line-height: 28px;
    overflow: hidden;
    white-space: nowrap;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-main);
}

.marquee-text {
    display: inline-block;
    white-space: nowrap;
    animation: marquee 18s linear infinite;
    color: var(--color-info);
    font-weight: 600;
    font-size: 17px;
}

@keyframes marquee {
    0%   { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.marquee-box:hover .marquee-text {
    animation-play-state: paused;
}

/* header card */
.card-header {
    background: var(--bg-hover-menu);
    padding: 10px 15px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-main);
    color: var(--text-main);
    border-radius: 0;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

/* body */
.card-body {
    padding: 15px;
    color: var(--text-main);
    align-items: center;
}

.card {
    border-radius: 16px;
    overflow: hidden;
    border: 5px solid var(--border-main);
    height: 100%;
}

.card-body label {
    font-size: 13px;
    margin-top: 5px;
    margin-bottom: 2px;
    color: var(--text-label);
    width: 100%;
    text-align: left;
}

.card-body input,
.card-body select {
    width: 90%;
    height: 32px;
    font-size: 13px;
    padding: 4px 8px;
    background: var(--bg-deep) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-main) !important;
    border-radius: 8px;
}

.card-body input:focus,
.card-body select:focus {
    background: var(--bg-deep) !important;
    color: var(--text-main) !important;
    border-color: var(--border-focus) !important;
    box-shadow: none !important;
}

/* giá tiền */
.giatien {
    font-size: 16px;
    margin-top: 8px;
    text-align: center;
}

/* nút */
.card-body button {
    width: 90%;
    height: 34px;
    font-size: 14px;
    border-radius: 8px;
}

.card-body button:hover {
    transform: scale(1.03);
    transition: 0.2s;
}

.card-body select option {
    background: var(--bg-deep);
    color: var(--text-main);
}

input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px var(--bg-deep) inset !important;
    -webkit-text-fill-color: var(--text-main) !important;
}

/* ===== HISTORY CARD DARK ===== */
.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-main);
    background: var(--bg-panel);
    color: var(--text-muted);
    transition: 0.2s;
}

.history-item:hover {
    background: var(--bg-hover-dark);
}

.history-item .phone {
    font-weight: 600;
    color: var(--color-success);
}

.history-item .price {
    color: var(--color-danger);
    margin-left: 6px;
    font-weight: 600;
}

.history-item .sub {
    font-size: 12px;
    color: var(--text-sub);
}

.history-item .time {
    background: var(--bg-panel);
    color: var(--color-info-light);
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-main);
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--text-main);
    border-top: 2px solid transparent;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* BOX USER */
.user-box {
    position: relative;
    cursor: pointer;
}

.user-info {
    background: var(--bg-deep);
    padding: 6px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-main);
}

.user-dropdown {
    position: absolute;
    right: 0;
    top: 45px;
    background: var(--bg-panel);
    border: 1px solid var(--border-main);
    border-radius: 10px;
    width: 180px;
    display: none;
    z-index: 9999;
}

.user-item {
    padding: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
}

.user-item:hover {
    background: var(--bg-hover-menu);
}

.user-item.logout {
    color: var(--color-danger-alt);
}

.user-dropdown.show {
    display: block;
}

.group-row td {
    font-size: 14px;
    padding: 8px;
}

#customSearch {
    background: var(--bg-deep);
    color: var(--text-main);
    border: 1px solid var(--border-main);
}

@media (max-width: 768px){
    .logo{
        display: none !important;
    }
}

#pageLoader{
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 10px;
    background: var(--bg-loader-track);
    z-index: 999999;
    overflow: visible;
}

#pageLoaderBar{
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--loader-color-start), var(--loader-color-end));
    transition: width 0.25s ease;
}

#pageLoaderText{
    position: fixed;
    top: 8px;
    right: 10px;
    font-size: 12px;
    color: var(--text-main);
    background: rgba(15,23,42,0.85);
    padding: 2px 8px;
    border-radius: 6px;
    z-index: 1000000;
}

#donhangTable{
    background: var(--bg-table) !important;
    border-color: var(--border-table) !important;
    color: var(--text-light) !important;
    margin-bottom: 12px;
    max-width: 420px;
}

#donhangTable thead th{
    background: var(--bg-table-head) !important;
    color: var(--text-main) !important;
    border-color: var(--border-table-head) !important;
    font-weight: 600;
}

#donhangTable tbody td{
    background: var(--bg-table-row) !important;
    color: var(--text-light) !important;
    border-color: var(--border-table) !important;
}

#donhangTable tbody tr:hover td{
    background: var(--bg-table-hover) !important;
    cursor: pointer;
}

#proxyTable{
    width: 100%;
    background: var(--bg-table) !important;
    border-color: var(--border-table) !important;
    color: var(--text-light) !important;
}

.table-scroll-mobile{
    width: 100%;
}

#proxyTable td,
#proxyTable th{
    vertical-align: middle;
}

.col-inra{
    max-width: 0;
}

.cell-limit-inra{
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    max-width: 820px;
}

@media (max-width: 768px){
    .table-scroll-mobile{
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }
    #proxyTable{
        min-width: 900px;
    }
    .cell-limit-inra{
        max-width: 600px;
    }
    .table-scroll-mobile::-webkit-scrollbar{
        height: 8px;
    }
    .table-scroll-mobile::-webkit-scrollbar-thumb{
        background: var(--bg-hover-menu);
        border-radius: 10px;
    }
    .table-scroll-mobile::-webkit-scrollbar-track{
        background: var(--bg-page);
    }
}

@media (min-width: 769px){
    .cell-limit-inra{
        max-width: 820px;
    }
}

/* Sidebar kéo dài hết chiều cao — không để khoảng trắng */
.main {
    align-items: stretch;
}

.sidebar {
    min-height: 100%;
    height: auto;
}