/* ==========================================================================
   MPT-CRM V6.0 — HỆ THỐNG THIẾT KẾ CÔNG THÁI HỌC & WCAG 2.2 AA (100% ARIAL)
   Hỗ trợ Sáng / Tối đồng bộ (data-giao-dien="sang"|"toi", key: mpt_che_do_sang_toi)
   ========================================================================== */

:root,
html[data-giao-dien="sang"] {
    --nen-trang: #f4f6fa;
    --nen-the: #ffffff;
    --nen-phu: #f8fafc;
    --nen-noi-bat: #eef4ff;
    --nen-hover: #f1f5f9;
    --nen-thanh-ben: #0f172a;
    --nen-thanh-ben-hover: #1e293b;
    --chu-thanh-ben: #cbd5e1;
    --chu-thanh-ben-mo: #94a3b8;
    --vien-thanh-ben: rgba(255, 255, 255, 0.08);

    --chu-chinh: #0f172a;
    --chu-phu: #334155;
    --chu-mo: #5b6b80;
    --vien-chuan: #dde4ee;
    --vien-nhe: #e9eef5;
    --vien-dam: #cbd5e1;

    --chinh: #1d4ed8;
    --chinh-hover: #1e40af;
    --chinh-nhat: #eff6ff;
    --chinh-vien: #bfdbfe;

    --thanh-cong: #047857;
    --thanh-cong-nhat: #ecfdf5;
    --thanh-cong-vien: #a7f3d0;

    --canh-bao: #b45309;
    --canh-bao-nhat: #fffbeb;
    --canh-bao-vien: #fde68a;

    --nguy-hiem: #b91c1c;
    --nguy-hiem-nhat: #fef2f2;
    --nguy-hiem-vien: #fecaca;

    --tim: #6d28d9;
    --tim-nhat: #f5f3ff;
    --tim-vien: #ddd6fe;

    --bong-nhe: 0 1px 2px rgba(15, 23, 42, 0.05);
    --bong-the: 0 2px 8px rgba(15, 23, 42, 0.06);
    --bong-noi: 0 16px 36px rgba(15, 23, 42, 0.16);
    --bo-tron: 10px;
    --bo-tron-nho: 7px;
    --rong-thanh-ben: 228px;
    --cao-thanh-tren: 52px;
}

html[data-giao-dien="toi"] {
    --nen-trang: #0b1120;
    --nen-the: #111827;
    --nen-phu: #162032;
    --nen-noi-bat: #172554;
    --nen-hover: #1e293b;
    --nen-thanh-ben: #090e1a;
    --nen-thanh-ben-hover: #162033;
    --chu-thanh-ben: #e2e8f0;
    --chu-thanh-ben-mo: #94a3b8;
    --vien-thanh-ben: rgba(148, 163, 184, 0.14);

    --chu-chinh: #f1f5f9;
    --chu-phu: #cbd5e1;
    --chu-mo: #94a3b8;
    --vien-chuan: #263348;
    --vien-nhe: #1e293b;
    --vien-dam: #334155;

    --chinh: #60a5fa;
    --chinh-hover: #3b82f6;
    --chinh-nhat: rgba(59, 130, 246, 0.16);
    --chinh-vien: rgba(96, 165, 250, 0.35);

    --thanh-cong: #34d399;
    --thanh-cong-nhat: rgba(16, 185, 129, 0.15);
    --thanh-cong-vien: rgba(52, 211, 153, 0.35);

    --canh-bao: #fbbf24;
    --canh-bao-nhat: rgba(245, 158, 11, 0.15);
    --canh-bao-vien: rgba(251, 191, 36, 0.35);

    --nguy-hiem: #f87171;
    --nguy-hiem-nhat: rgba(239, 68, 68, 0.16);
    --nguy-hiem-vien: rgba(248, 113, 113, 0.36);

    --tim: #c084fc;
    --tim-nhat: rgba(139, 92, 246, 0.18);
    --tim-vien: rgba(192, 132, 252, 0.38);

    --bong-nhe: 0 1px 2px rgba(0, 0, 0, 0.3);
    --bong-the: 0 2px 10px rgba(0, 0, 0, 0.38);
    --bong-noi: 0 20px 44px rgba(0, 0, 0, 0.62);
}

/* 100% FONT ARIAL DUY NHẤT — KHÔNG DÙNG FONT PHỤ, KHÔNG DÙNG font-synthesis: none */
*,
*::before,
*::after,
html,
body,
input,
select,
textarea,
button,
code,
pre,
table,
th,
td {
    box-sizing: border-box;
    font-family: Arial !important;
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--nen-trang);
    color: var(--chu-chinh);
    font-size: 13.5px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body.thanh-ben-thu-gon {
    --rong-thanh-ben: 64px;
}

a {
    color: var(--chinh);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

code {
    background: var(--nen-phu);
    border: 1px solid var(--vien-chuan);
    border-radius: 5px;
    padding: 1px 6px;
    font-size: 12px;
    color: var(--chu-chinh);
    font-variant-numeric: tabular-nums;
}

.so-lieu,
.gia-tri-kpi,
.cot-so,
.tien-te,
.ma-id-kh {
    font-variant-numeric: tabular-nums;
}

.bieu-tuong-svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: inline-block;
    vertical-align: middle;
}

.bieu-tuong-svg.nho {
    width: 14px;
    height: 14px;
}

.bieu-tuong-svg.lon {
    width: 20px;
    height: 20px;
}

/* ==========================================================================
   MÀN HÌNH ĐĂNG NHẬP NỘI BỘ THỰC TẾ (0% AUTO-LOGIN CEO)
   ========================================================================== */
.lop-phu-dang-nhap {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: linear-gradient(135deg, #0b1224 0%, #172554 55%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.lop-phu-dang-nhap.an {
    display: none !important;
}

.the-dang-nhap {
    width: 100%;
    max-width: 420px;
    background: var(--nen-the);
    color: var(--chu-chinh);
    border: 1px solid var(--vien-chuan);
    border-radius: 14px;
    padding: 26px 24px;
    box-shadow: var(--bong-noi);
}

.dau-dang-nhap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.logo-dang-nhap {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: #ffffff;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dau-dang-nhap h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--chu-chinh);
}

.dau-dang-nhap p {
    margin: 3px 0 0;
    font-size: 12.5px;
    color: var(--chu-mo);
}

.khung-demo-dang-nhap {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--vien-chuan);
}

