/* HQMS vaitro - dashboard cá nhân (trang chủ, trang Dashboard của tôi) và trang Vai trò & phân quyền */
.vt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.vt-card { background: #fff; border: 1px solid #e3e7ec; border-radius: 8px; padding: 10px 12px; min-width: 0; }
.vt-card h4 { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: #111827; }
.vt-card h4 .glyphicon { color: var(--hqms-theme-primary, #1d4f91); margin-right: 3px; }
.vt-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.vt-stat { flex: 1 1 110px; display: flex; flex-direction: column; padding: 6px 8px; border-radius: 6px; background: #f6f8fb; color: #111827; text-decoration: none; }
a.vt-stat:hover { background: #eef3fb; text-decoration: none; color: #111827; }
.vt-stat-v { font-size: 18px; font-weight: 700; line-height: 1.2; }
.vt-stat-l { font-size: 11.5px; color: #4b5563; }
.vt-stat.vt-danger .vt-stat-v { color: #b91c1c; }
.vt-stat.vt-warning .vt-stat-v { color: #b45309; }
.vt-stat.vt-success .vt-stat-v { color: #15803d; }
.vt-stat.vt-info .vt-stat-v { color: #1d4ed8; }
.vt-list { list-style: none; margin: 0; padding: 0; }
.vt-list li a { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; padding: 4px 2px; border-top: 1px solid #f1f3f6; color: #1f2937; text-decoration: none; }
.vt-list li a:hover { background: #f6f8fb; }
.vt-li-t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vt-li-s { flex-basis: 100%; font-size: 11.5px; color: #6b7280; }
.vt-badge { font-size: 11px; padding: 0 6px; border-radius: 8px; background: #f3f4f6; color: #374151; white-space: nowrap; }
.vt-badge.vt-danger { background: #fee2e2; color: #991b1b; } .vt-badge.vt-warning { background: #fef3c7; color: #92400e; }
.vt-badge.vt-info { background: #dbeafe; color: #1e40af; } .vt-badge.vt-special { background: #ede9fe; color: #5b21b6; }
.vt-empty { color: #6b7280; font-size: 12.5px; margin: 4px 0; }
.vt-buttons { display: flex; flex-wrap: wrap; gap: 5px; }
.vt-buttons img { width: 16px; height: 16px; vertical-align: -3px; }
.vt-home { background: rgba(255,255,255,.96); border: 1px solid #e3e7ec; border-radius: 10px; padding: 10px 14px; box-shadow: 0 6px 24px rgba(15,23,42,.08); }
.vt-home-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.vt-home-head h3 { flex: 1; margin: 0; font-size: 17px; font-weight: 600; }
.vt-home.vt-collapsed .vt-home-body { display: none; }
.vt-home.vt-collapsed .vt-home-head { margin-bottom: 0; }
.vt-hint { font-size: 13px; color: #4b5563; }
.vt-page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }

/* trang Vai trò & phân quyền */
.vt-tabs { margin-bottom: 12px; }
.vt-role-list .list-group-item .small { margin-top: 2px; }
/* dòng đang chọn (vai trò, nhóm): chữ phụ text-muted xám chìm vào nền xanh; !important vì theme đè màu text-muted */
.vt-role-list .list-group-item.active .small, .vt-role-list .list-group-item.active .text-muted { color: #fff !important; }
.vt-sub { margin: 6px 0 8px; }
.vt-sub > li > a { padding: 6px 12px; }   /* đúng cỡ pill của theme */
.vt-matrix { max-height: 520px; overflow: auto; border: 1px solid #eef1f5; border-radius: 4px; margin-top: 6px; }
.vt-matrix table { margin: 0; }
.vt-matrix thead th { position: sticky; top: 0; background: #f7f9fc; z-index: 1; }
.vt-matrix tr.vt-grp th { background: #eef3fb; font-size: 12px; }
.vt-matrix code { font-size: 10.5px; color: #6b7280; background: none; }
.vt-sel { font-size: 12px; padding: 1px 2px; border: 1px solid #d1d5db; border-radius: 3px; }
.vt-sel.vt-l1 { background: #fef3c7; } .vt-sel.vt-l2 { background: #dbeafe; } .vt-sel.vt-l3 { background: #dcfce7; }
.vt-wlist { list-style: none; padding: 0; max-width: 420px; }
.vt-wlist li { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #f1f3f6; padding: 2px 0; }
.vt-wlist label { font-weight: normal; margin: 0; }
.vt-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.vt-them { margin-bottom: 8px; }
.vt-pager { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vt-tools > [data-vt-upager], .vt-tools > [data-vt-mpager], .vt-tools > [data-vt-lpager], .vt-tools > [data-nh-pager] { margin-left: auto; }
.vt-chips { max-width: 520px; }
.vt-chip { display: inline-block; font-weight: normal; font-size: 12px; margin: 1px 2px; padding: 1px 6px; border: 1px solid #d1d5db; border-radius: 10px; cursor: pointer; }
.vt-chip.on { background: #dbeafe; border-color: #93c5fd; }
.vt-chip input { vertical-align: -2px; margin: 0 2px 0 0; }
.vt-user-filter { max-width: 320px; }
.vt-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.vt-tools select { width: auto; max-width: 220px; }
.vt-add { display: flex; gap: 6px; margin-bottom: 8px; max-width: 460px; }
.vt-users .label { font-weight: 500; margin-right: 2px; }
.vt-mk-tam { font-size: 120%; user-select: all; }
.vt-p { display: inline-block; min-width: 30px; text-align: center; }
@media (max-width: 767px) { .vt-grid { grid-template-columns: 1fr; } }

/* trang Vai trò & phân quyền vừa khít cửa sổ (class vt-fit do nguoidung.js bật, chỉ màn hình đủ lớn): danh sách / bảng tự cuộn, tiêu đề cột và nút Lưu luôn nhìn thấy */
.vt-fit-page .hqms-app { margin-bottom: 0 !important; }
.vt-fit-page .hqms-app ~ div.hidden-print { display: none !important; }   /* chỉ khối đệm SAU nội dung (footer.php); menu và khối đệm đầu trang cũng có class hidden-print nhưng đứng trước */
.vt-fit { display: flex; flex-direction: column; height: var(--vt-h, auto); min-height: 0; }
.vt-fit > .vt-tabs { flex: none; margin-bottom: 8px; }
.vt-fit > .tab-content { flex: 1 1 auto; min-height: 0; }
.vt-fit > .tab-content > .tab-pane.active { display: flex !important; flex-direction: column; height: 100%; min-height: 0; }
.vt-fit .vt-tools { flex: none; }
.vt-fit > .tab-content > .tab-pane > .table-responsive { flex: 1 1 auto; min-height: 0; overflow: auto !important; margin-bottom: 0; }
.vt-fit > .tab-content > .tab-pane > .table-responsive thead th { position: sticky; top: 0; z-index: 2; background: #eef1f5; }
.vt-fit > .tab-content > .tab-pane > .row { display: flex; flex: 1 1 auto; min-height: 0; }
.vt-fit > .tab-content > .tab-pane > .row::before, .vt-fit > .tab-content > .tab-pane > .row::after { display: none; }
.vt-fit > .tab-content > .tab-pane > .row > .col-md-3 { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.vt-fit > .tab-content > .tab-pane > .row > .col-md-3 > .list-group { flex: 0 1 auto; min-height: 0; overflow-y: auto; margin-bottom: 8px; }
.vt-fit > .tab-content > .tab-pane > .row > .col-md-3 > .btn { flex: none; }
.vt-fit > .tab-content > .tab-pane > .row > .col-md-9 { height: 100%; min-height: 0; }
.vt-fit .col-md-9 > .hqms-card { display: flex; flex-direction: column; height: 100%; min-height: 0; margin-bottom: 0; overflow: hidden; }
.vt-fit .col-md-9 > .hqms-card > * { flex: none; }
.vt-fit .col-md-9 > .hqms-card > .tab-content { flex: 1 1 auto; min-height: 120px; }
.vt-fit .col-md-9 > .hqms-card > .tab-content > .tab-pane.active { display: flex !important; flex-direction: column; height: 100%; min-height: 0; overflow-y: auto; }
.vt-fit .col-md-9 > .hqms-card > .tab-content > .tab-pane.active > .vt-matrix { flex: 1 1 auto; min-height: 0; max-height: none; }
.vt-fit .col-md-9 > .hqms-card { padding: 10px 12px; }
.vt-fit .col-md-9 > .hqms-card .form-group { margin-bottom: 6px; }
.vt-fit .col-md-9 > .hqms-card .form-group > label { margin-bottom: 2px; }
.vt-fit .col-md-9 .vt-sub { margin: 2px 0 4px; }
.vt-fit .col-md-9 .tab-pane > p.small { margin-bottom: 3px; }
.vt-fit .col-md-9 .tab-pane > .vt-matrix { min-height: 180px; }

/* bố cục trang Vai trò & phân quyền; cỡ nút, ô nhập, tab, phân trang theo theme (btn-sm, input-sm, nav-pills, pagination) */
.vt-edhead { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; justify-content: space-between; padding-bottom: 8px; margin-bottom: 10px; border-bottom: 1px solid #dde2e8; }
.vt-edten { min-width: 0; }
.vt-edten b { display: block; }
.vt-edten span { font-size: 90%; color: #5b6675; }
.vt-actions .btn-danger { margin-right: 10px; }
.vt-sw label { display: inline-flex; align-items: center; gap: 6px; margin: 22px 0 0; }
.vt-sw input { margin: 0; }
.vt-role-list .list-group-item.active, .vt-role-list .list-group-item.active:hover, .vt-role-list .list-group-item.active:focus { background: var(--hqms-theme-primary); border-color: var(--hqms-theme-primary); }
.vt-role-list .list-group-item.active b { color: #fff; }
.vt-pager .pagination { margin: 0; vertical-align: middle; }
.vt-pager select.form-control { width: auto; }
.vt-chip.on { background: var(--hqms-theme-primary-soft, #e6f0f6); border-color: var(--hqms-theme-primary); }
#vt-md-user .modal-body { max-height: calc(100vh - 170px); overflow-y: auto; }   /* form dài: thân tự cuộn, footer luôn nhìn thấy */
#vt-md-user .vt-chips { max-width: none; }
@media (max-width: 767px) { .vt-sw label { margin-top: 0; } }

/* nút + hộp thoại "Ai có quyền" (access.js, chỉ quản trị) */
.page-header h1 .hqms-acc-btn { vertical-align: middle; margin-left: 4px; font-size: 12px; }
.hqms-acc .modal-dialog { width: min(1100px, 96vw); }
.hqms-acc-owner { margin-bottom: 6px; }
.hqms-acc-note { margin-bottom: 4px; }
.hqms-acc-tabs { margin: 10px 0 8px; }
.hqms-acc-tools { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.hqms-acc-tools input[type=search] { max-width: 320px; }
.hqms-acc-table { font-size: 12px; margin-bottom: 6px; }
.hqms-acc-table > thead > tr > th { white-space: nowrap; vertical-align: bottom; background: #f5f7fa; }
.hqms-acc-table td.hqms-acc-rec, .hqms-acc-table th.hqms-acc-rec { text-align: center; background: #f3f8ff; }
.hqms-acc-lv { display: inline-block; padding: 1px 6px; border-radius: 10px; font-size: 11px; white-space: nowrap; }
.hqms-acc-lv0 { color: #9ca3af; }
.hqms-acc-lv1 { background: #fef3c7; color: #92400e; }
.hqms-acc-lv2 { background: #e0f2fe; color: #075985; }
.hqms-acc-lv3 { background: #dcfce7; color: #166534; }
.hqms-acc-legend { margin-top: 6px; }
