/* ==========================================================================
   HỆ THỐNG THIẾT KẾ GIAO DIỆN (DESIGN SYSTEM): FITCLUB 43-009 MODERN CORPORATE SAAS
   Phong cách Doanh nghiệp Hiện đại: Tinh tế, Tối giản, Bố cục thoáng, Trực quan
   Bảng màu: Navy (#0F2D4A) - Cam (#FF8A00) - Xanh tương tác (#2563EB) - Nền (#F8FAFC)
   ========================================================================== */

:root {
    /* 1. BẢNG MÀU CHỦ ĐẠO THƯƠNG HIỆU & DOANH NGHIỆP */
    --primary: #0F2D4A;          /* Navy thương hiệu: Sidebar, Logo & Nhận diện */
    --primary-hover: #163B60;    /* Navy hover */
    --primary-light: #EBF3FA;    /* Navy siêu nhạt */
    --primary-border: #CBD5E1;   /* Viền xám bạc */

    /* 2. MÀU ĐIỂM NHẤN TINH TẾ (ACCENT ORANGE) */
    --accent: #FF8A00;           /* Cam điểm nhấn: vạch menu active, nút quan trọng */
    --accent-hover: #E07800;     /* Cam hover */
    --accent-light: #FFF4E5;    /* Cam nhạt mềm mại */

    /* 3. MÀU TƯƠNG TÁC CHÍNH (INTERACTIVE BLUE - NÚT CHÍNH, HÀNH ĐỘNG) */
    --interactive: #2563EB;      /* Xanh biển tương tác */
    --interactive-hover: #1D4ED8;
    --interactive-light: #EFF6FF;

    /* 4. TRẠNG THÁI (STATUS COLORS) */
    --success: #16A34A;          /* Xanh lá hoạt động / thành công */
    --success-bg: #DCFCE7;
    --warning: #F59E0B;          /* Vàng cam cảnh báo */
    --warning-bg: #FEF3C7;
    --danger: #DC2626;           /* Đỏ quá hạn / lỗi / xóa */
    --danger-bg: #FEE2E2;
    --info: #0284C7;             /* Xanh thông tin */
    --info-bg: #E0F2FE;

    /* 5. NỀN VÀ BỀ MẶT (SURFACES & BACKGROUNDS) */
    --bg-main: #F8FAFC;          /* Nền ứng dụng sáng sủa, thanh lịch */
    --bg-card: #FFFFFF;          /* Nền thẻ trắng tinh khiết */
    --bg-sidebar: #0F2D4A;       /* Nền Sidebar Navy hiện đại */
    --bg-topbar: #FFFFFF;        /* Nền Topbar trắng tinh tế */
    
    /* 6. MÀU VĂN BẢN (TYPOGRAPHY COLORS) */
    --text-main: #0F172A;        /* Chữ chính: Đen than tương phản cao */
    --text-muted: #64748B;       /* Chữ phụ, mô tả: Xám xanh */
    --text-subtle: #94A3B8;      /* Chữ mờ, placeholder */
    
    /* 7. ĐƯỜNG VIỀN & PHÂN CÁCH (BORDERS) */
    --border: #E2E8F0;           /* Viền mảnh 1px tiêu chuẩn */
    --border-light: #F1F5F9;     /* Viền siêu nhẹ */
    --border-active: #2563EB;    /* Viền khi chọn */

    /* 8. ĐỔ BÓNG TỰ NHIÊN (SOFT MODERN SHADOWS) */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    
    /* 9. BO GÓC (BORDER RADIUS) */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* VÙNG AN TOÀN CHO THIẾT BỊ DI ĐỘNG */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
}

/* RESET TOÀN CỤC */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ÁP DỤNG ĐỒNG BỘ PHÔNG CHỮ SANS-SERIF HIỆN ĐẠI (INTER & BE VIETNAM PRO) CHO TOÀN BỘ HỆ THỐNG */
*,
*::before,
*::after,
html,
body,
input,
button,
select,
textarea,
table,
th,
td,
span,
div,
p,
a,
label,
code,
pre,
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Inter', 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* TÙY BIẾN THANH CUỘN (CUSTOM SCROLLBAR) MỎNG NHẸ, TRANG NHÃ CHUẨN HIỆN ĐẠI */
* {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f8fafc;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 6px;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* THANH CUỘN NGANG NỔI DÍNH ĐÁY MÀN HÌNH (STICKY HORIZONTAL SCROLLBAR) */
#sticky-floating-scrollbar::-webkit-scrollbar {
    height: 10px !important;
}
#sticky-floating-scrollbar::-webkit-scrollbar-track {
    background: #f1f5f9 !important;
    border-radius: 6px;
}
#sticky-floating-scrollbar::-webkit-scrollbar-thumb {
    background: #0284c7 !important;
    border-radius: 6px;
    border: 2px solid #f1f5f9;
}
#sticky-floating-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #0369a1 !important;
}

html, body {
    margin: 0 !important;
    padding: 0 !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    min-height: 100dvh !important;
    overflow: hidden !important; /* Khóa cuộn window ngoài, ngăn chặn trôi thanh điều hướng */
    max-width: 100vw;
    width: 100%;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    height: 100vh;
    height: 100dvh;
    font-size: clamp(13px, 0.4vw + 12px, 14.5px);
    line-height: 1.45;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
}

/* ==========================================================================
   1. BỐ CỤC KHUNG CHÍNH (APP LAYOUT - FIXED DASHBOARD)
   ========================================================================== */
.app-layout {
    display: flex;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    min-height: 100dvh;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
}

/* ==========================================================================
   2. THANH ĐIỀU HƯỚNG DỌC BÊN TRÁI (SIDEBAR) - CHUẨN MODERN CORPORATE SAAS
   ========================================================================== */
.sidebar {
    width: 256px;
    min-width: 256px;
    max-width: 256px;
    background: #0F2D4A;
    color: #ffffff;
    flex: 0 0 256px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    position: relative;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.08);
    transition: width 0.25s ease, min-width 0.25s ease, max-width 0.25s ease, transform 0.28s ease;
}

/* Hỗ trợ trạng thái thu gọn (Collapsed state) an toàn khi được bật */
.sidebar.collapsed {
    width: 72px;
    min-width: 72px;
    max-width: 72px;
    flex: 0 0 72px;
}

.sidebar.collapsed .brand-text,
.sidebar.collapsed .menu-label,
.sidebar.collapsed .sidebar-footer-text,
.sidebar.collapsed .btn-submenu-toggle {
    display: none !important;
}

.sidebar.collapsed .sidebar-link {
    justify-content: center;
    padding: 12px 0;
}

.sidebar-brand.brand-official-danang {
    height: 68px !important;
    min-height: 68px !important;
    max-height: 68px !important;
    padding: 0 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: #0F2D4A !important;
    cursor: pointer;
    transition: background 0.2s ease;
    box-sizing: border-box !important;
}

.sidebar-brand.brand-official-danang:hover {
    background: #143759 !important;
}

.brand-official-danang .brand-police-badge,
.brand-official-danang .brand-logo-frame {
    width: 38px !important;
    height: 38px !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
    flex-shrink: 0 !important;
    padding: 2px !important;
    border: none !important;
    transition: transform 0.2s ease;
}

.brand-official-danang:hover .brand-logo-frame {
    transform: scale(1.04);
}

.brand-official-danang .brand-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    text-align: left;
    flex: 1;
    overflow: hidden;
}

.brand-title-cong-an {
    font-size: 17px !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px !important;
    color: #ffffff !important;
    text-transform: uppercase;
    white-space: nowrap;
    text-align: left !important;
    width: 100%;
    font-family: inherit !important;
    line-height: 1.2;
    background: linear-gradient(120deg, #FFFFFF 0%, #FFFFFF 30%, #FEE08B 50%, #FFFFFF 70%, #FFFFFF 100%);
    background-size: 250% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: brandTitleShimmer 8s ease-in-out infinite;
}

@keyframes brandTitleShimmer {
    0%, 75% { background-position: 250% 0; }
    90%, 100% { background-position: -50% 0; }
}

.brand-title-danang {
    font-size: 11px !important;
    font-weight: 600 !important;
    letter-spacing: 0.4px !important;
    color: #FF8A00 !important;
    text-transform: uppercase;
    white-space: nowrap;
    text-align: left !important;
    width: 100%;
    font-family: inherit !important;
    text-shadow: none !important;
    margin-top: 1px;
    opacity: 0.95;
    transition: opacity 0.2s ease;
}

.sidebar-menu {
    list-style: none;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    position: relative;
    z-index: 2;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

/* ẨN HOÀN TOÀN HỌA TIẾT TRỐNG ĐỒNG CŨ ĐỂ ĐẠT CHUẨN MODERN CORPORATE */
.sidebar-trong-dong-watermark {
    display: none !important;
}

.sidebar-item {
    display: flex;
    flex-direction: column;
    position: relative;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: #94A3B8;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.18s ease;
    cursor: pointer;
    user-select: none;
    border-left: 3.5px solid transparent;
}

.sidebar-link .menu-icon {
    font-size: 18px;
    display: flex;
    align-items: center;
    color: #94A3B8;
    transition: color 0.18s ease;
}

.sidebar-link .menu-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-link:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.sidebar-link:hover .menu-icon {
    color: #ffffff;
}

.sidebar-link.active {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    border-left: 3.5px solid #FF8A00 !important;
    box-shadow: none !important;
}

.sidebar-link.active .menu-icon {
    color: #FF8A00 !important;
}

.sidebar-footer {
    padding: 16px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: #0A2137;
    margin-top: auto;
    text-align: left;
    position: relative;
    z-index: 2;
}

.sidebar-footer-text {
    line-height: 1.4;
}

.sidebar-footer-text .footer-slogan-strong {
    color: #FF8A00;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.3px;
}

.sidebar-footer-text .footer-slogan-sub {
    color: #64748B;
    font-size: 11px;
    margin-top: 2px;
}

/* ==========================================================================
   3. CẤU TRÚC SIDEBAR DẠNG CÂY PHÂN CẤP (TREE ACCORDION SIDEBAR)
   Thiết kế chuẩn Navy Enterprise: Nhánh cây connector, vạch chỉ thị neon, nền mờ
   ========================================================================== */
.sidebar-tree-group {
    margin-bottom: 2px;
    border-radius: 8px;
    position: relative;
    transition: background 0.22s ease;
}

/* Khi nhóm đang mở: Đổ nền xanh lam mờ và vạch đứng xanh sáng mép trái */
.sidebar-tree-group.is-open {
    background: rgba(2, 132, 199, 0.14);
}

.sidebar-tree-group.is-open::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3.5px;
    background: #0284c7;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    box-shadow: 0 0 10px rgba(2, 132, 199, 0.8);
}

/* Tiêu đề nhóm (Group Header) */
.sidebar-tree-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
    border-radius: 8px;
    transition: background 0.18s ease, color 0.18s ease;
}

.sidebar-tree-group:not(.is-open) .sidebar-tree-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.tree-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    overflow: hidden;
}

.tree-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #94a3b8;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.sidebar-tree-group.is-open .tree-header-icon {
    color: #38bdf8;
}

.tree-header-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

.sidebar-tree-group.is-open .tree-header-title {
    color: #38bdf8;
}

.tree-header-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
    flex-shrink: 0;
}

.sidebar-tree-group.is-open .tree-header-arrow {
    transform: rotate(180deg);
    color: #38bdf8;
}

/* Thân nhóm chứa nhánh cây phân cấp */
.sidebar-tree-body {
    position: relative;
    padding-left: 10px;
    padding-bottom: 8px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transition: max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, padding 0.2s ease;
}

.sidebar-tree-group.is-open .sidebar-tree-body {
    max-height: 380px;
    opacity: 1;
    pointer-events: auto;
    padding-top: 4px;
}

/* Đường trục nhánh dọc màu xanh */
.tree-branch-line {
    position: absolute;
    left: 25px;
    top: 6px;
    bottom: 16px;
    width: 1.5px;
    background: #0284c7;
    opacity: 0.7;
}

/* Danh sách các mục con */
.sidebar-tree-subitems {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Mỗi mục con dạng nhánh cây */
.tree-sub-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px 7px 19px;
    border-radius: 6px;
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: all 0.16s ease;
    border-left: none !important;
}

/* Bộ kết nối nhánh cây (Node Dot + Horizontal Line) */
.tree-connector {
    display: inline-flex;
    align-items: center;
    position: relative;
    flex-shrink: 0;
    margin-right: -2px;
}

.tree-node-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #38bdf8;
    box-shadow: 0 0 6px #38bdf8;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tree-node-line {
    width: 12px;
    height: 1.5px;
    background: #0284c7;
    flex-shrink: 0;
}

.tree-sub-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    transition: color 0.16s ease;
    flex-shrink: 0;
}

.tree-sub-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.16s ease;
}

/* Hiệu ứng hover mục con */
.tree-sub-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
}

.tree-sub-link:hover .tree-node-dot {
    transform: scale(1.3);
    box-shadow: 0 0 8px #38bdf8;
}

.tree-sub-link:hover .tree-sub-icon {
    color: #38bdf8;
}

/* Khi mục con đang Active */
.tree-sub-link.active {
    color: #38bdf8 !important;
    font-weight: 600 !important;
    background: rgba(2, 132, 199, 0.15) !important;
}

.tree-sub-link.active .tree-node-dot {
    background: #38bdf8;
    box-shadow: 0 0 10px #38bdf8;
    transform: scale(1.35);
}

.tree-sub-link.active .tree-sub-icon {
    color: #38bdf8 !important;
}

/* Nút Trang chủ độc lập trên cùng */
.tree-nav-item-home {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
    border-radius: 8px;
    transition: all 0.18s ease;
    margin-bottom: 2px;
    position: relative;
}

.tree-nav-item-home:hover {
    background: rgba(255, 255, 255, 0.05);
}

.tree-nav-item-home.active {
    background: rgba(2, 132, 199, 0.14) !important;
}

.tree-nav-item-home.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3.5px;
    background: #0284c7;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    box-shadow: 0 0 10px rgba(2, 132, 199, 0.8);
}

.tree-nav-item-home .tree-header-title {
    font-size: 13.5px;
    font-weight: 500;
    text-transform: none; /* Trang chủ hiển thị thường */
}

.tree-nav-item-home.active .tree-header-title {
    color: #38bdf8;
    font-weight: 600;
}

.tree-nav-item-home.active .tree-header-icon {
    color: #38bdf8;
}

/* Đường gạch phân cách giữa các nhóm */
.sidebar-tree-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.04);
    margin: 4px 6px;
}

/* ==========================================================================
   MORPHICONS SPRING PHYSICS ANIMATIONS (BIẾN ĐỔI HÌNH THÁI ICON LÒ XO)
   Chuẩn mô phỏng Morphicons.com với cubic-bezier đàn hồi lò xo
   ========================================================================== */
/* 1. Biến hình Menu (Hamburger 3 gạch) ↔ X (Dấu nhân) */
.morph-menu-x-icon {
    display: inline-flex;
    vertical-align: middle;
    overflow: visible;
}

.morph-menu-x-icon .morph-line {
    stroke-linecap: round;
    transition: transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1), 
                opacity 0.22s ease, 
                stroke 0.22s ease;
    transform-origin: 12px 12px;
}

.morph-menu-x-icon.is-active-x .morph-top {
    transform: translateY(6px) rotate(45deg);
    stroke: #FF8A00;
}

.morph-menu-x-icon.is-active-x .morph-middle {
    opacity: 0;
    transform: scaleX(0);
}

.morph-menu-x-icon.is-active-x .morph-bottom {
    transform: translateY(-6px) rotate(-45deg);
    stroke: #FF8A00;
}