.loi-dang-nhap {
    background: var(--nguy-hiem-nhat);
    border: 1px solid var(--nguy-hiem-vien);
    color: var(--nguy-hiem);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12.5px;
    font-weight: 700;
    margin-bottom: 12px;
    display: none;
}

/* ==========================================================================
   BỐ CỤC CHÍNH: SIDEBAR THU GỌN ICON-RAIL (228px / 64px) + TOPBAR 1 HÀNG 52px
   ========================================================================== */
.khung-ung-dung {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.thanh-ben {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--rong-thanh-ben);
    background: var(--nen-thanh-ben);
    color: var(--chu-thanh-ben);
    border-right: 1px solid var(--vien-thanh-ben);
    display: flex;
    flex-direction: column;
    z-index: 300;
    transition: width 0.18s ease, transform 0.2s ease;
    overflow: hidden;
}

.logo-he-thong {
    height: var(--cao-thanh-tren);
    padding: 0 12px;
    border-bottom: 1px solid var(--vien-thanh-ben);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
}

.logo-thuong-hieu {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.huy-hieu-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ten-thuong-hieu {
    min-width: 0;
    overflow: hidden;
}

.ten-thuong-hieu h1 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
}

.ten-thuong-hieu p {
    margin: 1px 0 0;
    font-size: 11px;
    color: var(--chu-thanh-ben-mo);
    white-space: nowrap;
}

.nut-thu-gon-rail {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--vien-thanh-ben);
    background: transparent;
    color: var(--chu-thanh-ben);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nut-thu-gon-rail:hover {
    background: var(--nen-thanh-ben-hover);
    color: #ffffff;
}

.danh-sach-dieu-huong {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 8px 14px;
}

.nhom-dieu-huong {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--chu-thanh-ben-mo);
    padding: 10px 10px 4px;
    white-space: nowrap;
    overflow: hidden;
}

.muc-dieu-huong {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--chu-thanh-ben);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 400;
    text-align: left;
    margin-bottom: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
    white-space: nowrap;
}

.muc-dieu-huong:hover {
    background: var(--nen-thanh-ben-hover);
    border-color: rgba(148, 163, 184, 0.28);
    color: #ffffff;
}

.muc-dieu-huong.dang-chon {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-color: #60a5fa;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.36);
}