/* 2. Biến hình Kính lúp (Search) ↔ Dấu nhân xóa (X) */
.morph-search-x-icon {
    display: inline-flex;
    vertical-align: middle;
    overflow: visible;
    cursor: pointer;
}

.morph-search-x-icon .morph-search-circle,
.morph-search-x-icon .morph-search-handle {
    transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
    transform-origin: 11px 11px;
}

.morph-search-x-icon .morph-x-line-1,
.morph-search-x-icon .morph-x-line-2 {
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease, stroke 0.2s ease;
    transform-origin: 12px 12px;
    opacity: 0;
    transform: scale(0.2) rotate(45deg);
}

.morph-search-x-icon.is-active-x .morph-search-circle {
    opacity: 0;
    transform: scale(0.2);
}

.morph-search-x-icon.is-active-x .morph-search-handle {
    opacity: 0;
    transform: translate(6px, 6px) scale(0.2);
}

.morph-search-x-icon.is-active-x .morph-x-line-1 {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    stroke: #FF8A00;
}

.morph-search-x-icon.is-active-x .morph-x-line-2 {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    stroke: #FF8A00;
}

/* 3. Hiệu ứng lò xo bật nảy khi hoàn thành (Spring Pop Checkbox / Button) */
@keyframes morphSpringPop {
    0% { transform: scale(0.6) rotate(-12deg); opacity: 0.3; }
    55% { transform: scale(1.3) rotate(4deg); opacity: 1; }
    75% { transform: scale(0.92) rotate(-2deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.morph-pop-spring {
    display: inline-block;
    animation: morphSpringPop 0.42s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Cải tiến mũi tên Accordion đàn hồi lò xo */
.tree-header-arrow {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease !important;
}

/* ==========================================================================
   4. CỬA SỔ SUBMENU NỘI TUYẾN TRONG SIDEBAR
   ========================================================================== */
.btn-submenu-toggle {
    background: transparent;
    border: none;
    outline: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-left: auto;
}

.btn-submenu-toggle:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #f97316;
}

.submenu-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    color: #38bdf8;
}

.sidebar-inline-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    margin: 4px 6px 8px 16px;
    border-left: 2.5px solid #10b981;
}

.sidebar-inline-submenu.is-open {
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.2);
}

.sidebar-sub-items-wrapper {
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 380px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar-sub-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.18s ease;
    text-decoration: none;
    user-select: none;
}

.sidebar-sub-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding-left: 13px;
}

.sub-link-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #38bdf8;
    flex-shrink: 0;
    transition: transform 0.18s ease;
}

.sidebar-sub-link:hover .sub-link-dot {
    transform: scale(1.3);
    background: #f97316;
}

.sub-link-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.35;
    font-weight: 500;
}

.sub-link-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.sub-count-badge {
    background: rgba(255, 255, 255, 0.18);
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
}

.sub-broken-badge {
    background: rgba(239, 68, 68, 0.35);
    border: 1px solid rgba(248, 113, 113, 0.45);
    color: #fca5a5;
    font-size: 10px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 8px;
    white-space: nowrap;
}

.sub-link-all {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px dashed rgba(255, 255, 255, 0.15);
}

.sub-link-all:hover {
    background: rgba(251, 191, 36, 0.18) !important;
}

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(8, 47, 73, 0.95);
    margin-top: auto; /* Luôn ép sát đáy sidebar */
    text-align: center;
    position: relative;
    z-index: 2;
}

.sidebar-footer-text {
    line-height: 1.45;
}

/* ==========================================================================
   4. VÙNG NỘI DUNG CHÍNH & THANH TIÊU ĐỀ PHÍA TRÊN (TOPBAR) - MODERN CORPORATE SAAS
   ========================================================================== */
.main-wrapper {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    min-width: 0;
    width: calc(100% - 256px);
    max-width: calc(100% - 256px);
    overflow: hidden;
    background-color: var(--bg-main);
    transition: width 0.25s ease, max-width 0.25s ease;
}

.sidebar.collapsed + .main-wrapper,
.app-layout.sidebar-collapsed .main-wrapper {
    width: calc(100% - 72px);
    max-width: calc(100% - 72px);
}

/* THANH TIÊU ĐỀ NGANG PHÍA TRÊN (TOPBAR): NỀN TRẮNG TINH TẾ, VIỀN MẢNH 1PX, CAO 68PX */
.topbar {
    background: #FFFFFF;
    height: 68px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid #E2E8F0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: visible !important;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 2;
    flex: 1;
    max-width: 600px;
}

/* NÚT MENU HAMBURGER CHO THIẾT BỊ DI ĐỘNG */
.btn-mobile-menu-toggle {
    display: none;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    color: #475569;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.btn-mobile-menu-toggle:hover {
    background: #F1F5F9;
    color: #0F172A;
}

/* DẢI SÁNG LƯỚT CHUYỂN ĐỘNG Ở VIỀN DƯỚI TOPBAR (SUBTLE GLOW SHIMMER LINE) */
.topbar-shimmer-line {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(37, 99, 235, 0.25) 20%, 
        rgba(249, 115, 22, 0.45) 50%, 
        rgba(37, 99, 235, 0.25) 80%, 
        transparent 100%
    );
    background-size: 200% 100%;
    animation: topbarShimmerSweep 9s ease-in-out infinite;
    pointer-events: none;
    z-index: 10;
}

@keyframes topbarShimmerSweep {
    0% { background-position: 200% 0; }
    50% { background-position: 0% 0; }
    100% { background-position: -200% 0; }
}

/* THANH TÌM KIẾM TOÀN HỆ THỐNG TRÊN TOPBAR (GLOBAL SEARCH BAR) VỚI HIỆU ỨNG TƯƠNG TÁC CAO CẤP */
.topbar-search-wrapper {
    position: relative;
    width: 100%;
    max-width: 320px;
    display: flex;
    align-items: center;
    transition: max-width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.topbar-search-wrapper:focus-within {
    max-width: 440px;
}

.topbar-search-icon {
    position: absolute;
    left: 14px;
    color: #94A3B8;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    font-size: 16px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.topbar-search-wrapper:focus-within .topbar-search-icon {
    color: #2563EB;
    transform: scale(1.1);
}

.topbar-search-input {
    width: 100%;
    height: 40px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 0 68px 0 38px;
    font-size: 13.5px;
    color: #0F172A;
    outline: none;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
}

.topbar-search-input::placeholder {
    color: #94A3B8;
    font-size: 13px;
    transition: opacity 0.2s ease;
}

.topbar-search-input:focus {
    background: #FFFFFF;
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12), 0 3px 10px rgba(37, 99, 235, 0.06);
}

/* PHÍM TẮT TÌM KIẾM NHANH (KBD BADGE) */
.topbar-search-shortcut {
    position: absolute;
    right: 10px;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    color: #64748B;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 5px;
    pointer-events: none;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    line-height: 1.3;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.topbar-search-wrapper:focus-within .topbar-search-shortcut {
    border-color: #93C5FD;
    color: #2563EB;
    background: #EFF6FF;
}

/* HIỆU ỨNG PHÁT SÁNG KHI GỌI BẰNG PHÍM TẮT CTRL + K */
.search-glow-pulse {
    animation: searchGlowAnim 0.8s ease-out;
}

@keyframes searchGlowAnim {
    0% { transform: scale(0.98); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.5); }
    50% { transform: scale(1.02); box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.15); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

/* ==========================================================================
   TIỆN ÍCH TRUNG TÂM TOPBAR: ĐỒNG HỒ THỜI GIAN THỰC CĂN GIỮA HOÀN HẢO
   Viên thuốc trạng thái thanh lịch, cân xứng tuyệt đối, không làm dồn cục
   ========================================================================== */
.topbar-center-widget {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 20px;
    user-select: none;
}

.live-unified-pill {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 20px;
    padding: 6px 18px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.live-unified-pill:hover {
    background: #FFFFFF;
    border-color: #CBD5E1;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.06);
    transform: translateY(-1px);
}

.live-pulse-dot {
    width: 8px;
    height: 8px;
    background: #10B981;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: livePillPulse 2.2s infinite;
}

@keyframes livePillPulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.live-status-txt {
    font-weight: 600;
    color: #15803D;
    font-size: 12px;
}

.live-pill-sep {
    color: #CBD5E1;
    font-size: 11px;
}

.live-pill-date {
    color: #475569;
    font-weight: 500;
}

.live-pill-time {
    color: #0F172A;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

/* TIÊU ĐỀ PHÂN HỆ ĐỘNG TRÊN TOPBAR */
.topbar-current-page {
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
}

.page-icon-badge {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #EFF6FF;
    border: 1px solid #DBEAFE;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563EB;
    flex-shrink: 0;
}

.page-title-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.25;
}

.page-main-title {
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: #0F172A;
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-sub-desc {
    font-size: 11.5px;
    font-weight: 400;
    color: #64748B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
}

/* BỘ CHỌN ĐỘI / NHÓM CHO ADMIN */
.topbar-admin-group-bar {
    display: flex;
    align-items: center;
    margin: 0 12px;
}

.admin-group-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 12.5px;
}

.admin-group-select {
    border: none;
    background: transparent;
    font-size: 12.5px;
    font-weight: 600;
    color: #0F172A;
    outline: none;
    cursor: pointer;
}

.btn-admin-group-clear {
    border: none;
    background: transparent;
    color: #94A3B8;
    cursor: pointer;
    font-size: 12px;
    padding: 0 4px;
}

.btn-admin-group-clear:hover {
    color: #DC2626;
}

/* KHU VỰC THÔNG TIN NGƯỜI DÙNG & QUẢ CHUÔNG (TOPBAR USER SECTION) */
.topbar-user-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    z-index: 1050;
    position: relative;
}

/* QUẢ CHUÔNG THÔNG BÁO HIỆN ĐẠI */
.topbar-notification-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    z-index: 1050;
}

.btn-topbar-bell {
    position: relative;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    color: #64748B;
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.btn-topbar-bell:hover {
    background: #F8FAFC;
    border-color: #CBD5E1;
    color: #0F172A;
    transform: translateY(-1px) scale(1.04);
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.06);
}

.btn-topbar-bell:active {
    transform: translateY(0) scale(0.97);
}

.btn-topbar-bell .bell-icon {
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

/* HIỆU ỨNG RUNG LẮC NHẸ ĐỊNH KỲ CHO QUẢ CHUÔNG KHI CÓ THÔNG BÁO CHƯA ĐỌC */
.btn-topbar-bell.has-unread .bell-icon {
    animation: bellGentleSwing 7s cubic-bezier(0.36, 0.07, 0.19, 0.97) infinite;
    transform-origin: top center;
    color: #2563EB;
}

@keyframes bellGentleSwing {
    0%, 82%, 100% { transform: rotate(0deg); }
    84% { transform: rotate(14deg); }
    87% { transform: rotate(-12deg); }
    90% { transform: rotate(9deg); }
    93% { transform: rotate(-6deg); }
    96% { transform: rotate(3deg); }
}

/* BADGE SỐ THÔNG BÁO VỚI HIỆU ỨNG SÓNG RADAR PING LAN TỎA */
.bell-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #DC2626;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #FFFFFF;
    line-height: 1;
    animation: badgeRadarPulse 2.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes badgeRadarPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
    }
    60% {
        box-shadow: 0 0 0 7px rgba(220, 38, 38, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
    }
}

/* THẺ TÀI KHOẢN NGƯỜI DÙNG TRÊN TOPBAR (USER CARD CHUẨN MODERN CORPORATE) */
.topbar-account-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    z-index: 1050;
}

.user-profile-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 4px 12px 4px 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    position: relative;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.user-profile-card:hover {
    background: #F8FAFC;
    border-color: #CBD5E1;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.06);
}

.user-profile-card:active {
    transform: translateY(0);
}

.user-profile-card:hover .user-dropdown-arrow {
    transform: translateY(2px);
    color: #2563EB;
}

.user-avatar-wrapper {
    position: relative;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.user-avatar-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #ffffff;
    background: #2563EB;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.user-profile-card:hover .user-avatar-circle {
    transform: scale(1.04);
}