.muc-dieu-huong .nhan-menu {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.muc-dieu-huong .dem-menu {
    background: #dc2626;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
    padding: 1px 6px;
    min-width: 18px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.chan-thanh-ben {
    padding: 10px 10px;
    border-top: 1px solid var(--vien-thanh-ben);
    font-size: 11.5px;
    color: var(--chu-thanh-ben-mo);
}

/* Trạng thái Icon-Rail Thu gọn 64px */
body.thanh-ben-thu-gon .ten-thuong-hieu,
body.thanh-ben-thu-gon .nhom-dieu-huong,
body.thanh-ben-thu-gon .muc-dieu-huong .nhan-menu,
body.thanh-ben-thu-gon .chan-thanh-ben .chu-chan-rail {
    display: none;
}

body.thanh-ben-thu-gon .logo-he-thong {
    justify-content: center;
    padding: 0 6px;
}

body.thanh-ben-thu-gon .logo-thuong-hieu {
    display: none;
}

body.thanh-ben-thu-gon .muc-dieu-huong {
    justify-content: center;
    padding: 10px 0;
    position: relative;
}

body.thanh-ben-thu-gon .muc-dieu-huong .dem-menu {
    position: absolute;
    top: 3px;
    right: 6px;
    font-size: 9.5px;
    padding: 0 4px;
    min-width: 14px;
}

/* Vùng chính bên phải Sidebar */
.vung-chinh {
    flex: 1;
    margin-left: var(--rong-thanh-ben);
    min-width: 0;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.18s ease;
}

/* TOPBAR 1 HÀNG DUY NHẤT 52px — KHÔNG BAO GIỜ RỚT DÒNG TRÊN 1280px/1366px */
.thanh-tren {
    position: sticky;
    top: 0;
    z-index: 250;
    height: var(--cao-thanh-tren);
    background: var(--nen-the);
    border-bottom: 1px solid var(--vien-chuan);
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: nowrap;
}

.cum-trai-thanh-tren {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.nut-menu-di-dong {
    display: none;
    width: 34px;
    height: 34px;
    border-radius: 7px;
    border: 1px solid var(--vien-chuan);
    background: var(--nen-phu);
    color: var(--chu-chinh);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tieu-de-trang-tren {
    font-size: 15px;
    font-weight: 700;
    color: var(--chu-chinh);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.huy-hieu-pham-vi-tren {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--chinh);
    background: var(--chinh-nhat);
    border: 1px solid var(--chinh-vien);
    border-radius: 999px;
    padding: 2px 9px;
    white-space: nowrap;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cum-phai-thanh-tren {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
}

.nut-tim-toan-cuc {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 34px;
    padding: 0 11px;
    border-radius: 8px;
    border: 1px solid var(--vien-chuan);
    background: var(--nen-phu);
    color: var(--chu-mo);
    font-size: 12.5px;
    cursor: pointer;
    white-space: nowrap;
}

.nut-tim-toan-cuc:hover {
    border-color: var(--chinh);
    color: var(--chu-chinh);
}

.phim-tat-nho {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--chu-mo);
    background: var(--nen-the);
    border: 1px solid var(--vien-chuan);
    border-radius: 4px;
    padding: 1px 5px;
}

.nut-bieu-tuong {
    position: relative;
    height: 34px;
    min-width: 34px;
    padding: 0 8px;
    border-radius: 8px;
    border: 1px solid var(--vien-chuan);
    background: var(--nen-the);
    color: var(--chu-phu);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
}

.nut-bieu-tuong:hover {
    background: var(--nen-hover);
    color: var(--chu-chinh);
    border-color: var(--vien-dam);
}

.cham-dem-chuong {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: #dc2626;
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
}

.cham-dem-chuong.an {
    display: none;
}

.nut-ho-so-tren {
    height: 34px;
    padding: 0 9px 0 4px;
    border-radius: 999px;
    border: 1px solid var(--vien-chuan);
    background: var(--nen-phu);
    color: var(--chu-chinh);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 210px;
}

.nut-ho-so-tren:hover {
    border-color: var(--chinh);
}

.anh-dai-dien-chu {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: var(--chinh);
    color: #ffffff;
    font-size: 11.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ten-ho-so-tren {
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Popover Menu Hồ sơ & Chuông thông báo */
.bo-chua-popover {
    position: relative;
}

.hop-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 300px;
    background: var(--nen-the);
    border: 1px solid var(--vien-chuan);
    border-radius: 11px;
    box-shadow: var(--bong-noi);
    z-index: 600;
    padding: 8px;
}

.hop-popover.rong {
    width: 360px;
    max-height: 460px;
    overflow-y: auto;
}

.hop-popover.an {
    display: none;
}

.dau-popover {
    padding: 8px 10px;
    border-bottom: 1px solid var(--vien-nhe);
    margin-bottom: 6px;
}

.muc-popover {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--chu-chinh);
    padding: 8px 10px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    cursor: pointer;
    text-align: left;
}

.muc-popover:hover {
    background: var(--nen-hover);
}

.muc-popover.nguy-hiem {
    color: var(--nguy-hiem);
}

.ngan-cach-popover {
    height: 1px;
    background: var(--vien-nhe);
    margin: 6px 0;
}

/* Vùng nội dung chính */
.vung-noi-dung {
    padding: 12px 16px 24px;
    flex: 1;
    min-width: 0;
}

.khung-man-hinh {
    animation: hienNhe 0.14s ease;
}

@keyframes hienNhe {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

/* Thanh cảnh báo gọn đầu trang (nếu thiếu Đối tượng / Quá hạn >24h) */
.dai-canh-bao-gon {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px 11px;
    margin-bottom: 8px;
    border-radius: 8px;
    background: var(--canh-bao-nhat);
    border: 1px solid var(--canh-bao-vien);
    color: var(--canh-bao);
    font-size: 12.5px;
    font-weight: 700;
}

/* ==========================================================================
   THÀNH PHẦN GIAO DIỆN CHUẨN: NÚT, THẺ, BẢNG, FORM, HUY HIỆU
   ========================================================================== */
.dau-man-hinh {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.dau-man-hinh h2 {
    margin: 0;
    font-size: 16.5px;
    font-weight: 700;
    color: var(--chu-chinh);
    display: flex;
    align-items: center;
    gap: 8px;
}

.dau-man-hinh p {
    margin: 2px 0 0;
    font-size: 12.5px;
    color: var(--chu-mo);
}

.cum-hanh-dong-dau {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.nut {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px;
    border-radius: var(--bo-tron-nho);
    border: 1px solid var(--vien-dam);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.14);
    transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease, transform 0.1s ease;
    white-space: nowrap;
    text-decoration: none;
}

.nut:hover:not(:disabled) {
    box-shadow: 0 3px 7px rgba(15, 23, 42, 0.15);
    transform: translateY(-0.5px);
    text-decoration: none;
}

.nut:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.nut:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.nut-chinh {
    background: #1d4ed8;
    color: #ffffff;
    border-color: #1e40af;
    box-shadow: 0 2px 5px rgba(29, 78, 216, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.nut-chinh:hover:not(:disabled) {
    background: #1e40af;
    border-color: #1e3a8a;
    color: #ffffff;
}

.nut-xanh-la {
    background: #047857;
    color: #ffffff;
    border-color: #065f46;
    box-shadow: 0 2px 5px rgba(4, 120, 87, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.nut-xanh-la:hover:not(:disabled) {
    background: #065f46;
    color: #ffffff;
}

.nut-canh-bao {
    background: #b45309;
    color: #ffffff;
    border-color: #92400e;
    box-shadow: 0 2px 5px rgba(180, 83, 9, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.nut-canh-bao:hover:not(:disabled) {
    background: #92400e;
    color: #ffffff;
}

.nut-nguy-hiem {
    background: #b91c1c;
    color: #ffffff;
    border-color: #991b1b;
    box-shadow: 0 2px 5px rgba(185, 28, 28, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.nut-nguy-hiem:hover:not(:disabled) {
    background: #991b1b;
    color: #ffffff;
}

.nut-tim {
    background: #6d28d9;
    color: #ffffff;
    border-color: #5b21b6;
    box-shadow: 0 2px 5px rgba(109, 40, 217, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.nut-tim:hover:not(:disabled) {
    background: #5b21b6;
    color: #ffffff;
}

.nut-vien {
    background: var(--nen-the);
    color: var(--chu-chinh);
    border-color: var(--vien-dam);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.nut-vien:hover:not(:disabled) {
    background: var(--chinh-nhat);
    border-color: var(--chinh);
    color: var(--chinh);
}

.nut-vien.dang-chon {
    background: #1d4ed8;
    color: #ffffff;
    border-color: #1e40af;
    box-shadow: 0 2px 6px rgba(29, 78, 216, 0.3);
}

.nut-vien.dang-chon:hover:not(:disabled) {
    background: #1e40af;
    color: #ffffff;
}

.nut-nho {
    height: 29px;
    padding: 0 9px;
    font-size: 12px;
}

.nut-rat-nho {
    height: 26px;
    padding: 0 7px;
    font-size: 11.5px;
}

.the-noi-dung {
    background: var(--nen-the);
    border: 1px solid var(--vien-chuan);
    border-radius: var(--bo-tron);
    padding: 13px 14px;
    margin-bottom: 12px;
    box-shadow: var(--bong-nhe);
}

.tieu-de-the {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 14px;
    font-weight: 700;
    color: var(--chu-chinh);
    margin-bottom: 10px;
}

.luoi-kpi {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.the-kpi {
    background: var(--nen-the);
    border: 1px solid var(--vien-chuan);
    border-radius: var(--bo-tron);
    padding: 12px 14px;
    box-shadow: var(--bong-nhe);
    border-left: 3px solid var(--chinh);
}

.the-kpi.xanh-la { border-left-color: var(--thanh-cong); }
.the-kpi.canh-bao { border-left-color: var(--canh-bao); }
.the-kpi.nguy-hiem { border-left-color: var(--nguy-hiem); }
.the-kpi.tim { border-left-color: var(--tim); }

.nhan-kpi {
    font-size: 12px;
    color: var(--chu-mo);
    font-weight: 700;
}

.gia-tri-kpi {
    font-size: 21px;
    font-weight: 700;
    color: var(--chu-chinh);
    margin: 4px 0 2px;
    font-variant-numeric: tabular-nums;
}

.phu-chu-kpi {
    font-size: 11.5px;
    color: var(--chu-mo);
}

.luoi-2-cot {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.luoi-3-cot {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

/* Tabs phụ chuẩn — Có viền nổi & bóng đổ nhẹ rõ ràng như nút chức năng thật */
.thanh-the-phu {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    background: var(--nen-phu);
    border: 1px solid var(--vien-chuan);
    border-radius: 9px;
    padding: 5px;
    margin-bottom: 12px;
    box-shadow: var(--bong-nhe);
}

.nut-the-phu {
    border: 1px solid var(--vien-dam);
    background: var(--nen-the);
    color: var(--chu-phu);
    padding: 6px 12px;
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.07);
    transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease, transform 0.1s ease;
}

.nut-the-phu:hover {
    background: var(--chinh-nhat);
    border-color: var(--chinh);
    color: var(--chinh);
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.11);
    transform: translateY(-0.5px);
}

.nut-the-phu.dang-chon {
    background: #1d4ed8;
    color: #ffffff;
    border-color: #1e40af;
    box-shadow: 0 2px 6px rgba(29, 78, 216, 0.3);
}

/* ==========================================================================
   MÀN HÌNH KHÁCH HÀNG & TƯ VẤN: THANH CÔNG CỤ 2 TẦNG GỌN (~94px)
   ĐẢM BẢO DÒNG KHÁCH HÀNG #1 XUẤT HIỆN NGAY TỪ y <= 195px TRÊN 1366x768!
   ========================================================================== */
.thanh-cong-cu-khach-hang {
    background: var(--nen-the);
    border: 1px solid var(--vien-chuan);
    border-radius: var(--bo-tron);
    padding: 8px 10px;
    margin-bottom: 8px;
    box-shadow: var(--bong-nhe);
}

.tang-1-khach-hang {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    padding-bottom: 7px;
    border-bottom: 1px solid var(--vien-nhe);
}

.thanh-chu-trinh-khach {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.nut-chu-trinh {
    border: 1px solid var(--vien-dam);
    background: var(--nen-the);
    color: var(--chu-phu);
    height: 31px;
    padding: 0 11px;
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.nut-chu-trinh:hover {
    background: var(--chinh-nhat);
    border-color: var(--chinh);
    color: var(--chinh);
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.12);
}

.nut-chu-trinh.dang-chon {
    background: #1d4ed8;
    color: #ffffff;
    border-color: #1e40af;
    box-shadow: 0 2px 6px rgba(29, 78, 216, 0.3);
}

.nut-chu-trinh.canh-bao-dt {
    color: var(--canh-bao);
    border-color: var(--canh-bao-vien);
    background: var(--canh-bao-nhat);
}

.nut-chu-trinh.canh-bao-dt.dang-chon {
    background: #b45309;
    color: #ffffff;
    border-color: #b45309;
}

.nut-chu-trinh .dem-so {
    font-size: 11px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.1);
    font-variant-numeric: tabular-nums;
}

.nut-chu-trinh.dang-chon .dem-so {
    background: rgba(255, 255, 255, 0.24);
    color: #ffffff;
}

.tang-2-khach-hang {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    padding-top: 6px;
}

.tang-2-khach-hang input[type="text"],
.tang-2-khach-hang select {
    height: 30px;
    padding: 0 8px;
    font-size: 12px;
    width: auto;
    min-width: 112px;
    max-width: 175px;
}

.tang-2-khach-hang .o-tim-khach {
    flex: 1 1 160px;
    min-width: 150px;
    max-width: 230px;
}

.noi-dung-cai-dat,
.khung-noi-dung-cai-dat {
    min-width: 0;
    overflow-x: auto;
}

/* Hộp Nhập nhanh 1 dòng (mặc định thu gọn, Alt+N mở, hỗ trợ Ghim) */
.khung-nhap-nhanh-thu-gon {
    background: var(--nen-phu);
    border: 1px solid var(--chinh-vien);
    border-radius: 9px;
    padding: 9px 11px;
    margin-bottom: 8px;
}

.khung-nhap-nhanh-thu-gon.an {
    display: none;
}

.luoi-nhap-nhanh-1-dong {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr 1fr 1fr 1fr auto;
    gap: 7px;
    align-items: center;
}

/* ==========================================================================
   BẢNG DỮ LIỆU CHUẨN: STICKY HEADER + CHẾ ĐỘ GỌN 44px + PHÂN TRANG SQL
   ========================================================================== */
.khung-bang {
    width: 100%;
    overflow-x: auto;
}

.khung-bang-cuon {
    max-height: calc(100vh - 210px);
    overflow: auto;
    border: 1px solid var(--vien-chuan);
    border-radius: var(--bo-tron);
    background: var(--nen-the);
}

table.bang-chuan {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    color: var(--chu-chinh);
}

table.bang-chuan thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--nen-phu);
    color: var(--chu-phu);
    font-weight: 700;
    font-size: 12px;
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--vien-chuan);
    white-space: nowrap;
}

table.bang-chuan tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--vien-nhe);
    vertical-align: middle;
    color: var(--chu-chinh);
}

table.bang-chuan.che-do-gon tbody td {
    padding: 5px 9px;
    font-size: 12.5px;
}

table.bang-chuan tbody tr:hover {
    background: var(--nen-hover);
}

table.bang-chuan tbody tr.dong-chon {
    background: var(--chinh-nhat);
}

table.bang-chuan tbody tr.dong-da-chot {
    border-left: 3px solid var(--thanh-cong);
}

.thanh-phan-trang {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px 12px;
    background: var(--nen-the);
    border: 1px solid var(--vien-chuan);
    border-top: 0;
    border-radius: 0 0 var(--bo-tron) var(--bo-tron);
    font-size: 12.5px;
    color: var(--chu-phu);
}

.cum-nut-phan-trang {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Huy hiệu & Thẻ Đối tượng tĩnh sạch (KHÔNG rung animation!) */
.huy-hieu {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.35;
    white-space: nowrap;
}

.hh-xanh-duong { background: var(--chinh-nhat); color: var(--chinh); border: 1px solid var(--chinh-vien); }
.hh-xanh-la    { background: var(--thanh-cong-nhat); color: var(--thanh-cong); border: 1px solid var(--thanh-cong-vien); }
.hh-canh-bao   { background: var(--canh-bao-nhat); color: var(--canh-bao); border: 1px solid var(--canh-bao-vien); }
.hh-do         { background: var(--nguy-hiem-nhat); color: var(--nguy-hiem); border: 1px solid var(--nguy-hiem-vien); }
.hh-tim        { background: var(--tim-nhat); color: var(--tim); border: 1px solid var(--tim-vien); }
.hh-xam        { background: var(--nen-phu); color: var(--chu-mo); border: 1px solid var(--vien-chuan); }

.the-doi-tuong-khach {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid var(--chinh-vien);
    background: var(--chinh-nhat);
    color: var(--chinh);
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.the-doi-tuong-khach.chua-chon {
    background: var(--canh-bao-nhat);
    border-color: var(--canh-bao-vien);
    color: var(--canh-bao);
}

.the-doi-tuong-khach.lao-dong {
    background: var(--tim-nhat);
    border-color: var(--tim-vien);
    color: var(--tim);
}

.the-doi-tuong-khach.thuc-tap {
    background: var(--thanh-cong-nhat);
    border-color: var(--thanh-cong-vien);
    color: var(--thanh-cong);
}

/* Semantic helper classes (thay thế inline hex color lỗi Dark Mode) */
.chu-mo { color: var(--chu-mo); }
.chu-phu { color: var(--chu-phu); }
.chu-chinh { color: var(--chu-chinh); }
.chu-xanh-la { color: var(--thanh-cong); }
.chu-do { color: var(--nguy-hiem); }
.chu-canh-bao { color: var(--canh-bao); }
.chu-xanh-duong { color: var(--chinh); }
.chu-tim { color: var(--tim); }
.hop-thong-tin-nhe {
    background: var(--nen-phu);
    border: 1px solid var(--vien-chuan);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--chu-chinh);
}
.hop-canh-bao-nhe {
    background: var(--canh-bao-nhat);
    border: 1px solid var(--canh-bao-vien);
    border-radius: 8px;
    padding: 9px 12px;
    color: var(--canh-bao);
}
.hop-thanh-cong-nhe {
    background: var(--thanh-cong-nhat);
    border: 1px solid var(--thanh-cong-vien);
    border-radius: 8px;
    padding: 9px 12px;
    color: var(--thanh-cong);
}
.hop-chinh-nhe {
    background: var(--chinh-nhat);
    border: 1px solid var(--chinh-vien);
    border-radius: 8px;
    padding: 9px 12px;
    color: var(--chu-chinh);
}

/* ==========================================================================
   FORM & INPUTS CHUẨN CÔNG THÁI HỌC
   ========================================================================== */
.dong-nhap-lieu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.nhan-o-nhap {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--chu-phu);
    margin-bottom: 4px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="email"],
input[type="url"],
select,
textarea {
    width: 100%;
    padding: 7px 10px;
    border-radius: 7px;
    border: 1px solid var(--vien-chuan);
    background: var(--nen-the);
    color: var(--chu-chinh);
    font-size: 13px;
    outline: none;
    transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--chinh);
    box-shadow: 0 0 0 2px var(--chinh-nhat);
}

input::placeholder,
textarea::placeholder {
    color: var(--chu-mo);
}

/* ==========================================================================
   KHÔNG GIAN LÀM VIỆC KHÁCH HÀNG THỐNG NHẤT (UNIFIED RIGHT WORKSPACE DRAWER)
   ========================================================================== */
.lop-phu-khong-gian {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(15, 23, 42, 0.52);
    display: flex;
    justify-content: flex-end;
}

.lop-phu-khong-gian.an {
    display: none !important;
}

.ngan-khong-gian-chinh {
    width: min(980px, 94vw);
    max-width: 100vw;
    height: 100vh;
    background: var(--nen-the);
    color: var(--chu-chinh);
    border-left: 1px solid var(--vien-chuan);
    box-shadow: var(--bong-noi);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dau-khong-gian {
    padding: 10px 16px;
    border-bottom: 1px solid var(--vien-chuan);
    background: var(--nen-phu);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.thong-tin-khach-dau {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.thong-tin-khach-dau h3 {
    margin: 0;
    font-size: 15.5px;
    font-weight: 700;
    color: var(--chu-chinh);
}

.thanh-tab-di-dong-kg {
    display: none;
    padding: 6px 12px;
    border-bottom: 1px solid var(--vien-chuan);
    background: var(--nen-the);
    gap: 6px;
}

.than-khong-gian-2-cot {
    flex: 1;
    display: grid;
    grid-template-columns: 44% 56%;
    min-height: 0;
    overflow: hidden;
}

.cot-trai-tac-nghiep {
    border-right: 1px solid var(--vien-chuan);
    padding: 13px 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cot-phai-chi-tiet {
    padding: 12px 14px;
    overflow-y: auto;
    background: var(--nen-phu);
}

.chan-khong-gian-dinh {
    padding: 9px 16px;
    border-top: 1px solid var(--vien-chuan);
    background: var(--nen-the);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* Thẻ chạm 1-click & Dòng thời gian */
.dai-nut-mot-cham {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.the-cham {
    border: 1px solid var(--vien-dam);
    background: var(--nen-the);
    color: var(--chu-phu);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.07);
    transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.the-cham:hover {
    border-color: var(--chinh);
    background: var(--chinh-nhat);
    color: var(--chinh);
}

.the-cham.dang-chon {
    background: #1d4ed8;
    border-color: #1e40af;
    color: #ffffff;
    box-shadow: 0 2px 5px rgba(29, 78, 216, 0.28);
}

.moc-dong-thoi-gian {
    background: var(--nen-the);
    border: 1px solid var(--vien-chuan);
    border-left: 3px solid var(--chinh);
    border-radius: 8px;
    padding: 8px 11px;
    margin-bottom: 8px;
}

/* ==========================================================================
   KANBAN KÉO-THẢ (DRAG & DROP)
   ========================================================================== */
.bang-kanban {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
    gap: 10px;
    align-items: start;
}

.cot-kanban {
    background: var(--nen-phu);
    border: 1px solid var(--vien-chuan);
    border-radius: var(--bo-tron);
    padding: 9px;
    min-height: 360px;
    transition: border-color 0.14s ease, background 0.14s ease;
}

.cot-kanban.dang-keo-qua {
    border: 2px dashed var(--chinh);
    background: var(--chinh-nhat);
}

.dau-cot-kanban {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 13px;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--vien-chuan);
}

.the-kanban {
    background: var(--nen-the);
    border: 1px solid var(--vien-chuan);
    border-radius: 8px;
    padding: 9px 10px;
    margin-bottom: 8px;
    cursor: grab;
    box-shadow: var(--bong-nhe);
}

.the-kanban:active {
    cursor: grabbing;
}

.the-kanban.dang-keo {
    opacity: 0.55;
    border-color: var(--chinh);
}

/* ==========================================================================
   BỐ CỤC CẤU HÌNH HỆ THỐNG 2 CỘT (220px TRÁI + NỘI DUNG PHẢI)
   ========================================================================== */
.bo-cuc-cau-hinh-2-cot {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.thanh-chon-cau-hinh {
    background: var(--nen-the);
    border: 1px solid var(--vien-chuan);
    border-radius: var(--bo-tron);
    padding: 8px;
    position: sticky;
    top: calc(var(--cao-thanh-tren) + 12px);
    box-shadow: var(--bong-the);
}

.nut-muc-cau-hinh {
    width: 100%;
    border: 1px solid var(--vien-chuan);
    background: var(--nen-phu);
    color: var(--chu-phu);
    padding: 8px 10px;
    border-radius: 7px;
    font-size: 12.8px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
    margin-bottom: 5px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.nut-muc-cau-hinh:last-child {
    margin-bottom: 0;
}

.nut-muc-cau-hinh:hover {
    background: var(--chinh-nhat);
    border-color: var(--chinh);
    color: var(--chinh);
}

.nut-muc-cau-hinh.dang-chon {
    background: #1d4ed8;
    border-color: #1e40af;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(29, 78, 216, 0.28);
}

/* ==========================================================================
   MODAL, NGĂN KÉO PHỤ, TOAST GÓC PHẢI DƯỚI & GỢI Ý @NHÂN SỰ
   ========================================================================== */
.lop-phu-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.54);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
}

.lop-phu-modal.an {
    display: none !important;
}

.hop-modal {
    width: 100%;
    max-width: 660px;
    max-height: 90vh;
    background: var(--nen-the);
    color: var(--chu-chinh);
    border: 1px solid var(--vien-chuan);
    border-radius: 12px;
    box-shadow: var(--bong-noi);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dau-modal {
    padding: 12px 16px;
    border-bottom: 1px solid var(--vien-chuan);
    background: var(--nen-phu);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.dau-modal h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--chu-chinh);
}

.than-modal {
    padding: 14px 16px;
    overflow-y: auto;
    flex: 1;
}

.chan-modal {
    padding: 10px 16px;
    border-top: 1px solid var(--vien-chuan);
    background: var(--nen-phu);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

/* Toast thông báo góc phải dưới (không che Topbar) */
#khu-vuc-thong-bao-nhanh,
.khung-toast-goc-duoi {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1500;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}

.the-toast-nhanh,
.the-bao-dong-noi {
    pointer-events: auto;
    background: var(--nen-the);
    color: var(--chu-chinh);
    border: 1px solid var(--vien-chuan);
    border-left: 4px solid var(--chinh);
    border-radius: 9px;
    padding: 10px 13px;
    box-shadow: var(--bong-noi);
    font-size: 13px;
}

.hop-goi-y-at {
    position: fixed;
    z-index: 1600;
    min-width: 240px;
    max-width: 340px;
    max-height: 240px;
    overflow-y: auto;
    background: var(--nen-the);
    border: 1px solid var(--vien-chuan);
    border-radius: 9px;
    box-shadow: var(--bong-noi);
    padding: 4px;
}

.muc-goi-y-at {
    padding: 7px 9px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12.5px;
    color: var(--chu-chinh);
}

.muc-goi-y-at:hover,
.muc-goi-y-at.dang-chon {
    background: var(--chinh-nhat);
    color: var(--chinh);
}

.lop-phu-menu-di-dong {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 290;
    background: rgba(15, 23, 42, 0.45);
}

.lop-phu-menu-di-dong.hien {
    display: block;
}

/* ==========================================================================
   RESPONSIVE: < 1280px (1 CỘT 3 TAB TRONG DRAWER) & < 768px (MOBILE DARK FIX)
   ========================================================================== */
@media (max-width: 1279px) {
    .ngan-khong-gian-chinh {
        width: min(700px, 96vw);
    }

    .thanh-tab-di-dong-kg {
        display: flex;
    }

    .than-khong-gian-2-cot {
        display: block;
        overflow-y: auto;
    }

    .cot-trai-tac-nghiep,
    .cot-phai-chi-tiet {
        border-right: 0;
        overflow-y: visible;
    }

    .than-khong-gian-2-cot[data-tab-hien-tai="tac-nghiep"] .cot-phai-chi-tiet { display: none; }
    .than-khong-gian-2-cot[data-tab-hien-tai="lich-su"] .cot-trai-tac-nghiep { display: none; }
    .than-khong-gian-2-cot[data-tab-hien-tai="ho-so-360"] .cot-trai-tac-nghiep { display: none; }

    .luoi-nhap-nhanh-1-dong {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 960px) {
    .thanh-ben {
        transform: translateX(-100%);
        width: 248px !important;
    }

    .thanh-ben.mo-di-dong {
        transform: translateX(0);
    }

    .vung-chinh {
        margin-left: 0 !important;
    }

    .nut-menu-di-dong {
        display: inline-flex;
    }

    .nut-thu-gon-rail {
        display: none;
    }

    .bo-cuc-cau-hinh-2-cot,
    .luoi-2-cot,
    .luoi-3-cot {
        grid-template-columns: 1fr;
    }

    .huy-hieu-pham-vi-tren {
        display: none;
    }
}

@media (max-width: 768px) {
    .vung-noi-dung {
        padding: 10px 10px 24px;
    }

    .thanh-tren {
        padding: 0 10px;
    }

    .nut-tim-toan-cuc .chu-tim-nhanh,
    .nut-tim-toan-cuc .phim-tat-nho,
    .ten-ho-so-tren {
        display: none;
    }

    .luoi-nhap-nhanh-1-dong {
        grid-template-columns: 1fr;
    }

    .khung-bang-cuon {
        max-height: none;
        border: 0;
        background: transparent;
    }

    /* KHẮC PHỤC TRIỆT ĐỂ LỖI CHỮ TRẮNG TRÊN NỀN TRẮNG MOBILE DARK MODE! */
    table.bang-chuan thead {
        display: none;
    }

    table.bang-chuan,
    table.bang-chuan tbody,
    table.bang-chuan tr,
    table.bang-chuan td {
        display: block;
        width: 100%;
    }

    table.bang-chuan tbody tr {
        background: var(--nen-the) !important;
        color: var(--chu-chinh) !important;
        border: 1px solid var(--vien-chuan);
        border-radius: 10px;
        padding: 10px 11px;
        margin-bottom: 9px;
        box-shadow: var(--bong-nhe);
    }

    table.bang-chuan tbody td {
        border: 0;
        padding: 4px 0;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 10px;
        text-align: right;
    }

    table.bang-chuan tbody td::before {
        content: attr(data-nhan);
        font-weight: 700;
        color: var(--chu-mo);
        text-align: left;
        flex-shrink: 0;
        font-size: 12px;
    }

    table.bang-chuan tbody td:first-child {
        display: block;
        text-align: left;
        border-bottom: 1px solid var(--vien-nhe);
        padding-bottom: 6px;
        margin-bottom: 4px;
    }

    table.bang-chuan tbody td:first-child::before {
        display: none;
    }
}

/* ==========================================================================
   TƯƠNG THÍCH NGƯỢC & THÀNH PHẦN PHỤ TRỢ (BOT, TOOLTIP, MOBILE BOTTOM BAR)
   ========================================================================== */
.luoi-4-cot {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.the-chi-so {
    background: var(--nen-the);
    border: 1px solid var(--vien-chuan);
    border-left: 3px solid var(--chinh);
    border-radius: var(--bo-tron);
    padding: 12px 14px;
    box-shadow: var(--bong-nhe);
}

.the-chi-so .nhan {
    font-size: 12px;
    color: var(--chu-mo);
    font-weight: 700;
}

.the-chi-so .gia-tri {
    font-size: 20px;
    font-weight: 700;
    color: var(--chu-chinh);
    margin: 4px 0 2px;
    font-variant-numeric: tabular-nums;
}

.the-chi-so .phu {
    font-size: 11.5px;
    color: var(--chu-mo);
}

.the-chi-so.xanh-la { border-left-color: var(--thanh-cong); }
.the-chi-so.canh-bao { border-left-color: var(--canh-bao); }
.the-chi-so.do { border-left-color: var(--nguy-hiem); }
.the-chi-so.tim { border-left-color: var(--tim); }

.nut-zalo-nhanh {
    background: #0068ff;
    color: #ffffff;
    border-color: #0068ff;
}

.nut-zalo-nhanh:hover {
    background: #0052cc;
}

.thanh-dieu-phoi-hang-loat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    background: var(--tim-nhat);
    border: 1px solid var(--tim-vien);
    color: var(--chu-chinh);
    font-size: 12.5px;
}

.thanh-dieu-phoi-hang-loat.an {
    display: none;
}

.the-mau-landing-ctv {
    background: var(--nen-phu);
    border: 1px solid var(--vien-chuan);
    border-radius: 9px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.luoi-don-hang-quan-tri {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 10px;
}

.khung-dien-thoai-bot {
    position: fixed;
    right: 16px;
    bottom: 66px;
    width: min(370px, calc(100vw - 24px));
    height: 490px;
    background: var(--nen-the);
    color: var(--chu-chinh);
    border: 1px solid var(--vien-chuan);
    border-radius: 12px;
    box-shadow: var(--bong-noi);
    z-index: 950;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.khung-dien-thoai-bot.an {
    display: none;
}

.dau-bot-tele {
    background: #1d4ed8;
    color: #ffffff;
    padding: 10px 12px;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.danh-sach-tin-bot {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background: var(--nen-phu);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chan-bot-tele {
    padding: 8px;
    border-top: 1px solid var(--vien-chuan);
    background: var(--nen-the);
    display: flex;
    gap: 6px;
}

#hop-thong-bao-nhanh {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1600;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: min(390px, calc(100vw - 32px));
    pointer-events: none;
}

#khung-bao-dong-noi {
    position: fixed;
    right: 16px;
    bottom: 72px;
    z-index: 1550;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: min(370px, calc(100vw - 32px));
    pointer-events: none;
}

#hop-chu-thich-thong-minh {
    position: fixed;
    z-index: 2500;
    max-width: 345px;
    background: #0f172a;
    color: #f8fafc;
    border: 1px solid #475569;
    border-radius: 8px;
    padding: 9px 12px;
    font-family: Arial;
    font-size: 12.2px;
    line-height: 1.48;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.38);
    pointer-events: none;
    display: none;
}

[data-giao-dien="toi"] #hop-chu-thich-thong-minh {
    background: #1e293b;
    border-color: #60a5fa;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65);
}

#hop-chu-thich-thong-minh.dang-hien {
    display: block;
}

.dau-hoi-goi-y {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 5px;
    border-radius: 999px;
    border: 1px solid var(--chinh-vien);
    background: var(--chinh-nhat);
    color: var(--chinh);
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1;
    cursor: help;
    vertical-align: middle;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.dau-hoi-goi-y:hover,
.dau-hoi-goi-y:focus {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #ffffff;
    outline: none;
}

.goi-y-nho-duoi-o {
    font-size: 11.5px;
    color: var(--chu-mo);
    margin-top: 3px;
}

#hop-goi-y-nhac-ten-at {
    position: fixed;
    z-index: 2400;
    display: none;
    min-width: 240px;
    max-width: 340px;
    max-height: 230px;
    overflow-y: auto;
    background: var(--nen-the);
    border: 1px solid var(--vien-dam);
    border-radius: 9px;
    box-shadow: var(--bong-noi);
    padding: 4px;
}

#hop-goi-y-nhac-ten-at.dang-hien {
    display: block;
}

.dong-goi-y-at {
    padding: 7px 9px;
    border-radius: 7px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12.5px;
    color: var(--chu-chinh);
}

.dong-goi-y-at:hover,
.dong-goi-y-at.dang-chon {
    background: var(--chinh-nhat);
    color: var(--chinh);
}

/* Khôi phục đầy đủ lớp hiển thị KPI, Huy hiệu vàng, Tag tình trạng màu, Bot, 360° & Đơn hàng */
.hh-vang {
    background: var(--canh-bao-nhat);
    color: var(--canh-bao);
    border: 1px solid var(--canh-bao-vien);
}

.the-chi-so.vang {
    border-left-color: var(--canh-bao);
}

.the-chi-so .nhan-nho {
    font-size: 12px;
    color: var(--chu-mo);
    font-weight: 700;
}

.the-chi-so .con-so-lon {
    font-size: 20px;
    font-weight: 700;
    color: var(--chu-chinh);
    margin: 4px 0 2px;
    font-variant-numeric: tabular-nums;
}

.the-chi-so .ghi-chu-phu {
    font-size: 11.5px;
    color: var(--chu-mo);
}

.the-tinh-trang-mau {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid var(--vien-chuan);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    white-space: nowrap;
}

.the-tt-do {
    background: var(--nguy-hiem-nhat);
    color: var(--nguy-hiem);
    border-color: var(--nguy-hiem-vien);
}

.the-tt-cam {
    background: var(--canh-bao-nhat);
    color: var(--canh-bao);
    border-color: var(--canh-bao-vien);
}

.the-tt-xanh-la {
    background: var(--thanh-cong-nhat);
    color: var(--thanh-cong);
    border-color: var(--thanh-cong-vien);
}

.the-tt-xam {
    background: var(--nen-phu);
    color: var(--chu-mo);
    border-color: var(--vien-dam);
}

.bong-bong-bot {
    background: var(--nen-the);
    border: 1px solid var(--vien-chuan);
    border-left: 3px solid var(--chinh);
    border-radius: 9px;
    padding: 9px 11px;
    font-size: 12.5px;
    color: var(--chu-chinh);
    box-shadow: var(--bong-nhe);
}

.bong-bong-bot .tieu-de-tin {
    font-weight: 700;
    color: var(--chinh);
    margin-bottom: 4px;
}

.bong-bong-bot pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 12.2px;
    color: var(--chu-chinh);
}

.luoi-nut-inline-tele {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 7px;
}

.nut-inline-tele {
    border: 1px solid var(--chinh-vien);
    background: var(--chinh-nhat);
    color: var(--chinh);
    padding: 4px 9px;
    border-radius: 6px;
    font-size: 11.8px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.nut-inline-tele:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #ffffff;
}

.chuoi-ke-thua-360 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    background: var(--nen-phu);
    border-bottom: 1px solid var(--vien-chuan);
    font-size: 12px;
}

.buoc-ke-thua {
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid var(--vien-dam);
    background: var(--nen-the);
    color: var(--chu-mo);
    font-weight: 700;
}

.buoc-ke-thua.da-kich-hoat {
    background: var(--thanh-cong-nhat);
    border-color: var(--thanh-cong-vien);
    color: var(--thanh-cong);
}

.truc-thoi-gian-tu-van {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.moc-thoi-gian-item {
    background: var(--nen-the);
    border: 1px solid var(--vien-chuan);
    border-left: 3px solid var(--chinh);
    border-radius: 8px;
    padding: 9px 11px;
    color: var(--chu-chinh);
}

.moc-thoi-gian-item.moc-xanh-la { border-left-color: var(--thanh-cong); }
.moc-thoi-gian-item.moc-cam { border-left-color: var(--canh-bao); }
.moc-thoi-gian-item.moc-do { border-left-color: var(--nguy-hiem); }
.moc-thoi-gian-item.moc-xam { border-left-color: var(--chu-mo); }

.the-quan-tri-don-hang {
    background: var(--nen-the);
    border: 1px solid var(--vien-chuan);
    border-radius: 10px;
    padding: 12px 13px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    box-shadow: var(--bong-the);
}

.hop-the-zalo {
    background: var(--chinh-nhat);
    border: 1px solid var(--chinh-vien);
    border-radius: 10px;
    padding: 11px 13px;
    margin-bottom: 12px;
}

.nut-bieu-tuong.co-tin-moi {
    border-color: var(--nguy-hiem-vien);
    background: var(--nguy-hiem-nhat);
    color: var(--nguy-hiem);
}

.dong-data-dong-nghiep {
    opacity: 0.92;
}

.thanh-day-di-dong {
    display: none;
}

@media (max-width: 768px) {
    body {
        padding-bottom: 62px;
    }

    .thanh-day-di-dong {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: 56px;
        background: var(--nen-the);
        border-top: 1px solid var(--vien-chuan);
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        z-index: 400;
    }

    .nut-day-di-dong {
        border: 0;
        background: transparent;
        color: var(--chu-phu);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        font-size: 11px;
        font-weight: 700;
        cursor: pointer;
    }

    .nut-day-di-dong.dang-chon {
        color: var(--chinh);
    }
}

/* Giữ tương thích nhẹ cho lớp phủ 360 & ngăn kéo cũ nếu được mở trực tiếp */
.lop-phu-360 {
    position: fixed;
    inset: 0;
    z-index: 910;
    background: rgba(15, 23, 42, 0.52);
    display: flex;
    justify-content: flex-end;
}

.lop-phu-360.an {
    display: none !important;
}

.ngan-truot-360 {
    width: min(820px, 95vw);
    height: 100vh;
    background: var(--nen-the);
    color: var(--chu-chinh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dau-360 {
    background: #1d4ed8;
    color: #ffffff;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.than-360 {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
}

.ngan-keo-mot-cham {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: min(620px, calc(100vw - 32px));
    max-height: 82vh;
    overflow-y: auto;
    background: var(--nen-the);
    color: var(--chu-chinh);
    border: 1px solid var(--chinh-vien);
    border-radius: 12px;
    padding: 14px;
    box-shadow: var(--bong-noi);
    z-index: 920;
}

.ngan-keo-mot-cham.an {
    display: none !important;
}

/* ================= CẨM NANG HƯỚNG DẪN NHANH THEO VAI TRÒ (F1) ================= */
#modal-cam-nang-vai-tro {
    z-index: 1120;
}

.luoi-buoc-huong-dan {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.the-buoc-hd {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 11px 14px;
    background: var(--nen-phu);
    border: 1px solid var(--vien-chuan);
    border-left: 3px solid var(--chinh);
    border-radius: 10px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.the-buoc-hd:hover {
    border-color: var(--chinh-vien);
    box-shadow: var(--bong-nhe);
}

.so-buoc-hd {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: var(--chinh);
    color: #ffffff;
    font-family: Arial;
    font-size: 12.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}