.user-avatar-circle.truong { background: #D97706; }
.user-avatar-circle.admin { background: #DC2626; }
.user-avatar-circle.pho { background: #0284C7; }
.user-avatar-circle.thanh_vien { background: #2563EB; }
.user-avatar-circle.khach_hang { background: #059669; }

/* CHẤM TRỰC TUYẾN THỜI GIAN THỰC VỚI HIỆU ỨNG THỞ PHÁT QUANG (BREATHING GLOW) */
.user-status-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #16A34A;
    border: 2px solid #FFFFFF;
    animation: userStatusBreathing 2.5s ease-in-out infinite;
}

@keyframes userStatusBreathing {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7);
        opacity: 1;
    }
    50% {
        box-shadow: 0 0 0 4px rgba(22, 163, 74, 0);
        opacity: 0.85;
    }
}

.user-details-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
}

.user-fullname {
    color: #0F172A;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}

.user-meta-sub {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 1px;
    white-space: nowrap;
}

.user-role-badge {
    font-weight: 500;
    font-size: 11.5px;
    color: #64748B;
    background: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
}

.user-dropdown-arrow {
    color: #94A3B8;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    margin-left: 2px;
}

.user-dropdown-arrow.open {
    transform: rotate(180deg);
}

/* BẢNG TÙY CHỌN TÀI KHOẢN THẢ XUỐNG (ACCOUNT DROPDOWN MENU) */
.topbar-account-dropdown {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 0 !important;
    left: auto !important;
    width: 280px !important;
    min-width: 280px !important;
    max-width: 320px !important;
    background: #FFFFFF !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05) !important;
    border: 1px solid #E2E8F0 !important;
    overflow: hidden !important;
    z-index: 2000 !important;
    animation: accountDropFade 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes accountDropFade {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.account-dropdown-header {
    padding: 14px 16px;
    background: #F8FAFC;
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.account-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    background: #2563EB;
    flex-shrink: 0;
}

.account-header-avatar.truong { background: #D97706; }
.account-header-avatar.admin { background: #DC2626; }
.account-header-avatar.pho { background: #0284C7; }
.account-header-avatar.thanh_vien { background: #2563EB; }
.account-header-avatar.khach_hang { background: #059669; }

.account-header-info {
    overflow: hidden;
    flex: 1;
}

.account-header-name {
    font-size: 14px;
    font-weight: 700;
    color: #0F172A;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-header-sub {
    font-size: 12px;
    color: #64748B;
    margin-top: 1px;
    display: flex;
    gap: 4px;
    white-space: nowrap;
}

.account-header-tags {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.account-role-tag {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 1.5px 7px;
    border-radius: 4px;
    letter-spacing: 0.3px;
    background: #EFF6FF;
    color: #2563EB;
}

.account-unit-tag {
    font-size: 10px;
    font-weight: 500;
    color: #64748B;
    background: #F1F5F9;
    padding: 1.5px 7px;
    border-radius: 4px;
}

.account-dropdown-menu {
    padding: 6px 0;
}

.account-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.account-menu-item:hover {
    background-color: #F8FAFC;
}

.account-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #475569;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.account-menu-item:hover .account-item-icon {
    background: #EFF6FF;
    border-color: #BFDBFE;
    color: #2563EB;
}

.account-menu-item.logout-item:hover .account-item-icon {
    background: #FEE2E2;
    border-color: #FECACA;
    color: #DC2626;
}

.account-item-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.account-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #0F172A;
    line-height: 1.3;
    white-space: nowrap !important;
}

.account-item-desc {
    font-size: 11px;
    color: #64748B;
    margin-top: 1px;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-item-arrow {
    font-size: 12px;
    color: #94A3B8;
    transition: transform 0.15s ease;
}

.account-menu-item:hover .account-item-arrow {
    color: #2563EB;
    transform: translateX(2px);
}

.account-menu-divider {
    height: 1px;
    background-color: #E2E8F0;
    margin: 4px 0;
}

/* BẢNG THÔNG BÁO XỔ XUỐNG (DROPDOWN PANEL) CHUẨN MODERN CORPORATE */
.topbar-notification-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    max-width: 92vw;
    max-height: calc(100vh - 90px);
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    border: 1px solid #E2E8F0;
    overflow: hidden;
    z-index: 2000 !important;
    animation: notif-slide-down 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

@keyframes notif-slide-down {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notif-dropdown-header {
    background: #F8FAFC;
    color: #0F172A;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #E2E8F0;
    flex-shrink: 0;
}

.notif-dropdown-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: #0F172A;
    display: flex;
    align-items: center;
    gap: 6px;
}

.notif-refresh-btn {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    color: #64748B;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.15s ease;
}

.notif-refresh-btn:hover {
    background: #F1F5F9;
    color: #0F172A;
}

.notif-dropdown-list {
    max-height: min(400px, calc(100vh - 170px));
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 0;
    background: #FFFFFF;
    scrollbar-width: thin;
    scrollbar-color: #CBD5E1 #F8FAFC;
}

.notif-item {
    padding: 12px 16px;
    border-bottom: 1px solid #F1F5F9;
    display: flex;
    gap: 12px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.notif-item:hover {
    background: #F8FAFC;
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-dropdown-footer {
    padding: 10px 16px;
    background: #F8FAFC;
    border-top: 1px solid #E2E8F0;
    text-align: center;
    font-size: 11px;
    color: #94A3B8;
}

.notif-dropdown-title {
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: #0F172A !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notif-refresh-btn {
    background: #F1F5F9 !important;
    border: 1px solid #E2E8F0 !important;
    color: #475569 !important;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.15s ease;
}

.notif-refresh-btn:hover {
    background: #E2E8F0 !important;
    color: #0F172A !important;
    border-color: #CBD5E1 !important;
    transform: rotate(90deg);
}

.notif-dropdown-list {
    max-height: min(400px, calc(100vh - 170px)); /* Tự co giãn theo màn hình */
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 0;
    background: #ffffff;
    scrollbar-width: thin;
    scrollbar-color: #bae6fd #f8fafc;
}

.notif-dropdown-list::-webkit-scrollbar {
    width: 6px;
}

.notif-dropdown-list::-webkit-scrollbar-thumb {
    background: #bae6fd;
    border-radius: 4px;
}

.notif-dropdown-list::-webkit-scrollbar-track {
    background: #f8fafc;
}

.notif-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item:hover {
    background: #f0fdf4;
}

.notif-item.is-urgent {
    background: #fff1f2;
    border-left: 3px solid #dc2626;
}

.notif-item.is-urgent:hover {
    background: #fee2e2;
}

.notif-icon-col {
    font-size: 20px;
    line-height: 1;
    padding-top: 2px;
    flex-shrink: 0;
}

.notif-body-col {
    flex: 1;
    min-width: 0;
}

.notif-badge-category {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 4px;
    background: #e2ede8;
    color: #075985;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.notif-item.is-urgent .notif-badge-category {
    background: #fecaca;
    color: #991b1b;
}

.notif-item-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f241d;
    line-height: 1.35;
    margin-bottom: 3px;
}

.notif-item.is-urgent .notif-item-title {
    color: #b91c1c;
}

.notif-item-desc {
    font-size: 12px;
    color: #475569;
    line-height: 1.4;
    word-break: break-word;
}

.notif-item-action {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 5px;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
}

.notif-empty-state {
    padding: 36px 20px;
    text-align: center;
    color: #64748b;
}

.notif-empty-icon {
    font-size: 36px;
    margin-bottom: 8px;
    opacity: 0.85;
}

.notif-empty-text {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.notif-dropdown-footer {
    padding: 8px 14px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
}

/* ==========================================================================
   5. PHẦN THÂN TRANG & THẺ NỘI DUNG (MAIN CONTENT & WHITE CARDS)
   ========================================================================== */
.main-container {
    flex: 1;
    overflow-y: auto; /* Thanh cuộn đứng chính thức mượt mà của toàn trang */
    overflow-x: hidden;
    padding: 20px 24px;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

#main-content {
    width: 100%;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 14px;
    padding-bottom: 0;
    border-bottom: none;
    flex-wrap: wrap;
    gap: 10px;
}

.page-header:empty,
.page-header:not(:has(.page-actions:not(:empty))) {
    display: none !important;
}

.page-title {
    display: none !important;
}

.page-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* THẺ NỘI DUNG (CARDS) - CHUẨN MODERN CORPORATE */
.card {
    background: #FFFFFF;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    padding: 20px 24px;
    margin-bottom: 20px;
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
    max-width: 100%;
    box-sizing: border-box;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: #CBD5E1;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: #0F172A;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ==========================================================================
   6. NÚT BẤM (BUTTONS) - MODERN CORPORATE SAAS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    height: 40px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.18s ease;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: inherit;
    box-sizing: border-box;
}

/* NÚT CHÍNH (PRIMARY) - XANH DOANH NGHIỆP #2563EB */
.btn-primary {
    background: #2563EB !important;
    color: #FFFFFF !important;
    border: 1px solid transparent !important;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2) !important;
}

.btn-primary:hover {
    background: #1D4ED8 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3) !important;
}

.btn-primary:active {
    transform: translateY(0);
}

/* NÚT ĐIỂM NHẤN (ACCENT) - CAM NĂNG LƯỢNG #FF8A00 */
.btn-accent {
    background: #FF8A00 !important;
    color: #FFFFFF !important;
    border: 1px solid transparent !important;
    box-shadow: 0 1px 2px rgba(255, 138, 0, 0.2) !important;
}

.btn-accent:hover {
    background: #E07800 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(255, 138, 0, 0.3) !important;
}

/* NÚT PHỤ (SECONDARY / OUTLINE) - NỀN TRẮNG VIỀN XÁM */
.btn-secondary,
.btn-outline {
    background: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
    color: #0F172A !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

.btn-secondary:hover,
.btn-outline:hover {
    background: #F8FAFC !important;
    border-color: #CBD5E1 !important;
    color: #0F172A !important;
}

.btn-success {
    background: #16A34A !important;
    color: #FFFFFF !important;
    border: 1px solid transparent !important;
}

.btn-success:hover {
    background: #15803D !important;
}

.btn-danger {
    background: #DC2626 !important;
    color: #FFFFFF !important;
    border: 1px solid transparent !important;
}

.btn-danger:hover {
    background: #B91C1C !important;
}

.btn-sm {
    height: 32px;
    padding: 4px 12px;
    font-size: 12.5px;
    border-radius: 6px;
}

/* ==========================================================================
   7. BẢNG DỮ LIỆU (DATA TABLES) - CHUẨN HIỆN ĐẠI SAAS
   ========================================================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto !important;
    overflow-y: visible !important;
    background: #FFFFFF;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    position: relative;
    margin-bottom: 16px;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    background: #FFFFFF;
    min-width: 750px;
    border: none;
}

.custom-table th {
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    background-color: #F8FAFC !important;
    color: #64748B;
    font-weight: 600;
    padding: 12px 16px;
    border: none;
    border-bottom: 1px solid #E2E8F0 !important;
    white-space: nowrap;
    letter-spacing: 0.1px;
    font-size: 12.5px;
    text-align: left;
}

.custom-table td {
    padding: 12px 16px;
    border: none;
    border-bottom: 1px solid #F1F5F9;
    vertical-align: middle;
    color: #0F172A;
    line-height: 1.45;
    text-align: left;
}

.custom-table td.cell-center,
.custom-table th.cell-center {
    text-align: center !important;
}

.custom-table td.cell-right,
.custom-table th.cell-right {
    text-align: right !important;
}

.custom-table tbody tr {
    transition: background-color 0.15s ease;
}

.custom-table tbody tr:hover {
    background-color: #F8FAFC;
}

.custom-table tbody tr:last-child td {
    border-bottom: none;
}

/* ==========================================================================
   8. HUY HIỆU TRẠNG THÁI (STATUS BADGES) - DẠNG VIÊN THUỐC PILL MỀM MẠI
   ========================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 9999px;
    white-space: nowrap;
    line-height: 1.2;
    border: 1px solid transparent;
}

.badge::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
}

.badge-success {
    background: #DCFCE7;
    color: #16A34A;
    border-color: #BBF7D0;
}

.badge-danger {
    background: #FEE2E2;
    color: #DC2626;
    border-color: #FECACA;
}

.badge-warning {
    background: #FEF3C7;
    color: #D97706;
    border-color: #FDE68A;
}

.badge-primary {
    background: #EFF6FF;
    color: #2563EB;
    border-color: #DBEAFE;
}

.badge-secondary {
    background: #F1F5F9;
    color: #64748B;
    border-color: #E2E8F0;
}

.text-danger-bold {
    color: #dc2626 !important;
    font-weight: 700;
}

/* ==========================================================================
   9. CỬA SỔ BẬT LÊN (MODALS / POPUPS)
   ========================================================================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(2, 44, 34, 0.65);
    backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: #ffffff;
    border-radius: 20px !important;
    box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(167, 243, 208, 0.3);
    border: 1px solid rgba(167, 243, 208, 0.5);
    max-width: 680px;
    width: 100%;
    max-height: 88vh;
    overflow: hidden !important; /* Đảm bảo 4 góc tròn mềm mại 100% không bao giờ bị cắt */
    display: flex;
    flex-direction: column;
    animation: modalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 2px solid var(--accent);
    background: linear-gradient(135deg, #0c4a6e 0%, #075985 100%);
    flex-shrink: 0;
}

.modal-title {
    font-size: 16.5px;
    font-weight: 800;
    color: #ffedd5;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.modal-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 15px;
    cursor: pointer;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-close:hover {
    background: #dc2626;
    color: #ffffff;
    transform: rotate(90deg);
}

.modal-body {
    padding: 20px 24px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #bae6fd #f8fafc;
}

.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #bae6fd;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f8fafc;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 14px 24px;
    border-top: 1px solid var(--border);
    background: #f8fafc;
    flex-shrink: 0;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-14px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================================================
   POPUP THÔNG BÁO KÝ DUYỆT THÀNH CÔNG (NÚT TICK VÀ CHÚC MỪNG CHUẨN MẪU)
   ========================================================================== */
.approval-success-modal {
    text-align: center;
    padding: 16px 12px 6px 12px;
    position: relative;
}

/* Khung đồ họa chứa nút tick và các đốm sao xung quanh */
.success-tick-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 16px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-tick-circle {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #0284c7 100%);
    box-shadow: 0 12px 28px -4px rgba(16, 185, 129, 0.45), 0 0 0 8px rgba(16, 185, 129, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: tickPopIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.success-tick-svg {
    width: 46px;
    height: 46px;
}

.success-tick-path {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: tickStrokeDraw 0.45s cubic-bezier(0.65, 0, 0.45, 1) 0.3s forwards;
}

/* Các ngôi sao và tia chúc mừng xung quanh giống ảnh mẫu */
.sparkle-icon {
    position: absolute;
    pointer-events: none;
    user-select: none;
    animation: sparkleFloat 1.8s ease-in-out infinite alternate;
}

.sparkle-1 { top: 0px; left: 16px; color: #ef4444; font-size: 22px; animation-delay: 0.1s; }
.sparkle-2 { top: 8px; right: 14px; color: #8b5cf6; font-size: 20px; animation-delay: 0.3s; }
.sparkle-3 { bottom: 12px; left: 12px; color: #3b82f6; font-size: 17px; animation-delay: 0.5s; }
.sparkle-4 { bottom: 8px; right: 16px; color: #f59e0b; font-size: 22px; animation-delay: 0.2s; }
.sparkle-5 { top: -6px; right: 44px; color: #10b981; font-size: 16px; animation-delay: 0.4s; }

@keyframes tickPopIn {
    0% { transform: scale(0.3) rotate(-20deg); opacity: 0; }
    70% { transform: scale(1.1) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes tickStrokeDraw {
    100% { stroke-dashoffset: 0; }
}

@keyframes sparkleFloat {
    0% { transform: translateY(0) scale(0.85); opacity: 0.7; }
    100% { transform: translateY(-5px) scale(1.15); opacity: 1; }
}

.approval-success-title {
    font-size: 24px;
    font-weight: 800;
    color: #15803d;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.approval-success-desc {
    font-size: 15px;
    color: #334155;
    line-height: 1.6;
    margin-bottom: 20px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.approval-success-badge {
    display: inline-block;
    background: #f0fdf4;
    border: 1px solid #bae6fd;
    color: #0369a1;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 22px;
}

/* ==========================================================================
   10. BIỂU MẪU NHẬP LIỆU (FORMS)
   ========================================================================== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-deep);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    background: #ffffff;
    color: var(--text-main);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-col {
    flex: 1;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin-top: 6px;
}

/* ==========================================================================
   11. THẺ THỐNG KÊ (KPI STATS CARDS)
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    background: #ffffff;
    padding: 22px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    border-top: 4px solid var(--primary);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 900;
    color: var(--primary-deep);
}

.stat-value.good { color: var(--primary); }
.stat-value.broken { color: var(--danger); }
.stat-value.borrowed { color: var(--accent-dark); }
.stat-value.avail { color: #0284c7; }

/* ==========================================================================
   12. TAB CON & THÔNG BÁO NỔI TOAST
   ========================================================================== */
.sub-tabs {
    display: flex;
    gap: 12px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 12px;
    flex-shrink: 0;
}

.sub-tab-btn {
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 700;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.sub-tab-btn:hover {
    color: var(--primary);
}

.sub-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: var(--shadow-lg);
    border-left: 5px solid var(--primary);
    font-size: 14px;
    font-weight: 600;
    min-width: 300px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.success { border-left-color: var(--primary); }
.toast.danger { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--accent); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ==========================================================================
   QUY CHUẨN IN ẤN BÁO CÁO THỐNG KÊ GIỐNG BẢNG EXCEL (@MEDIA PRINT)
   Chỉ in bảng dữ liệu kẻ ô đen trắng nét mảnh chuẩn Excel, ẩn toàn bộ giao diện thừa
   ========================================================================== */
@media print {
    @page {
        size: A4 landscape;
        margin: 12mm 10mm 12mm 10mm;
    }

    html, body {
        background: #ffffff !important;
        color: #000000 !important;
        font-family: 'Times New Roman', Times, serif !important;
        font-size: 12pt !important;
        line-height: 1.3 !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    /* Ẩn các thành phần giao diện web không liên quan đến bảng in */
    .sidebar,
    .topbar,
    .page-header,
    .page-actions,
    .sub-tabs,
    .stats-grid,
    .btn,
    .modal-overlay,
    #toast-container,
    .no-print {
        display: none !important;
    }

    /* Mở rộng không gian in cho khung chứa */
    .app-layout,
    .main-wrapper,
    .main-container,
    #main-content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        display: block !important;
    }

    /* Hiển thị tiêu đề báo cáo hành chính chuẩn khi in */
    .print-only-block {
        display: block !important;
    }

    .card {
        background: #ffffff !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 0 25px 0 !important;
        page-break-inside: auto !important;
    }

    .card-title {
        color: #000000 !important;
        font-size: 13pt !important;
        font-weight: bold !important;
        text-transform: uppercase !important;
        margin-bottom: 8px !important;
        padding: 0 0 4px 0 !important;
        border-bottom: 1.5px solid #000000 !important;
        page-break-after: avoid !important;
    }

    /* ĐỊNH DẠNG BẢNG KẺ Ô LƯỚI Y HỆT BẢNG TÍNH EXCEL */
    .table-responsive {
        overflow: visible !important;
        margin-bottom: 10px !important;
    }

    .custom-table,
    .so-table,
    .excel-print-table {
        width: 100% !important;
        min-width: 100% !important;
        border-collapse: collapse !important;
        border: 1.5px solid #000000 !important;
        margin-bottom: 15px !important;
        background: #ffffff !important;
        page-break-inside: auto !important;
    }

    .custom-table th,
    .custom-table td,
    .so-table th,
    .so-table td,
    .excel-print-table th,
    .excel-print-table td {
        border: 1px solid #000000 !important; /* Kẻ ô lưới viền đen chuẩn Excel */
        color: #000000 !important;
        padding: 6px 8px !important;
        font-size: 11pt !important;
        page-break-inside: avoid !important;
    }

    .custom-table thead th,
    .so-table thead th,
    .excel-print-table thead th {
        background-color: #f2f2f2 !important; /* Nền xám nhạt đầu cột Excel */
        font-weight: bold !important;
        text-align: center !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Triệt tiêu màu sắc của nhãn trạng thái khi in */
    .badge {
        background: transparent !important;
        border: none !important;
        color: #000000 !important;
        padding: 0 !important;
        font-weight: bold !important;
    }

    code {
        font-family: 'Times New Roman', Times, serif !important;
        color: #000000 !important;
        font-weight: bold !important;
    }

    .text-danger-bold {
        color: #000000 !important;
        font-weight: bold !important;
    }
}

/* ==========================================================================
   14. GIAO DIỆN TRANG ĐĂNG NHẬP (LOGIN PAGE)
   Được quản lý chuyên biệt và độc lập tại: /modules/auth/auth.css
   ========================================================================== */

/* ==========================================================================
   21. ĐỒNG BỘ THẺ ĐƠN VỊ VÀ NÚT BẤM NGHIỆP VỤ (GROUPS & CARDS)
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: #ffffff;
    border-radius: var(--radius);
    padding: 16px 18px;
    border: 1px solid #e2e8f0;
    border-top: 3px solid var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(6, 78, 59, 0.15);
    border-color: var(--primary);
}

.stat-card.active-group-card {
    border: 2px solid var(--primary) !important;
    border-top: 4px solid var(--primary) !important;
    background: #f0fdf4 !important;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.25) !important;
}

.btn-view-members {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--primary);
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-view-members:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* NÚT XÓA NHÓM ĐƠN VỊ TRÊN THẺ CARD (ADMIN ONLY) */
.btn-delete-group-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #dc2626;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.btn-delete-group-badge:hover {
    background: #dc2626;
    color: #ffffff;
    border-color: #b91c1c;
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.35);
}

/* CÁC CLASS NÚT XÓA DANGER PHỔ BIẾN */
.btn-danger {
    background: #dc2626;
    color: #ffffff;
    border: 1px solid #b91c1c;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: #b91c1c;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-outline-danger {
    background: transparent;
    color: #dc2626;
    border: 1px solid #f87171;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-outline-danger:hover {
    background: #dc2626;
    color: #ffffff;
    border-color: #dc2626;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
}

/* ==========================================================================
   22. THÀNH PHẦN ĐIỀU HƯỚNG DI ĐỘNG & NGĂN KÉO TRƯỢT (MOBILE RESPONSIVE DRAWER)
   ========================================================================== */

/* Nút Hamburger 3 gạch mở menu trên điện thoại */
.btn-mobile-menu-toggle {
    display: none; /* Mặc định ẩn trên máy tính */
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(2, 44, 34, 0.85);
    border: 1.5px solid rgba(251, 191, 36, 0.45);
    border-radius: 8px;
    color: #f97316;
    font-size: 22px;
    cursor: pointer;
    margin-right: 12px;
    touch-action: manipulation;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-mobile-menu-toggle:hover,
.btn-mobile-menu-toggle:active {
    background: rgba(251, 191, 36, 0.2);
    border-color: #f97316;
    transform: scale(1.05);
}

/* Nút đóng menu trên ngăn kéo điện thoại */
.btn-sidebar-close-mobile {
    display: none; /* Mặc định ẩn trên máy tính */
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-size: 16px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: auto;
    touch-action: manipulation;
    transition: all 0.2s ease;
}

.btn-sidebar-close-mobile:hover,
.btn-sidebar-close-mobile:active {
    background: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
}

/* Lớp phủ mờ phía sau ngăn kéo trên điện thoại (Backdrop) */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(2, 44, 34, 0.68);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1040;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.sidebar-backdrop.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* Khóa cuộn màn hình chính khi đang mở menu di động */
body.mobile-drawer-open {
    overflow: hidden !important;
}

/* Chữ tiêu đề CATP ĐÀ NẴNG trên Topbar khi xem di động */
.mobile-brand-title {
    display: none;
}

/* ==========================================================================
   23. QUY TẮC THÍCH ỨNG CHO THIẾT BỊ DI ĐỘNG (MEDIA QUERIES <= 768px & <= 992px)
   ========================================================================== */

@media (max-width: 992px) {
    .btn-mobile-menu-toggle {
        display: inline-flex;
    }

    .btn-sidebar-close-mobile {
        display: inline-flex;
    }

    /* LỚP PHỦ MỜ KHI MỞ MENU TRÊN ĐIỆN THOẠI (BACKDROP OVERLAY) */
    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 1040;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease, visibility 0.25s ease;
        touch-action: manipulation;
    }

    .sidebar-backdrop.active {
        opacity: 1;
        visibility: visible;
    }

    body.mobile-drawer-open {
        overflow: hidden !important;
    }

    /* CHUYỂN SIDEBAR THÀNH NGĂN KÉO TRƯỢT (OFF-CANVAS DRAWER) */
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 290px !important;
        max-width: 86vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        padding-top: var(--safe-top) !important;
        padding-bottom: var(--safe-bottom) !important;
        padding-left: var(--safe-left) !important;
        z-index: 1050 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
        box-shadow: none !important;
    }

    .sidebar.mobile-open {
        transform: translateX(0) !important;
        box-shadow: 12px 0 35px rgba(0, 0, 0, 0.5) !important;
    }

    /* VÙNG LÀM VIỆC CHÍNH DÀNH TRỌN 100% DIỆN TÍCH */
    .main-wrapper {
        max-width: 100vw !important;
        width: 100vw !important;
        flex: 1 !important;
        min-width: 0 !important;
        height: 100% !important;
        max-height: 100% !important;
    }

    /* THANH TIÊU ĐỀ TOPBAR THÍCH ỨNG TINH GỌN TRÊN ĐIỆN THOẠI & SAFE AREA TAI THỎ */
    .topbar {
        height: calc(54px + var(--safe-top)) !important;
        padding: var(--safe-top) max(8px, var(--safe-right)) 0 max(8px, var(--safe-left)) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 6px !important;
    }

    .topbar-left {
        gap: 6px !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        align-items: center !important;
        display: flex !important;
    }

    .btn-mobile-menu-toggle {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
        padding: 0 !important;
        border-radius: 8px !important;
        flex-shrink: 0 !important;
        touch-action: manipulation !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* THANH TÌM KIẾM TRÊN TOPBAR MOBILE: TINH GỌN, ẨN CTRL K ĐÈ CHỮ */
    .topbar-search-wrapper {
        flex: 1 1 auto !important;
        max-width: clamp(120px, 38vw, 210px) !important;
        min-width: 0 !important;
    }

    .topbar-search-wrapper:focus-within {
        max-width: clamp(150px, 50vw, 260px) !important;
    }

    .topbar-search-shortcut {
        display: none !important; /* Ẩn phím tắt Ctrl K trên điện thoại để không đè vào chữ placeholder */
    }

    .topbar-search-input {
        height: 36px !important;
        padding: 0 10px 0 32px !important;
        font-size: 12.5px !important;
        border-radius: 8px !important;
    }

    .topbar-search-icon {
        left: 10px !important;
        font-size: 14px !important;
    }

    .mobile-brand-title {
        display: none !important;
    }

    .topbar-center-fitness,
    .topbar-brand-divider,
    .topbar-center-widget {
        display: none !important;
    }

    .topbar-user-section {
        gap: 6px !important;
        margin-left: auto !important;
        align-items: center !important;
        flex-shrink: 0 !important;
        display: flex !important;
    }

    /* Thẻ tài khoản gọn gàng trên mobile: Ẩn vai trò dài, chống tràn mép phải */
    .user-profile-card {
        padding: 3px 6px 3px 4px !important;
        gap: 5px !important;
        max-width: clamp(100px, 30vw, 135px) !important;
        min-height: 36px !important;
        height: 36px !important;
        border-radius: 8px !important;
    }

    .user-avatar-wrapper {
        width: 28px !important;
        height: 28px !important;
        flex-shrink: 0 !important;
    }

    .user-avatar-circle {
        font-size: 12px !important;
    }

    .user-fullname {
        max-width: clamp(48px, 16vw, 75px) !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        font-size: 12px !important;
        font-weight: 700 !important;
    }

    /* Ẩn dòng chức vụ dài trên thanh topbar, người dùng xem chi tiết bằng cách chạm vào mở dropdown */
    .user-meta-sub {
        display: none !important;
    }

    .user-dropdown-arrow svg {
        width: 10px !important;
        height: 10px !important;
    }

    .btn-topbar-bell {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        font-size: 15px !important;
        flex-shrink: 0 !important;
    }

    /* BẢNG THÔNG BÁO THẢ XUỐNG CÂN ĐỐI TRÊN DI ĐỘNG (CHỐNG TRÀN VÀ CẮT MÉP TRÁI) */
    .topbar-notification-dropdown {
        position: fixed !important;
        top: 64px !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        max-width: calc(100vw - 20px) !important;
        max-height: calc(100dvh - 76px) !important;
        border-radius: 14px !important;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.12) !important;
        z-index: 9999 !important;
    }

    .notif-dropdown-title {
        font-size: 12px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .notif-dropdown-header {
        padding: 10px 14px !important;
    }

    /* BẢNG TÙY CHỌN TÀI KHOẢN THẢ XUỐNG TRÊN DI ĐỘNG */
    .topbar-account-dropdown {
        position: fixed !important;
        top: 64px !important;
        left: auto !important;
        right: 10px !important;
        width: 290px !important;
        max-width: calc(100vw - 20px) !important;
        max-height: calc(100dvh - 76px) !important;
        border-radius: 14px !important;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.12) !important;
        z-index: 9999 !important;
    }

    .btn-topbar-logout {
        padding: 6px 10px !important;
        font-size: 12px !important;
    }

    .btn-topbar-logout .logout-text {
        display: none; /* Chỉ hiển thị icon cửa thoát hiểm để tiết kiệm diện tích */
    }

    .btn-topbar-logout .logout-icon {
        font-size: 15px;
        display: inline-block;
    }

    /* PHẦN THÂN NỘI DUNG: Bổ sung khoảng đệm an toàn, chống tràn ngang và tối ưu diện tích hiển thị trên điện thoại */
    .main-container {
        padding: 8px 6px calc(75px + var(--safe-bottom, 0px)) 6px !important;
        overflow-x: hidden !important;
        max-width: 100vw !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* TIÊU ĐỀ TRANG VÀ NÚT TÁC VỤ */
    .page-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .page-title {
        font-size: 17px !important;
        line-height: 1.3 !important;
    }

    /* Nút tác vụ dàn đều 50-50 gọn gàng, không bị 1 nút chiếm 1 dòng to tướng */
    .page-actions,
    .header-actions {
        width: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .page-actions button,
    .page-actions .btn,
    .header-actions button,
    .header-actions .btn {
        flex: 1 1 calc(50% - 6px) !important;
        min-height: 42px !important;
        justify-content: center !important;
        font-size: 13px !important;
        text-align: center !important;
        white-space: nowrap !important;
        padding: 8px 10px !important;
        touch-action: manipulation;
    }

    /* BỘ LỌC TRẠNG THÁI CHIA LƯỚI 2x2 CÂN ĐỐI TRÊN DI ĐỘNG */
    .filter-status-buttons {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        width: 100% !important;
        gap: 8px !important;
    }

    .filter-status-buttons .btn {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
        padding: 8px 6px !important;
        font-size: 12.5px !important;
    }

    /* THANH TAB CON TRƯỢT NGANG CHỐNG TRÀN TRÊN ĐIỆN THOẠI */
    .sub-tabs {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        white-space: nowrap !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        padding-bottom: 4px !important;
        scrollbar-width: none !important;
    }

    .sub-tabs::-webkit-scrollbar {
        display: none !important;
    }

    .sub-tab-btn {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        font-size: 13px !important;
        padding: 9px 12px !important;
    }

    /* ============================================================
       TỰ ĐỘNG CHUYỂN ĐỔI TOÀN BỘ BẢNG DỮ LIỆU THÀNH GIAO DIỆN THẺ (CARD VIEW)
       TRÊN ĐIỆN THOẠI DI ĐỘNG & MÁY TÍNH BẢNG NHỎ (MOBILE RESPONSIVE <= 992px)
       Áp dụng cho 100% bảng trong tất cả các module
       ============================================================ */
    
    /* Ẩn dòng nhắc vuốt ngang vì giao diện đã chuyển sang Card cuộn dọc 1 tay tự nhiên */
    .mobile-scroll-hint {
        display: none !important;
    }

    .table-responsive {
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
        border: none !important;
        background: transparent !important;
        padding: 0 !important;
        margin-bottom: 12px !important;
    }

    .table-responsive table,
    table.custom-table,
    table.so-table,
    table.personal-table,
    table.tasks-table,
    table.biz-table,
    table.doc-directives-table,
    table.doc-promulgated-table,
    table.doc-biz-requests-table,
    table.leave-tasks-review-table {
        display: block !important;
        width: 100% !important;
        min-width: 100% !important;
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    /* Ẩn hoàn toàn hàng tiêu đề thead trên điện thoại */
    .table-responsive table thead,
    table.custom-table thead,
    table.so-table thead,
    table.personal-table thead,
    table.tasks-table thead,
    table.biz-table thead,
    table.doc-directives-table thead,
    table.doc-promulgated-table thead,
    table.doc-biz-requests-table thead,
    table.leave-tasks-review-table thead {
        display: none !important;
    }

    .table-responsive table tbody,
    table.custom-table tbody,
    table.so-table tbody,
    table.personal-table tbody,
    table.tasks-table tbody,
    table.biz-table tbody,
    table.doc-directives-table tbody,
    table.doc-promulgated-table tbody,
    table.doc-biz-requests-table tbody,
    table.leave-tasks-review-table tbody {
        display: flex !important;
        flex-direction: column !important;
        gap: 14px !important;
        width: 100% !important;
    }

    /* MỖI DÒNG DỮ LIỆU (TR) BIẾN THÀNH MỘT KHỐI THẺ (CARD CONTAINER) ĐỘC LẬP */
    .table-responsive table tbody tr,
    table.custom-table tbody tr,
    table.so-table tbody tr,
    table.personal-table tbody tr,
    table.tasks-table tbody tr,
    table.biz-table tbody tr,
    table.doc-directives-table tbody tr,
    table.doc-promulgated-table tbody tr,
    table.doc-biz-requests-table tbody tr,
    table.leave-tasks-review-table tbody tr {
        display: flex !important;
        flex-direction: column !important;
        background: #ffffff !important;
        border: 1.5px solid #e2e8f0 !important;
        border-radius: 14px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02) !important;
        padding: 12px 14px !important;
        margin: 0 !important;
        position: relative !important;
        overflow: hidden !important;
        transition: transform 0.15s ease, box-shadow 0.15s ease !important;
    }

    .table-responsive table tbody tr:active,
    table.custom-table tbody tr:active,
    table.so-table tbody tr:active,
    table.personal-table tbody tr:active,
    table.tasks-table tbody tr:active {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
        transform: translateY(-1px) !important;
    }

    /* CÁC Ô THÔNG TIN (TD) TRONG THẺ: BỐ TRÍ NHÃN TRÁI - DỮ LIỆU PHẢI */
    .table-responsive table td,
    table.custom-table td,
    table.so-table td,
    table.personal-table td,
    table.tasks-table td,
    table.biz-table td,
    table.doc-directives-table td,
    table.doc-promulgated-table td,
    table.doc-biz-requests-table td,
    table.leave-tasks-review-table td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 8px 0 !important;
        border: none !important;
        border-bottom: 1px dashed #f1f5f9 !important;
        font-size: 13.5px !important;
        line-height: 1.4 !important;
        text-align: right !important;
        word-break: break-word !important;
        overflow-wrap: anywhere !important;
    }

    /* HIỂN THỊ NHÃN TỰ ĐỘNG TỪ THUỘC TÍNH data-label */
    .table-responsive table td::before,
    table.custom-table td::before,
    table.so-table td::before,
    table.personal-table td::before,
    table.tasks-table td::before,
    table.biz-table td::before,
    table.doc-directives-table td::before,
    table.doc-promulgated-table td::before,
    table.doc-biz-requests-table td::before,
    table.leave-tasks-review-table td::before,
    table.doc-files-table td::before {
        content: attr(data-label);
        font-weight: 600 !important;
        font-size: 13px !important;
        color: #64748b !important;
        text-transform: none !important; /* Không in hoa toàn bộ để chống bẻ gãy dòng chữ tiếng Việt */
        letter-spacing: 0.2px !important;
        text-align: left !important;
        margin-right: 12px !important;
        flex-shrink: 0 !important;
        max-width: 50% !important;
        white-space: normal !important;
        line-height: 1.35 !important;
    }

    /* Ô NỘI DUNG DÀI TRONG THẺ (GHI CHÚ, TRÍCH YẾU, NỘI DUNG, LÝ DO, DANH SÁCH THÀNH VIÊN) */
    .table-responsive table td.card-full-cell,
    table.custom-table td.card-full-cell,
    table.so-table td.card-full-cell,
    table.personal-table td.card-full-cell,
    table.tasks-table td.card-full-cell,
    table.biz-table td.card-full-cell,
    table.doc-directives-table td.card-full-cell,
    table.doc-promulgated-table td.card-full-cell,
    table.doc-biz-requests-table td.card-full-cell,
    table.leave-tasks-review-table td.card-full-cell,
    table.doc-files-table td.card-full-cell {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        text-align: left !important;
        gap: 4px !important;
        width: 100% !important;
        padding: 8px 0 !important;
    }

    .table-responsive table td.card-full-cell::before,
    table.custom-table td.card-full-cell::before,
    table.so-table td.card-full-cell::before,
    table.personal-table td.card-full-cell::before,
    table.tasks-table td.card-full-cell::before,
    table.biz-table td.card-full-cell::before,
    table.doc-directives-table td.card-full-cell::before,
    table.doc-promulgated-table td.card-full-cell::before,
    table.doc-biz-requests-table td.card-full-cell::before,
    table.leave-tasks-review-table td.card-full-cell::before,
    table.doc-files-table td.card-full-cell::before {
        margin-bottom: 2px !important;
        margin-right: 0 !important;
        max-width: 100% !important;
    }

    /* ĐỊNH DẠNG Ô SỐ THỨ TỰ (STT): HUY HIỆU GỌN GÀNG ĐẦU THẺ */
    .table-responsive table td.card-stt-cell,
    .table-responsive table td[data-label="STT"],
    table.custom-table td.card-stt-cell,
    table.custom-table td[data-label="STT"],
    table.so-table td.card-stt-cell,
    table.so-table td[data-label="STT"],
    table.personal-table td.card-stt-cell,
    table.tasks-table td.card-stt-cell,
    table.doc-files-table td.card-stt-cell {
        display: inline-flex !important;
        align-self: flex-start !important;
        align-items: center !important;
        background: #f1f5f9 !important;
        color: #334155 !important;
        padding: 3px 9px !important;
        border-radius: 6px !important;
        font-weight: 700 !important;
        font-size: 12px !important;
        border: 1px solid #e2e8f0 !important;
        margin-bottom: 6px !important;
        white-space: nowrap !important;
    }

    .table-responsive table td.card-stt-cell::before,
    .table-responsive table td[data-label="STT"]::before,
    table.custom-table td.card-stt-cell::before,
    table.custom-table td[data-label="STT"]::before,
    table.so-table td.card-stt-cell::before,
    table.so-table td[data-label="STT"]::before,
    table.personal-table td.card-stt-cell::before,
    table.tasks-table td.card-stt-cell::before,
    table.doc-files-table td.card-stt-cell::before {
        content: "#" !important;
        color: #0284c7 !important;
        font-size: 12px !important;
        font-weight: 800 !important;
        margin-right: 3px !important;
        white-space: nowrap !important;
    }

    /* ĐỊNH DẠNG TIÊU ĐỀ NỔI BẬT TRÊN THẺ (TÊN THIẾT BỊ / THÀNH VIÊN / NHIỆM VỤ / VĂN BẢN) */
    .table-responsive table td.card-title-cell,
    table.custom-table td.card-title-cell,
    table.so-table td.card-title-cell,
    table.personal-table td.card-title-cell,
    table.tasks-table td.card-title-cell,
    table.biz-table td.card-title-cell,
    table.doc-directives-table td.card-title-cell,
    table.doc-promulgated-table td.card-title-cell,
    table.doc-biz-requests-table td.card-title-cell,
    table.leave-tasks-review-table td.card-title-cell,
    table.doc-files-table td.card-title-cell {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        text-align: left !important;
        gap: 6px !important;
        width: calc(100% + 28px) !important;
        box-sizing: border-box !important;
        font-size: 15px !important;
        font-weight: 800 !important;
        color: #1e3a8a !important;
        background: #f8fafc !important;
        margin: 4px -14px 10px -14px !important;
        padding: 10px 14px !important;
        border: none !important;
        border-top: 1px solid #f1f5f9 !important;
        border-bottom: 1.5px solid #e2e8f0 !important;
        border-left: 4px solid #1e3a8a !important;
        line-height: 1.45 !important;
    }

    .table-responsive table td.card-title-cell a,
    table.custom-table td.card-title-cell a,
    table.so-table td.card-title-cell a,
    table.personal-table td.card-title-cell a,
    table.tasks-table td.card-title-cell a,
    table.doc-files-table td.card-title-cell a {
        font-size: 15px !important;
        color: #1e3a8a !important;
        text-decoration: none !important;
        word-break: break-word !important;
    }

    .table-responsive table td.card-title-cell::before,
    table.custom-table td.card-title-cell::before,
    table.so-table td.card-title-cell::before,
    table.personal-table td.card-title-cell::before,
    table.tasks-table td.card-title-cell::before,
    table.biz-table td.card-title-cell::before,
    table.doc-directives-table td.card-title-cell::before,
    table.doc-promulgated-table td.card-title-cell::before,
    table.doc-biz-requests-table td.card-title-cell::before,
    table.leave-tasks-review-table td.card-title-cell::before,
    table.doc-files-table td.card-title-cell::before {
        display: none !important;
    }

    /* Các phần tử tệp đính kèm và khối văn bản bên trong tiêu đề tự động xếp thành hàng riêng thoáng đãng */
    .card-title-cell > div {
        width: 100% !important;
        text-align: left !important;
    }

    .card-title-cell > div:first-child {
        font-size: 15px !important;
        font-weight: 800 !important;
        color: #1e3a8a !important;
        line-height: 1.45 !important;
        margin-bottom: 2px !important;
    }

    /* Định dạng chung cho mọi dải tệp đính kèm trên di động: dàn đều 100% bề ngang, không bị bóp nghẹt */
    .table-responsive table td.card-title-cell div[style*="background: #eff6ff"],
    .table-responsive table td.card-full-cell div[style*="background: #eff6ff"],
    table.custom-table td.card-title-cell div[style*="background: #eff6ff"],
    table.custom-table td.card-full-cell div[style*="background: #eff6ff"],
    .table-responsive table [class*="file-badge"],
    table.custom-table [class*="file-badge"] {
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        padding: 6px 10px !important;
        border-radius: 6px !important;
        margin-top: 6px !important;
        box-sizing: border-box !important;
        word-break: break-all !important;
    }

    .table-responsive table td.card-title-cell div[style*="background: #eff6ff"] span,
    .table-responsive table td.card-full-cell div[style*="background: #eff6ff"] span,
    table.custom-table td.card-title-cell div[style*="background: #eff6ff"] span,
    table.custom-table td.card-full-cell div[style*="background: #eff6ff"] span {
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        font-size: 12px !important;
    }

    /* Ẩn các ô giá trị rỗng hoặc chỉ chứa dấu gạch ngang '—' trên di động để thẻ Card gọn gàng */
    .table-responsive table td.card-empty-cell,
    table.custom-table td.card-empty-cell,
    table.so-table td.card-empty-cell,
    table.personal-table td.card-empty-cell,
    table.tasks-table td.card-empty-cell,
    table.biz-table td.card-empty-cell,
    table.doc-directives-table td.card-empty-cell,
    table.doc-promulgated-table td.card-empty-cell,
    table.doc-biz-requests-table td.card-empty-cell,
    table.leave-tasks-review-table td.card-empty-cell,
    table.doc-files-table td.card-empty-cell {
        display: none !important;
    }

    /* ĐỊNH DẠNG THANH HÀNH ĐỘNG NÚT BẤM DƯỚI ĐÁY THẺ */
    .table-responsive table td.card-actions-cell,
    table.custom-table td.card-actions-cell,
    table.custom-table td[data-label="Thao tác"],
    table.custom-table td[data-label="Thao tác phê duyệt"],
    table.so-table td.card-actions-cell,
    table.personal-table td.card-actions-cell,
    table.tasks-table td.card-actions-cell,
    table.doc-files-table td.card-actions-cell {
        display: flex !important;
        justify-content: stretch !important;
        gap: 8px !important;
        border: none !important;
        border-top: 1px solid #e2e8f0 !important;
        border-bottom: none !important;
        padding-top: 10px !important;
        margin-top: 6px !important;
        width: 100% !important;
    }

    .table-responsive table td.card-actions-cell::before,
    table.custom-table td.card-actions-cell::before,
    table.custom-table td[data-label="Thao tác"]::before,
    table.custom-table td[data-label="Thao tác phê duyệt"]::before,
    table.so-table td.card-actions-cell::before,
    table.personal-table td.card-actions-cell::before,
    table.tasks-table td.card-actions-cell::before,
    table.doc-files-table td.card-actions-cell::before {
        display: none !important;
    }

    .table-responsive table td.card-actions-cell .btn,
    table.custom-table td.card-actions-cell .btn,
    table.custom-table td[data-label="Thao tác"] .btn,
    table.custom-table td[data-label="Thao tác phê duyệt"] .btn,
    table.so-table td.card-actions-cell .btn,
    table.personal-table td.card-actions-cell .btn,
    table.tasks-table td.card-actions-cell .btn,
    table.doc-files-table td.card-actions-cell .btn {
        flex: 1 1 0 !important;
        min-height: 40px !important;
        font-size: 13px !important;
        font-weight: 700 !important;
        justify-content: center !important;
        text-align: center !important;
        padding: 8px 12px !important;
        border-radius: 8px !important;
    }

    /* DÒNG THÔNG BÁO DỮ LIỆU TRỐNG (COLSPAN) VÀ ẨN DÒNG TRỐNG SỔ GIẤY */
    .table-empty-row td,
    .table-responsive table td[colspan],
    table.custom-table td[colspan],
    table.so-table td[colspan],
    table.personal-table td[colspan],
    table.tasks-table td[colspan] {
        display: block !important;
        text-align: center !important;
        border: none !important;
        padding: 24px 12px !important;
        color: #94a3b8 !important;
        font-style: italic !important;
    }

    .table-empty-row td::before,
    .table-responsive table td[colspan]::before,
    table.custom-table td[colspan]::before,
    table.so-table td[colspan]::before,
    table.personal-table td[colspan]::before,
    table.tasks-table td[colspan]::before {
        display: none !important;
    }

    .so-empty-row {
        display: none !important; /* Ẩn các dòng kẻ trống dùng in ấn khi xem trên điện thoại */
    }

    /* BỐ CỤC LƯỚI THẺ CARD THỐNG KÊ CO VỀ 1 HOẶC 2 CỘT TÙY ĐỘ RỘNG MÀN HÌNH */
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
        gap: 10px !important;
    }

    /* Ẩn bộ chọn Đội của Admin trên Topbar khi xem mobile để chống che lấp tiêu đề và avatar */
    .topbar-admin-group-bar {
        display: none !important;
    }

    /* FORM ROW VÀ CỘT TRONG HỘP THOẠI MODAL TRÊN DI ĐỘNG */
    .form-row {
        flex-direction: column !important;
        gap: 0 !important;
    }

    .form-col {
        width: 100% !important;
        flex: none !important;
    }

    /* Các nút bấm dài trong Modal cho phép tự xuống dòng, không bị cắt chữ */
    .modal-body .btn,
    .modal-content .btn,
    #cr-device-details-box .btn {
        white-space: normal !important;
        word-break: break-word !important;
        line-height: 1.35 !important;
        height: auto !important;
        padding: 10px 14px !important;
        font-size: 13.5px !important;
    }

    /* HỘP THOẠI POPUP MODAL CO GIÃN THÔNG MINH TRÊN DI ĐỘNG */
    .modal-overlay {
        padding: max(10px, var(--safe-top)) max(10px, var(--safe-right)) max(10px, var(--safe-bottom)) max(10px, var(--safe-left)) !important;
    }

    .modal-content {
        width: min(96vw, 760px) !important;
        max-width: 96vw !important;
        max-height: calc(100dvh - 20px - var(--safe-top) - var(--safe-bottom)) !important;
        margin: auto !important;
        overscroll-behavior: contain !important;
        border-radius: 16px !important;
    }

    .modal-header {
        padding: 12px 14px !important;
        display: flex !important;
        align-items: flex-start !important;
        justify-content: space-between !important;
        gap: 10px !important;
    }

    .modal-title {
        font-size: clamp(13px, 3.2vw, 15.5px) !important;
        line-height: 1.35 !important;
        flex: 1 !important;
        min-width: 0 !important;
        word-break: break-word !important;
        overflow-wrap: anywhere !important;
        margin: 0 !important;
    }

    .modal-close {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 16px !important;
        border-radius: 50% !important;
        background: rgba(255, 255, 255, 0.2) !important;
        color: #ffffff !important;
        flex-shrink: 0 !important;
        margin-top: 1px !important;
        touch-action: manipulation !important;
        cursor: pointer !important;
    }

    .modal-body {
        padding: 14px 12px calc(26px + var(--safe-bottom, 0px)) 12px !important;
        max-height: calc(100dvh - 120px - var(--safe-top) - var(--safe-bottom)) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        box-sizing: border-box !important;
    }

    /* Các lưới form nội bộ trong modal tự động chuyển sang 1 cột trên điện thoại */
    .modal-body [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    .modal-footer {
        padding: 10px 14px !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .modal-footer .btn {
        flex: 1 1 calc(50% - 4px) !important;
        min-height: 42px !important;
    }

    /* NÚT BẤM VÀ Ô NHẬP LIỆU ĐẠT CHUẨN THAO TÁC CẢM ỨNG (TOUCH-FRIENDLY >= 42px) */
    .form-control,
    .form-group input,
    .form-group select,
    .form-group textarea,
    input.form-control,
    select.form-control {
        min-height: 42px !important;
        font-size: 16px !important; /* Chuẩn 16px chống hiện tượng Safari trên iPhone tự động phóng to (auto-zoom) */
    }

    .btn,
    .btn-submit,
    .btn-approve,
    .btn-reject,
    .btn-borrow {
        min-height: 42px !important;
        touch-action: manipulation;
    }

    /* FLYOUT PANEL TRONG SIDEBAR THU GỌN VÀO TRONG MENU TRÊN DI ĐỘNG */
    .sidebar-flyout-panel {
        position: static !important;
        width: 100% !important;
        box-shadow: none !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        background: rgba(3, 40, 32, 0.95) !important;
        color: #ffffff !important;
        margin-top: 8px !important;
        display: none !important;
    }

    .sidebar-item.has-flyout.expanded .sidebar-flyout-panel {
        display: block !important;
    }

    .flyout-title-compact {
        color: #f97316 !important;
    }

    .flyout-category-item {
        background: rgba(255, 255, 255, 0.06) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    .flyout-category-item:hover,
    .flyout-category-item:active {
        background: rgba(251, 191, 36, 0.15) !important;
    }

    .cat-name {
        color: #ffedd5 !important;
    }
}

/* =========================================================================
   1. THANH TIẾN TRÌNH TOÀN CỤC BẤT ĐỒNG BỘ (GLOBAL TOP PROGRESS BAR)
   ========================================================================= */
.top-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #10b981, #06b6d4, #3b82f6);
    z-index: 999999;
    transition: width 0.25s ease, opacity 0.2s ease;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.8), 0 0 5px rgba(6, 182, 212, 0.5);
    pointer-events: none;
    opacity: 0;
}

/* =========================================================================
   2. HỆ THỐNG KIỂU DÁNG CHO SVG VECTOR ICONS NỘI BỘ
   ========================================================================= */
.app-icon {
    display: inline-flex;
    vertical-align: middle;
    flex-shrink: 0;
    stroke-width: 2px;
    transition: transform 0.15s ease, stroke 0.15s ease;
}

.btn .app-icon {
    margin-right: 6px;
}

.btn-sm .app-icon {
    margin-right: 4px;
}

.btn-icon-only {
    padding: 8px !important;
    width: 38px;
    height: 38px;
    justify-content: center;
    align-items: center;
    display: inline-flex;
}

.btn-icon-only .app-icon {
    margin-right: 0 !important;
}

.badge .app-icon {
    margin-right: 4px;
}

.stat-icon .app-icon {
    margin-right: 0 !important;
}

.menu-icon .app-icon {
    margin-right: 0 !important;
}

/* =========================================================================
   3. HIỆU ỨNG ĐỘNG (ANIMATIONS) CHO ASYNC & LOADING FEEDBACK
   ========================================================================= */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin-animate {
    animation: spin 0.85s linear infinite !important;
}

.loader-spinner {
    width: 38px;
    height: 38px;
    border: 3.5px solid #e2e8f0;
    border-top-color: var(--primary, #0284c7);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-shimmer {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%) !important;
    background-size: 200% 100% !important;
    animation: shimmer 1.5s infinite !important;
    border-radius: 8px !important;
    color: transparent !important;
    pointer-events: none !important;
}

/* Nút bấm khi đang nạp bất đồng bộ: khóa thao tác và giảm độ sáng */
.btn-loading {
    opacity: 0.75 !important;
    cursor: wait !important;
    pointer-events: none !important;
}

/* =========================================================================
   4. AUTO-RESPONSIVE BẢO VỆ MỌI ĐỘ PHÂN GIẢI (TABLET, PHABLET, DESKTOP)
   ========================================================================= */
/* Lưới thống kê tự động co giãn thông minh không góc chết */
.stats-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
    gap: 16px !important;
    margin-bottom: 20px !important;
}

/* Khung modal tự động tương thích từ màn hình nhỏ nhất đến lớn nhất */
.modal-overlay {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-content {
    width: min(94vw, 760px) !important;
    max-height: 90dvh !important;
    display: flex !important;
    flex-direction: column !important;
}

.modal-body {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

/* Tự động ngắt dòng và co giãn nút bấm cho bảng nút điều hướng */
.page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

/* =========================================================================
   5. ĐỒNG BỘ ĐƯỜNG KẺ PHÂN CÁCH BẢNG TOÀN HỆ THỐNG (TABLE GRID LINES)
   Chuẩn văn bản hành chính & bảng biểu: đường viền rõ nét, phân cách từng ô
   ========================================================================= */
.table-responsive table,
table.custom-table,
table.personal-table,
table.tasks-table,
table.biz-table,
table.doc-directives-table,
table.doc-promulgated-table,
table.doc-biz-requests-table,
table.leave-tasks-review-table,
table.so-table,
table.excel-table {
    border-collapse: collapse !important;
    border: 1.5px solid #cbd5e1 !important;
    background-color: #ffffff;
}

.table-responsive table th,
.table-responsive table td,
table.custom-table th,
table.custom-table td,
table.personal-table th,
table.personal-table td,
table.tasks-table th,
table.tasks-table td,
table.biz-table th,
table.biz-table td,
table.doc-directives-table th,
table.doc-directives-table td,
table.doc-promulgated-table th,
table.doc-promulgated-table td,
table.doc-biz-requests-table th,
table.doc-biz-requests-table td,
table.leave-tasks-review-table th,
table.leave-tasks-review-table td {
    border: 1px solid #cbd5e1 !important;
}

.table-responsive table th,
table.custom-table th,
table.personal-table th,
table.tasks-table th,
table.biz-table th,
table.doc-directives-table th,
table.doc-promulgated-table th,
table.doc-biz-requests-table th,
table.leave-tasks-review-table th {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
    font-weight: 700 !important;
    border-bottom: 2px solid #94a3b8 !important;
}

.table-responsive table tbody tr:hover,
table.custom-table tbody tr:hover,
table.personal-table tbody tr:hover,
table.tasks-table tbody tr:hover,
table.biz-table tbody tr:hover,
table.doc-directives-table tbody tr:hover,
table.doc-promulgated-table tbody tr:hover,
table.doc-biz-requests-table tbody tr:hover {
    background-color: #f8fafc !important;
}

/* =========================================================================
   14. BỘ CHỌN ĐỘI TOÀN CỤC CHO ADMIN (GLOBAL ADMIN TEAM SWITCHER)
   ========================================================================= */
.topbar-admin-group-bar {
    display: flex;
    align-items: center;
    margin: 0 16px;
}

.admin-group-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fffbeb;
    border: 1.5px solid #fde68a;
    padding: 4px 10px;
    border-radius: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.admin-group-pill:hover {
    border-color: #f59e0b;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.15);
}

.admin-group-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.admin-group-label {
    font-size: 13px;
    font-weight: 700;
    color: #92400e;
    white-space: nowrap;
}

.admin-group-select {
    padding: 4px 10px;
    font-size: 13px;
    font-weight: 700;
    color: #1e3a8a;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 16px;
    outline: none;
    cursor: pointer;
    max-width: 260px;
    transition: border-color 0.2s ease;
}

.admin-group-select:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn-admin-group-clear {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-admin-group-clear:hover {
    background: #ef4444;
    color: #ffffff;
}

/* =========================================================================
   15. MÀN HÌNH HƯỚNG DẪN CHỌN ĐỘI CHO ADMIN (SELECT TEAM PROMPT SCREEN)
   ========================================================================= */
.admin-select-group-screen {
    max-width: 900px;
    margin: 30px auto;
    padding: 30px 24px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.admin-prompt-hero {
    margin-bottom: 28px;
}

.prompt-icon-badge {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: #fef3c7;
    border: 2px solid #fde68a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.prompt-title {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prompt-subtitle {
    font-size: 14px;
    color: #475569;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.admin-group-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 24px;
    text-align: left;
}

.admin-group-card-choice {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 18px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.admin-group-card-choice:hover {
    background: #ffffff;
    border-color: #0284c7;
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(5, 150, 105, 0.15);
}

.choice-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #e0f2fe;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.choice-card-name {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
    line-height: 1.35;
}

.choice-card-sub {
    font-size: 12.5px;
    color: #64748b;
    margin-bottom: 14px;
    line-height: 1.4;
}

.choice-card-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 700;
    color: #0284c7;
    padding-top: 10px;
    border-top: 1px dashed #cbd5e1;
}

/* Thẻ chỉ báo Đang xem Đội trên các trang */
.admin-current-group-banner {
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    padding: 10px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-current-group-text {
    font-size: 13.5px;
    color: #0369a1;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* =========================================================================
   16. BẢO VỆ CHỐNG ĐÈ VIỀN BẢNG TRÊN THIẾT BỊ DI ĐỘNG (MOBILE CARD VIEW SHIELD)
   ========================================================================= */
@media (max-width: 992px) {
    /* Đảm bảo bảng không dính border-collapse hay viền khung của desktop */
    .table-responsive table,
    table.custom-table,
    table.so-table,
    table.personal-table,
    table.tasks-table,
    table.biz-table,
    table.doc-directives-table,
    table.doc-promulgated-table,
    table.doc-biz-requests-table,
    table.leave-tasks-review-table,
    table.doc-files-table {
        border-collapse: separate !important;
        border-spacing: 0 !important;
        border: none !important;
        background: transparent !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    /* Triệt tiêu 100% viền xám đóng hộp của desktop, chỉ dùng đường phân cách mờ tinh tế */
    .table-responsive table td,
    table.custom-table td,
    table.so-table td,
    table.personal-table td,
    table.tasks-table td,
    table.biz-table td,
    table.doc-directives-table td,
    table.doc-promulgated-table td,
    table.doc-biz-requests-table td,
    table.leave-tasks-review-table td,
    table.doc-files-table td {
        border: none !important;
        border-bottom: 1px dashed #f1f5f9 !important;
        padding: 8px 0 !important;
    }

    /* Bỏ đường phân cách ở hàng cuối cùng của thẻ */
    .table-responsive table tbody tr td:last-child,
    table.custom-table tbody tr td:last-child,
    table.so-table tbody tr td:last-child,
    table.personal-table tbody tr td:last-child,
    table.tasks-table tbody tr td:last-child,
    table.biz-table tbody tr td:last-child,
    table.doc-directives-table tbody tr td:last-child,
    table.doc-promulgated-table tbody tr td:last-child,
    table.doc-biz-requests-table tbody tr td:last-child,
    table.leave-tasks-review-table tbody tr td:last-child,
    table.doc-files-table tbody tr td:last-child {
        border-bottom: none !important;
    }

    /* Thẻ Card bao bọc: nền trắng sáng, bo góc 12px, bóng đổ dịu mắt, viền ngoài sạch sẽ */
    .table-responsive table tbody tr:not(.table-empty-row):not(.so-empty-row),
    table.custom-table tbody tr:not(.table-empty-row):not(.so-empty-row),
    table.so-table tbody tr:not(.table-empty-row):not(.so-empty-row),
    table.personal-table tbody tr:not(.table-empty-row):not(.so-empty-row),
    table.tasks-table tbody tr:not(.table-empty-row):not(.so-empty-row),
    table.biz-table tbody tr:not(.table-empty-row):not(.so-empty-row),
    table.doc-directives-table tbody tr:not(.table-empty-row):not(.so-empty-row),
    table.doc-promulgated-table tbody tr:not(.table-empty-row):not(.so-empty-row),
    table.doc-biz-requests-table tbody tr:not(.table-empty-row):not(.so-empty-row),
    table.leave-tasks-review-table tbody tr:not(.table-empty-row):not(.so-empty-row),
    table.doc-files-table tbody tr:not(.table-empty-row):not(.so-empty-row) {
        border: 1px solid #e2e8f0 !important;
        border-radius: 12px !important;
        background: #ffffff !important;
        padding: 12px 14px !important;
        margin-bottom: 12px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
    }
}

/* ==========================================================================
   THANH PHÂN TRANG CHUẨN DÙNG CHUNG TOÀN HỆ THỐNG (UNIFIED PAGINATION SYSTEM)
   ========================================================================== */
.app-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 16px;
    border: 1.5px solid #cbd5e1;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
    border-radius: 0 0 8px 8px;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}

.app-pagination-info {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.app-pagination-pages {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.app-page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s ease;
    user-select: none;
}

.app-page-btn:hover:not(:disabled) {
    background: #f0f9ff;
    border-color: #10b981;
    color: #0369a1;
}

.app-page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.3);
}

.app-page-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #94a3b8;
}

@media (max-width: 768px) {
    .app-pagination {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
        padding: 10px;
    }
}

/* =========================================================================
   QUY CHUẨN BỘ LỌC VÀ KHUNG CHỌN NGÀY CHUẨN VIỆT NAM (VNDATEPICKER UI)
   ========================================================================= */
.doc-filter-section {
    margin-bottom: 12px;
}

.doc-filter-section-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.doc-filter-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.doc-filter-presets {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.doc-preset-btn {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    color: #475569;
    padding: 3px 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.doc-preset-btn:hover {
    background: #f0f9ff;
    border-color: #bae6fd;
    color: #0369a1;
}

.doc-calendar-range-container {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.doc-date-field-card {
    flex: 1;
    min-width: 140px;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.doc-date-field-card:hover {
    border-color: #0369a1;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(4, 120, 87, 0.08);
}

.doc-date-field-card:focus-within {
    border-color: #0369a1;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.12);
}

.doc-date-field-tag {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.3px;
}

.doc-date-field-inner {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    position: relative !important;
    width: 100% !important;
}

.doc-date-field-inner .doc-date-input-icon,
.doc-date-input-icon {
    position: static !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    color: #0369a1 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.doc-custom-date-input {
    border: none !important;
    outline: none !important;
    background: transparent !important;
    flex: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    cursor: pointer !important;
    padding: 0 4px !important;
    height: auto !important;
    box-shadow: none !important;
}

.doc-custom-date-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
    font-size: 12.5px;
}

.doc-date-clear-btn {
    background: #f1f5f9;
    border: none;
    color: #64748b;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.12s ease;
    flex-shrink: 0;
}

.doc-date-clear-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

.doc-date-arrow-separator {
    font-size: 14px;
    color: #94a3b8;
    font-weight: bold;
    flex-shrink: 0;
}

/* POPUP LỊCH THUẦN VIỆT */
.doc-vn-datepicker-popup {
    position: fixed !important;
    z-index: 10500 !important;
    width: 290px;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
    box-sizing: border-box;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 18px 40px -6px rgba(0, 0, 0, 0.22), 0 4px 14px rgba(0, 0, 0, 0.08);
    padding: 12px 14px;
    animation: vndpFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@keyframes vndpFadeIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.vn-dp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.vn-dp-nav-group {
    display: flex;
    align-items: center;
    gap: 2px;
}

.vn-dp-nav-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    width: 25px;
    height: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    transition: all 0.12s ease;
    line-height: 1;
}

.vn-dp-nav-btn:hover {
    background: #0369a1;
    border-color: #0369a1;
    color: #ffffff;
}

.vn-dp-title-center {
    display: flex;
    align-items: center;
    gap: 4px;
}

.vn-dp-title-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
    padding: 3px 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.vn-dp-title-btn:hover {
    background: #f0f9ff;
    border-color: #bae6fd;
    color: #0369a1;
}

.vn-dp-main-calendar {
    position: relative;
}

.vn-dp-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 6px;
    padding-bottom: 5px;
    border-bottom: 1px solid #f1f5f9;
}

.vn-dp-sunday {
    color: #dc2626;
}

.vn-dp-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.vn-dp-day-cell {
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.vn-dp-day-cell:hover {
    background: #f0f9ff;
    color: #0369a1;
}

.vn-dp-day-cell.prev-month,
.vn-dp-day-cell.next-month {
    color: #cbd5e1;
    font-weight: 400;
}

.vn-dp-day-cell.today {
    border: 1.5px solid #0369a1;
    font-weight: 800;
    color: #0369a1;
}

.vn-dp-day-cell.selected {
    background: #0369a1 !important;
    color: #ffffff !important;
    font-weight: 800;
}

.vn-dp-quick-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
}

.vn-dp-shortcut-pill {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 10.5px;
    font-weight: 600;
    color: #475569;
    padding: 2px 6px;
    cursor: pointer;
    transition: all 0.12s ease;
}

.vn-dp-shortcut-pill:hover {
    background: #f0f9ff;
    border-color: #bae6fd;
    color: #0369a1;
}

.vn-dp-quick-overlay {
    position: absolute;
    top: 36px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    background: #ffffff;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10;
}

.vn-dp-quick-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.vn-dp-quick-title {
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
}

.vn-dp-quick-close {
    border: none;
    background: #f1f5f9;
    border-radius: 4px;
    width: 20px;
    height: 20px;
    font-size: 11px;
    cursor: pointer;
}

.vn-dp-quick-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.vn-dp-quick-pill {
    padding: 6px 4px;
    font-size: 11.5px;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
}

.vn-dp-quick-pill:hover,
.vn-dp-quick-pill.selected {
    background: #0369a1;
    color: #ffffff;
    border-color: #0369a1;
}

.vn-dp-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
}

.vn-dp-btn-today {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0369a1;
    border-radius: 5px;
    font-size: 11.5px;
    font-weight: 700;
    padding: 4px 10px;
    cursor: pointer;
}

.vn-dp-btn-close {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    border-radius: 5px;
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 10px;
    cursor: pointer;
}

/* ==========================================================================
   BỘ LỌC KHOẢNG THỜI GIAN ĐỒNG BỘ CHUẨN CỦA MỤC CÁ NHÂN (DD/MM/YYYY)
   ========================================================================== */
.biz-date-range-unified {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    padding: 3px 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
    height: 38px;
}

.biz-date-box {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    height: 28px;
    box-sizing: border-box;
}

.biz-date-box:hover {
    background: #f1f5f9;
    border-color: #0284c7;
}

.biz-date-label {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    white-space: nowrap;
}

.biz-date-input-wrap {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    position: relative;
}

.biz-date-cal-icon {
    display: inline-flex;
    align-items: center;
    color: #0284c7;
}

.biz-custom-date-val {
    border: none;
    background: transparent;
    font-size: 12.5px;
    font-weight: 600;
    color: #0f172a;
    width: 78px;
    cursor: pointer;
    outline: none;
    font-family: inherit;
    padding: 0;
}

.biz-date-btn-clear {
    background: #cbd5e1;
    color: #334155;
    border: none;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: background 0.15s ease;
}

.biz-date-btn-clear:hover {
    background: #ef4444;
    color: #ffffff;
}

.biz-date-arrow {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
}

.biz-date-actions {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 2px;
}

.biz-btn-filter {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    border-radius: 6px !important;
    background: #0284c7 !important;
    border: 1px solid #0284c7 !important;
    color: #ffffff !important;
    box-shadow: 0 1px 3px rgba(5, 150, 105, 0.25) !important;
    cursor: pointer;
    height: 28px;
    box-sizing: border-box;
    transition: background 0.15s;
}

.biz-btn-filter:hover {
    background: #0369a1 !important;
    border-color: #0369a1 !important;
}

.biz-btn-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0 !important;
    border-radius: 6px !important;
    border: 1px solid #cbd5e1 !important;
    background: #f8fafc !important;
    color: #475569 !important;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.15s;
}

.biz-btn-reset:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

/* THÍCH ỨNG BỘ LỌC THỜI GIAN TRÊN THIẾT BỊ DI ĐỘNG (MOBILE VIEWPORT) */
@media (max-width: 768px) {
    .biz-date-range-unified {
        display: flex !important;
        flex-wrap: wrap !important;
        width: 100% !important;
        height: auto !important;
        padding: 10px !important;
        gap: 8px !important;
        box-sizing: border-box !important;
        border-radius: 10px !important;
        align-items: center !important;
    }

    .biz-date-box {
        flex: 1 1 calc(50% - 16px) !important;
        min-width: 0 !important;
        height: 38px !important;
        padding: 6px 8px !important;
        box-sizing: border-box !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
    }

    .biz-date-label {
        font-size: 11.5px !important;
        font-weight: 700 !important;
    }

    .biz-date-arrow {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 13px !important;
        color: #94a3b8 !important;
        flex-shrink: 0 !important;
        width: 16px !important;
    }

    .biz-date-input-wrap {
        flex: 1 !important;
        min-width: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 4px !important;
    }

    .biz-custom-date-val {
        width: 74px !important;
        font-size: 12px !important;
        text-align: right !important;
    }

    .biz-date-actions {
        width: 100% !important;
        display: flex !important;
        gap: 8px !important;
        margin: 2px 0 0 0 !important;
    }

    .biz-btn-filter {
        flex: 1 1 50% !important;
        height: 36px !important;
        font-size: 13px !important;
        font-weight: 700 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        border-radius: 8px !important;
    }

    .biz-btn-reset {
        flex: 1 1 50% !important;
        height: 36px !important;
        width: auto !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        border-radius: 8px !important;
        padding: 0 12px !important;
    }

    .biz-btn-reset::after {
        content: "Đặt lại";
        font-size: 12.5px;
        font-weight: 600;
        color: #475569;
    }
}

/* ========================================================================= */
/* BỘ MULTI-SELECT CHỌN THÀNH VIÊN DÙNG CHUNG CHO MODAL GIAO VIỆC & LỊCH CÔNG TÁC */
/* ========================================================================= */
.doc-multiselect-box {
    position: relative;
    width: 100%;
}

.doc-multiselect-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 38px;
    padding: 5px 10px;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 6px;
    box-sizing: border-box;
}

.doc-multiselect-trigger:hover {
    border-color: #2563EB;
    background: #ffffff;
}

.doc-multiselect-trigger.active {
    border-color: #2563EB;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.doc-multiselect-trigger-content {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.doc-multiselect-placeholder {
    color: #64748b;
    font-size: 13px;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-multiselect-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    max-width: 100%;
    box-sizing: border-box;
}

.doc-multiselect-tag-remove {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: rgba(30, 64, 175, 0.15);
    color: #1e40af;
    font-size: 11px;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.doc-multiselect-tag-remove:hover {
    background: #1e40af;
    color: #ffffff;
}

.doc-multiselect-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18), 0 4px 10px rgba(0, 0, 0, 0.05);
    z-index: 1060;
    display: none;
    flex-direction: column;
    padding: 8px;
    animation: docFadeInSlideDown 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.doc-multiselect-panel.show {
    display: flex !important;
}

@keyframes docFadeInSlideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.doc-multiselect-search-wrap {
    position: relative;
    margin-bottom: 6px;
}

.doc-multiselect-search-input {
    width: 100%;
    padding: 6px 10px;
    font-size: 12.5px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    outline: none;
    background: #f8fafc;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.doc-multiselect-search-input:focus {
    border-color: #2563EB;
    background: #ffffff;
}

.doc-multiselect-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 4px 6px 4px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 11.5px;
}

.doc-multiselect-action-btn {
    background: none;
    border: none;
    color: #2563EB;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.doc-multiselect-action-btn:hover {
    background: #eff6ff;
}

.doc-multiselect-list {
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 2px 0 2px;
}

.doc-multiselect-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
    user-select: none;
    font-size: 13px;
}

.doc-multiselect-item:hover {
    background: #f8fafc;
}

.doc-multiselect-item.selected {
    background: #eff6ff;
}

/* ==========================================================================
   HỆ THỐNG GIAO DIỆN RESPONSIVE MOBILE CHUẨN MODERN CORPORATE SAAS
   Đặc tả cho màn hình điện thoại (<= 768px), không ảnh hưởng màn hình máy tính (> 768px)
   ========================================================================== */

/* 1. Brand Logo trên Mobile */
.topbar-mobile-brand {
    display: none;
}

@media (max-width: 768px) {
    /* Ẩn searchbar & đồng hồ trên mobile để giữ topbar thoáng gọn như ảnh mẫu */
    .topbar-search-wrapper,
    .topbar-center-widget,
    .topbar-admin-group-bar {
        display: none !important;
    }

    /* Hiển thị nút menu hamburger */
    .btn-mobile-menu-toggle {
        display: inline-flex !important;
        width: 36px !important;
        height: 36px !important;
        border-radius: 8px !important;
        background: #F8FAFC !important;
        border: 1px solid #E2E8F0 !important;
        color: #0F172A !important;
    }

    /* Hiển thị Brand Logo FITCLUB 43-009 theo hình mẫu */
    .topbar-mobile-brand {
        display: flex !important;
        align-items: center;
        gap: 8px;
        margin-left: 4px;
        user-select: none;
    }

    .topbar-mobile-brand .mobile-brand-icon {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .topbar-mobile-brand .mobile-brand-text {
        display: flex;
        flex-direction: column;
        line-height: 1.1;
    }

    .topbar-mobile-brand .mobile-brand-name {
        font-size: 15px;
        font-weight: 800;
        color: #0F2D4A;
        letter-spacing: 0.2px;
    }

    .topbar-mobile-brand .mobile-brand-sub {
        font-size: 9px;
        font-weight: 700;
        color: #94A3B8;
        letter-spacing: 0.6px;
        text-transform: uppercase;
        margin-top: 1px;
    }

    /* Topbar compact */
    .topbar {
        height: 58px !important;
        padding: 0 12px !important;
        border-bottom: 1px solid #F1F5F9 !important;
    }

    .topbar-left {
        gap: 8px !important;
        flex: 1;
    }

    .topbar-user-section {
        gap: 8px !important;
        margin-left: auto !important;
    }

    .btn-topbar-bell {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
        color: #475569 !important;
    }

    .btn-topbar-bell .bell-icon {
        font-size: 20px !important;
    }

    .user-profile-card {
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
        padding: 2px 4px !important;
        gap: 8px !important;
    }

    .user-profile-card .user-avatar-wrapper {
        width: 34px !important;
        height: 34px !important;
    }

    .user-profile-card .user-fullname {
        font-size: 13px !important;
        font-weight: 700 !important;
        color: #0F172A !important;
    }

    .user-profile-card .user-role-badge {
        font-size: 9.5px !important;
        font-weight: 700 !important;
        text-transform: uppercase;
        color: #64748B !important;
        letter-spacing: 0.3px;
    }

    .user-profile-card .user-dropdown-arrow {
        color: #64748B !important;
    }

    /* Sidebar Ngăn kéo trượt từ bên trái (Off-canvas Drawer) */
    .sidebar-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(15, 23, 42, 0.45);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
        z-index: 2090;
        opacity: 0;
        transition: opacity 0.25s ease;
    }

    .sidebar-backdrop.active {
        display: block !important;
        opacity: 1 !important;
    }

    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -300px !important;
        width: 280px !important;
        min-width: 280px !important;
        max-width: 280px !important;
        height: 100vh !important;
        height: 100dvh !important;
        z-index: 2100 !important;
        box-shadow: 6px 0 24px rgba(15, 23, 42, 0.25) !important;
        transition: left 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }

    .sidebar.mobile-open {
        left: 0 !important;
    }

    body.mobile-drawer-open {
        overflow: hidden !important;
    }

    /* Main Container layout */
    .main-wrapper {
        width: 100% !important;
        max-width: 100% !important;
    }

    .main-container {
        padding: 12px 10px 30px 10px !important;
    }

    .card {
        border-radius: 14px !important;
        padding: 14px 16px !important;
        margin-bottom: 14px !important;
    }

    /* Tối ưu Modal trên mobile */
    .modal-content,
    .custom-modal-content {
        width: 94vw !important;
        max-width: 94vw !important;
        margin: 12px auto !important;
        border-radius: 16px !important;
        padding: 18px 16px !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
    }
}

/* ==========================================================================
   HỆ THỐNG BỘ LỌC DÙNG CHUNG TRÊN MOBILE (BOTTOM SHEET & SEGMENTED PILLS)
   Đồng bộ 100% phong cách phân hệ Theo dõi sức khỏe (Health Module)
   ========================================================================== */

/* Dải chọn chu kỳ nhanh dạng Segmented Pills & nút phễu mở Bottom Sheet */
.mobile-period-bar-wrap {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
    width: 100% !important;
}

.mobile-period-bar {
    display: flex !important;
    gap: 6px !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
    flex: 1 !important;
    padding: 2px 0 !important;
}

.mobile-period-bar::-webkit-scrollbar {
    display: none !important;
}

.mobile-period-pill {
    padding: 7px 14px !important;
    border: 1px solid #E2E8F0 !important;
    background: #FFFFFF !important;
    border-radius: 20px !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    color: #64748B !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    transition: all 0.15s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.mobile-period-pill.active {
    background: #2563EB !important;
    border-color: #2563EB !important;
    color: #FFFFFF !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25) !important;
}

.btn-mobile-filter-sheet-trigger {
    width: 40px !important;
    height: 38px !important;
    border-radius: 10px !important;
    border: 1px solid #E2E8F0 !important;
    background: #FFFFFF !important;
    color: #475569 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    transition: all 0.15s ease !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
}

.btn-mobile-filter-sheet-trigger.has-filter {
    background: #EFF6FF !important;
    border-color: #2563EB !important;
    color: #2563EB !important;
    position: relative !important;
}

.btn-mobile-filter-sheet-trigger.has-filter::after {
    content: '' !important;
    position: absolute !important;
    top: 6px !important;
    right: 6px !important;
    width: 7px !important;
    height: 7px !important;
    background: #EA580C !important;
    border-radius: 50% !important;
    border: 1.5px solid #FFFFFF !important;
}

.d-none {
    display: none !important;
}

.m-sheet-check-icon {
    color: #2563EB;
    font-weight: 800;
    font-size: 15px;
}

.m-filter-sheet-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    z-index: 1050;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}
.m-filter-sheet-backdrop[style*="display: none"] {
    display: none !important;
}

/* 2. Khung Bottom Sheet trượt từ đáy */
.m-filter-bottom-sheet {
    background: #FFFFFF !important;
    width: 100% !important;
    max-width: 480px !important;
    border-top-left-radius: 20px !important;
    border-top-right-radius: 20px !important;
    padding: 14px 20px 24px 20px !important;
    box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.15) !important;
    animation: slideUpSheet 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    max-height: 85vh !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
}

@keyframes slideUpSheet {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.m-sheet-handle {
    width: 40px !important;
    height: 4px !important;
    background: #CBD5E1 !important;
    border-radius: 2px !important;
    margin: 0 auto 12px auto !important;
}

.m-sheet-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 14px !important;
}

.m-sheet-title {
    font-size: 16.5px !important;
    font-weight: 800 !important;
    color: #0F172A !important;
}

.m-sheet-close-btn {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    border: none !important;
    background: #F1F5F9 !important;
    color: #475569 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.m-sheet-period-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    margin-bottom: 16px !important;
}

.m-sheet-period-item {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 10px 12px !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    transition: background 0.15s ease !important;
}

.m-sheet-period-item:hover {
    background: #F8FAFC !important;
}

.m-sheet-period-item.active {
    background: #EFF6FF !important;
    color: #0284C7 !important;
    font-weight: 700 !important;
}

.m-sheet-item-left {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    font-size: 14px !important;
}

.m-sheet-check-icon {
    color: #0284C7 !important;
    font-weight: 800 !important;
    font-size: 15px !important;
}

.m-sheet-custom-date-section {
    border-top: 1px solid #F1F5F9 !important;
    padding-top: 14px !important;
    margin-bottom: 18px !important;
}

.m-sheet-section-title {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #334155 !important;
    margin-bottom: 8px !important;
}

.m-sheet-date-inputs-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
}

.m-sheet-date-box {
    border: 1px solid #E2E8F0 !important;
    border-radius: 10px !important;
    padding: 8px 12px !important;
    background: #F8FAFC !important;
    cursor: pointer !important;
}

.m-sheet-date-label {
    font-size: 11px !important;
    color: #64748B !important;
    display: block !important;
    margin-bottom: 2px !important;
}

.m-sheet-date-input-wrap {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.m-sheet-date-val {
    border: none !important;
    background: transparent !important;
    outline: none !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    color: #0F172A !important;
    width: 100% !important;
    cursor: pointer !important;
}

.m-sheet-apply-btn {
    width: 100% !important;
    padding: 12px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    border-radius: 10px !important;
    background: #2563EB !important;
    border-color: #2563EB !important;
    color: #FFFFFF !important;
}


/* ==========================================================================
   HỆ THỐNG RESPONSIVE CHUẨN TOÀN HỆ THỐNG FITCLUB 43-009
   Breakpoints: <360px | 360-480px | 481-1024px | >1024px
   Nguyên tắc: không scroll ngang, không vỡ layout, typography linh hoạt
   ========================================================================== */

/* ──────────────────────────────────────────────────────
   BIỆN PHÁP PHÒNG VỆ TOÀN CỤC: chống scroll ngang mọi trình duyệt
   ────────────────────────────────────────────────────── */
html {
    overflow-x: hidden !important;
}

*, *::before, *::after {
    max-width: 100%;
}

img, video, svg, canvas, embed, object, iframe {
    max-width: 100%;
    height: auto;
}

/* Bảng không được làm tràn container cha */
table {
    max-width: 100%;
}

/* ──────────────────────────────────────────────────────
   TABLET + MOBILE: width <= 1024px
   Mở rộng thêm từ block 992px sẵn có lên đến 1024px
   ────────────────────────────────────────────────────── */
@media (min-width: 993px) and (max-width: 1024px) {
    /* Hiển thị nút hamburger ngay từ 1024px */
    .btn-mobile-menu-toggle {
        display: inline-flex !important;
    }

    .btn-sidebar-close-mobile {
        display: inline-flex !important;
    }

    /* Sidebar chuyển sang off-canvas drawer */
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 290px !important;
        max-width: 86vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        padding-top: var(--safe-top) !important;
        padding-bottom: var(--safe-bottom) !important;
        padding-left: var(--safe-left) !important;
        z-index: 1050 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
        box-shadow: none !important;
    }

    .sidebar.mobile-open {
        transform: translateX(0) !important;
        box-shadow: 12px 0 35px rgba(0, 0, 0, 0.5) !important;
    }

    /* Main wrapper chiếm 100% chiều ngang */
    .main-wrapper {
        max-width: 100vw !important;
        width: 100vw !important;
        flex: 1 !important;
        min-width: 0 !important;
        height: 100% !important;
        max-height: 100% !important;
    }

    /* Topbar điều chỉnh cho tablet lớn */
    .topbar {
        height: 60px !important;
        padding: 0 16px !important;
        gap: 8px !important;
    }

    .topbar-center-widget {
        display: none !important;
    }

    .sidebar-backdrop {
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        width: 100vw;
        height: 100dvh;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 1040;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease, visibility 0.25s ease;
    }

    .sidebar-backdrop.active {
        opacity: 1;
        visibility: visible;
    }

    /* Main container padding hợp lý cho tablet */
    .main-container {
        padding: 12px 12px calc(16px + var(--safe-bottom, 0px)) 12px !important;
        overflow-x: hidden !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }
}

/* ──────────────────────────────────────────────────────
   TABLET: 481px – 1024px
   ────────────────────────────────────────────────────── */
@media (max-width: 1024px) and (min-width: 481px) {
    /* Grid tự co từ nhiều cột thành 2 cột trên tablet */
    .stat-cards-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    /* Các grid đa cột (3+) tự co về 2 cột */
    .grid-cols-3,
    .grid-cols-4,
    [class*="grid-3"],
    [class*="grid-4"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Thanh tab trượt ngang thay vì wrap */
    .sub-tabs,
    .tab-nav,
    .filter-tabs {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        white-space: nowrap !important;
        flex-wrap: nowrap !important;
        scrollbar-width: none !important;
    }

    .sub-tabs::-webkit-scrollbar,
    .tab-nav::-webkit-scrollbar {
        display: none !important;
    }

    /* Thanh lọc xuống dòng gọn */
    .filter-bar,
    .filter-row {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    /* Nút action dàn đều trên tablet */
    .page-actions,
    .header-actions {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    /* Form 2 cột trên tablet */
    .form-row,
    .form-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    /* Dropdown không bị tràn mép */
    .topbar-account-dropdown,
    .topbar-notification-dropdown {
        max-width: min(300px, calc(100vw - 20px)) !important;
    }
}

/* ──────────────────────────────────────────────────────
   MOBILE: 360px – 480px (màn hình điện thoại phổ thông)
   ────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    /* Typography co giãn theo màn hình */
    body {
        font-size: clamp(12px, 3.2vw, 14px) !important;
    }

    h1, .h1 { font-size: clamp(18px, 5vw, 22px) !important; }
    h2, .h2 { font-size: clamp(16px, 4.5vw, 20px) !important; }
    h3, .h3 { font-size: clamp(14px, 4vw, 18px) !important; }
    h4, .h4 { font-size: clamp(13px, 3.5vw, 16px) !important; }

    .page-title {
        font-size: clamp(15px, 4.5vw, 18px) !important;
    }

    /* Topbar gọn hơn trên mobile nhỏ */
    .topbar {
        height: calc(52px + var(--safe-top)) !important;
        padding: var(--safe-top) 8px 0 8px !important;
        gap: 6px !important;
    }

    /* Ẩn text tên trang trên topbar, chỉ để icon */
    .page-sub-desc {
        display: none !important;
    }

    .topbar-search-wrapper {
        max-width: clamp(100px, 35vw, 180px) !important;
    }

    /* Thanh tìm kiếm topbar mobile */
    .topbar-search-input {
        height: 34px !important;
        font-size: 12px !important;
        padding: 0 8px 0 30px !important;
    }

    .topbar-search-icon {
        left: 8px !important;
        font-size: 13px !important;
    }

    /* User card gọn nhất có thể */
    .user-profile-card {
        padding: 3px 5px 3px 4px !important;
        gap: 4px !important;
        max-width: clamp(88px, 28vw, 120px) !important;
        height: 34px !important;
    }

    .user-avatar-wrapper {
        width: 26px !important;
        height: 26px !important;
    }

    .user-fullname {
        max-width: clamp(40px, 14vw, 65px) !important;
        font-size: 11.5px !important;
    }

    .user-meta-sub {
        display: none !important;
    }

    .btn-topbar-bell {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
    }

    /* Main container padding gọn cho mobile */
    .main-container {
        padding: 8px 8px calc(72px + var(--safe-bottom, 0px)) 8px !important;
        overflow-x: hidden !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }

    /* Page header chuyển thành dọc */
    .page-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    /* Nút action 50-50 hoặc full width */
    .page-actions button,
    .page-actions .btn,
    .header-actions button,
    .header-actions .btn {
        flex: 1 1 calc(50% - 6px) !important;
        min-height: 40px !important;
        font-size: 12.5px !important;
        justify-content: center !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* Bộ lọc trạng thái grid 2 cột */
    .filter-status-buttons {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    .filter-status-buttons .btn {
        justify-content: center !important;
        font-size: 12px !important;
        padding: 8px 6px !important;
    }

    /* KPI cards 2 cột */
    .stat-cards-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        margin-bottom: 14px !important;
    }

    /* Card KPI thu gọn */
    .saas-stat-card {
        padding: 10px 12px !important;
        border-radius: 14px !important;
    }

    .stat-value {
        font-size: 20px !important;
    }

    .stat-label {
        font-size: 9.5px !important;
    }

    .stat-icon-wrapper {
        width: 30px !important;
        height: 30px !important;
    }

    /* Grid đa cột về 1 cột trên mobile */
    .grid-cols-3,
    .grid-cols-4,
    [class*="grid-3"],
    [class*="grid-4"] {
        grid-template-columns: 1fr !important;
    }

    /* Tab trượt ngang */
    .sub-tabs,
    .tab-nav,
    .filter-tabs {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        white-space: nowrap !important;
        flex-wrap: nowrap !important;
        scrollbar-width: none !important;
        gap: 6px !important;
    }

    .sub-tabs::-webkit-scrollbar,
    .tab-nav::-webkit-scrollbar {
        display: none !important;
    }

    .sub-tab-btn {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        font-size: 12px !important;
        padding: 8px 12px !important;
        min-height: 36px !important;
        touch-action: manipulation !important;
    }

    /* Form 1 cột trên mobile */
    .form-row,
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    /* Input, Select, Textarea full width */
    .form-control,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="tel"],
    select,
    textarea {
        font-size: 14px !important; /* >= 16px ngăn auto-zoom iOS, nhưng 14px đủ để không zoom nếu viewport meta đúng */
        min-height: 40px !important;
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Nút đủ to để chạm tay dễ */
    .btn {
        min-height: 40px !important;
        touch-action: manipulation !important;
    }

    /* Dropdown tài khoản & thông báo: full width căn phải */
    .topbar-account-dropdown {
        position: fixed !important;
        top: calc(52px + var(--safe-top)) !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        max-width: calc(100vw - 20px) !important;
    }

    .topbar-notification-dropdown {
        position: fixed !important;
        top: calc(52px + var(--safe-top)) !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        max-width: calc(100vw - 20px) !important;
    }

    /* Dashboard two-col → single col */
    .dashboard-two-col-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* Modal full màn hình trên mobile */
    .modal-dialog,
    .modal-content {
        max-width: 100vw !important;
        width: 100% !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }

    /* Modal vị trí đáy màn hình (bottom-sheet style) */
    .modal {
        align-items: flex-end !important;
        padding: 0 !important;
    }

    /* Phân trang thu gọn */
    .app-pagination {
        flex-direction: column !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 8px 10px !important;
    }

    .app-pagination-pages {
        flex-wrap: wrap !important;
        justify-content: center !important;
    }

    /* Bảng → Card (đảm bảo không tràn ngang trên mobile) */
    .table-responsive {
        overflow: visible !important;
        border: none !important;
        padding: 0 !important;
    }

    /* Ẩn cột ít quan trọng trên mobile */
    .hide-mobile {
        display: none !important;
    }

    /* Hiện cột chỉ trên mobile */
    .show-mobile {
        display: block !important;
    }
}

/* ──────────────────────────────────────────────────────
   MOBILE NHỎ: < 360px (iPhone SE cũ, máy giá rẻ)
   ────────────────────────────────────────────────────── */
@media (max-width: 359px) {
    body {
        font-size: 11.5px !important;
    }

    .topbar {
        height: calc(48px + var(--safe-top)) !important;
        padding: var(--safe-top) 6px 0 6px !important;
        gap: 4px !important;
    }

    /* Thanh tìm kiếm ẩn trên màn < 360px để không tràn */
    .topbar-search-wrapper {
        display: none !important;
    }

    /* Logo title ẩn text, chỉ hiển thị icon thương hiệu */
    .page-main-title {
        font-size: 13px !important;
    }

    .page-icon-badge {
        width: 28px !important;
        height: 28px !important;
    }

    /* User card siêu gọn: chỉ avatar */
    .user-profile-card {
        padding: 2px !important;
        gap: 0 !important;
        max-width: 36px !important;
        border-radius: 50% !important;
    }

    .user-fullname,
    .user-dropdown-arrow {
        display: none !important;
    }

    .user-avatar-wrapper {
        width: 28px !important;
        height: 28px !important;
    }

    .btn-topbar-bell {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
        font-size: 14px !important;
    }

    /* Main container siêu gọn */
    .main-container {
        padding: 6px 6px calc(70px + var(--safe-bottom, 0px)) 6px !important;
    }

    /* KPI cards: 2 cột nhỏ */
    .stat-cards-grid {
        gap: 6px !important;
    }

    .saas-stat-card {
        padding: 8px 10px !important;
    }

    .stat-value {
        font-size: 18px !important;
    }

    .stat-label {
        font-size: 9px !important;
        white-space: normal !important;
    }

    .stat-icon-wrapper {
        width: 26px !important;
        height: 26px !important;
    }

    .stat-icon-wrapper svg {
        width: 13px !important;
        height: 13px !important;
    }

    /* Nút nhỏ hơn nhưng vẫn chạm được */
    .btn {
        min-height: 38px !important;
        font-size: 12px !important;
        padding: 0 10px !important;
    }

    /* Sub tab nhỏ hơn */
    .sub-tab-btn {
        font-size: 11.5px !important;
        padding: 7px 10px !important;
        min-height: 34px !important;
    }

    /* Page title nhỏ hơn */
    .page-title {
        font-size: 14px !important;
    }

    h1, .h1 { font-size: 16px !important; }
    h2, .h2 { font-size: 15px !important; }
    h3, .h3 { font-size: 14px !important; }

    /* Dropdown: full width */
    .topbar-account-dropdown {
        left: 4px !important;
        right: 4px !important;
        max-width: calc(100vw - 8px) !important;
    }

    /* Modal full screen */
    .modal-dialog {
        max-width: 100vw !important;
        width: 100% !important;
    }
}

/* ──────────────────────────────────────────────────────
   DESKTOP: > 1024px – đảm bảo các quy tắc tablet không rò rỉ lên desktop
   ────────────────────────────────────────────────────── */
@media (min-width: 1025px) {
    /* Khôi phục sidebar cố định như bình thường */
    .sidebar {
        position: relative !important;
        transform: none !important;
        width: 256px !important;
        min-width: 256px !important;
        max-width: 256px !important;
    }

    .sidebar.collapsed {
        width: 72px !important;
        min-width: 72px !important;
        max-width: 72px !important;
    }

    .btn-mobile-menu-toggle {
        display: none !important;
    }

    .sidebar-backdrop {
        display: none !important;
    }

    .main-wrapper {
        width: calc(100% - 256px) !important;
        max-width: calc(100% - 256px) !important;
    }

    .sidebar.collapsed + .main-wrapper {
        width: calc(100% - 72px) !important;
        max-width: calc(100% - 72px) !important;
    }

    /* Thanh tìm kiếm topbar đầy đủ */
    .topbar-search-wrapper {
        max-width: 320px !important;
    }

    /* Grid 3+ cột trên desktop */
    .stat-cards-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    /* Cột ẩn trên mobile khôi phục */
    .hide-mobile {
        display: table-cell !important;
    }

    .show-mobile {
        display: none !important;
    }

    /* Dropdown tài khoản và thông báo trên desktop luôn giữ kích thước chuẩn, không bị co ép */
    .topbar-account-dropdown {
        position: absolute !important;
        top: calc(100% + 8px) !important;
        right: 0 !important;
        left: auto !important;
        width: 280px !important;
        min-width: 280px !important;
        max-width: 320px !important;
    }

    .topbar-notification-dropdown {
        position: absolute !important;
        top: calc(100% + 8px) !important;
        right: 0 !important;
        left: auto !important;
        width: 360px !important;
        min-width: 360px !important;
        max-width: 420px !important;
    }
}

/* ──────────────────────────────────────────────────────
   TIỆN ÍCH CHUNG (UNIVERSAL UTILITIES) - áp dụng mọi kích thước
   ────────────────────────────────────────────────────── */

/* Ngăn bảng tràn container */
.table-responsive {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Text không wrap ra ngoài container */
.text-truncate {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    max-width: 100% !important;
}

/* Flex container không wrap tràn */
.flex-no-overflow {
    min-width: 0 !important;
    overflow: hidden !important;
}

/* Nút có touch target tối thiểu 44px (WCAG 2.5.5) */
button, .btn, [role="button"] {
    touch-action: manipulation;
}

/* Chống zoom input trên iOS (font-size >= 16px hoặc dùng meta user-scalable=no) */
@supports (-webkit-touch-callout: none) {
    input, select, textarea {
        font-size: max(14px, 1em) !important;
    }
}


