/**
 * HỆ THỐNG QUẢN LÝ NỀ NẾP, CHUYÊN CẦN & THI ĐUA ĐIỆN TỬ — TRƯỜNG THPT QUAN HÓA
 * Design System: Modern Edu-Bento Spatial + High-Contrast WCAG AAA (/lamgiaodien v2.2.0)
 * Typography: Be Vietnam Pro + Lexend | Tabular Numerals 100% | Mobile-First Responsive
 */

:root {
    --nn-bg-canvas: #f1f5f9;
    --nn-bg-surface: #ffffff;
    --nn-bg-subtle: #e2e8f0;
    --nn-bg-navy: #0f2942;
    --nn-bg-crimson: #991b1b;

    --nn-text-primary: #0f172a;
    --nn-text-secondary: #1e293b;
    --nn-text-muted: #475569;

    --nn-border: #cbd5e1;
    --nn-border-subtle: #e2e8f0;
    --nn-border-default: #cbd5e1;
    --nn-border-strong: #94a3b8;

    --nn-primary: #991b1b;
    --nn-primary-hover: #7f1d1d;
    --nn-primary-soft: #fee2e2;

    --nn-navy: #0f2942;
    --nn-navy-soft: #e0f2fe;

    --nn-emerald: #047857;
    --nn-success: #047857;
    --nn-emerald-soft: #d1fae5;

    --nn-amber: #b45309;
    --nn-warning: #d97706;
    --nn-amber-soft: #fef3c7;

    --nn-danger: #b91c1c;
    --nn-danger-soft: #fee2e2;

    --nn-blue: #1d4ed8;
    --nn-blue-soft: #dbeafe;

    --nn-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.06);
    --nn-shadow-sm: 0 2px 8px -1px rgba(15, 23, 42, 0.08), 0 1px 3px -1px rgba(15, 23, 42, 0.05);
    --nn-shadow-md: 0 8px 20px -4px rgba(15, 23, 42, 0.10), 0 3px 8px -3px rgba(15, 23, 42, 0.06);
    --nn-shadow-lg: 0 16px 32px -6px rgba(15, 23, 42, 0.16), 0 6px 12px -4px rgba(15, 23, 42, 0.08);

    --nn-radius-sm: 8px;
    --nn-radius-md: 12px;
    --nn-radius-lg: 16px;
    --nn-radius-xl: 20px;

    --nn-ease: cubic-bezier(0.23, 1, 0.32, 1);
}

/* =========================================================================
   0. CÔ LẬP KHUNG TRANG WORDPRESS (FRONTEND & WP-ADMIN) & KHỬ BÓNG TRẮNG MỜ
   ========================================================================= */
.qh-nn-wp-admin-wrap {
    margin: 12px 16px 0 2px !important;
    padding: 0 !important;
}

#wpbody-content .qh-nn-wp-admin-wrap *,
#qh-nenep-root,
#qh-nenep-root * {
    box-sizing: border-box;
}

body.toplevel_page_qh-nenep-manager #wpcontent {
    background: var(--nn-bg-canvas) !important;
}

body.toplevel_page_qh-nenep-manager .qh-nn-container {
    max-width: 1440px;
}

body.page-slug-ne-nep #page,
body.qh-nenep-page #page,
body.page-slug-ne-nep .site-content,
body.qh-nenep-page .site-content,
body.page-slug-ne-nep .site-content .row,
body.qh-nenep-page .site-content .row,
body.page-slug-ne-nep #primary,
body.qh-nenep-page #primary,
body.page-slug-ne-nep #main,
body.qh-nenep-page #main,
body.page-slug-ne-nep article.page,
body.qh-nenep-page article.page,
body.page-slug-ne-nep .entry-content,
body.qh-nenep-page .entry-content {
    min-width: 0 !important;
    max-width: 100% !important;
}

body.page-slug-ne-nep .site-content .row,
body.qh-nenep-page .site-content .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

body.page-slug-ne-nep #primary,
body.qh-nenep-page #primary {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    float: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Triệt tiêu hoàn toàn kích thước nội tại (min-content blowout) của các thanh cuộn ngang */
#qh-nenep-root .qh-nn-cat-pills-bar,
#qh-nenep-root .qh-nn-quick-loc-bar,
#qh-nenep-root .qh-nn-feed-filter-pills,
#qh-nenep-root .qh-nn-segmented-bar {
    contain: inline-size;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

#qh-nenep-root .qh-nn-time-mode-scroll {
    min-width: 0 !important;
    max-width: 100% !important;
}

body.page-slug-ne-nep #secondary,
body.qh-nenep-page #secondary,
body.page-slug-ne-nep .entry-header,
body.qh-nenep-page .entry-header,
body.page-slug-ne-nep .page-header,
body.qh-nenep-page .page-header,
body.page-slug-ne-nep .top-bar,
body.qh-nenep-page .top-bar {
    display: none !important;
}

body.page-slug-ne-nep .site-content,
body.qh-nenep-page .site-content {
    padding-top: 10px !important;
    padding-bottom: 32px !important;
    background: var(--bg-canvas, #f8fafc) !important;
}

/* Đồng bộ trục lề trái-phải khớp tuyệt đối 100% với Header 3 tầng & Footer của cổng trường */
body.page-slug-ne-nep .site-content > .container,
body.qh-nenep-page .site-content > .container {
    max-width: var(--qh-container-max, 1380px) !important;
    width: 100% !important;
    padding-left: var(--qh-container-pad, 24px) !important;
    padding-right: var(--qh-container-pad, 24px) !important;
}

body.page-slug-ne-nep .entry-content,
body.qh-nenep-page .entry-content {
    margin: 0 !important;
}

/* ẨN HOÀN TOÀN THANH PHIÊN LÀM VIỆC CŨ */
#qh-nenep-root .qh-nn-rbac-bar,
.qh-nn-rbac-bar {
    display: none !important;
}

/* Khử hoàn toàn lớp bóng trắng mờ (inset white glare) và text-shadow trắng của theme / wp-admin */
#qh-nenep-root button,
#qh-nenep-root input[type="button"],
#qh-nenep-root input[type="reset"],
#qh-nenep-root input[type="submit"],
#qh-nenep-root .qh-nn-btn,
#qh-nenep-root .qh-nn-btn-hero,
#qh-nenep-root .qh-nn-tab-btn,
#qh-nenep-root .qh-nn-pill-btn {
    text-shadow: none !important;
    box-shadow: none;
    font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Chuẩn hóa trạng thái Focus-Visible bàn phím (WCAG 2.2 AA) */
#qh-nenep-root button:focus-visible,
#qh-nenep-root a:focus-visible,
#qh-nenep-root select:focus-visible,
#qh-nenep-root input:focus-visible,
#qh-nenep-root textarea:focus-visible {
    outline: 2px solid #0284c7 !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.2) !important;
}

#qh-nenep-root select.qh-nn-select,
#qh-nenep-root input.qh-nn-input,
#qh-nenep-root textarea.qh-nn-textarea {
    max-width: 100%;
    line-height: 1.4;
}

.qh-nn-app {
    font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--nn-text-primary);
    background: transparent;
    padding: 0 0 28px;
    line-height: 1.5;
}

.qh-nn-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

.qh-nn-num {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}

/* =========================================================================
   1. HEADER TRANG TRANG TRỌNG (.qh-nn-hero) & 4 THẺ CHỈ SỐ TỔNG QUAN (.qh-nn-kpi)
   ========================================================================= */
.qh-nn-hero {
    background: linear-gradient(135deg, #091d34 0%, #0f2942 58%, #163a5f 100%);
    border-radius: 12px;
    padding: 10px 18px;
    color: #ffffff !important;
    box-shadow: 0 3px 10px -2px rgba(9, 29, 52, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
    margin-bottom: 10px;
    border: 1px solid rgba(30, 58, 95, 0.9);
}

.qh-nn-hero::before {
    content: "";
    position: absolute;
    right: -40px;
    top: -60px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.10) 0%, rgba(56, 189, 248, 0) 70%);
    pointer-events: none;
}

.qh-nn-hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.qh-nn-hero-heading {
    flex: 1;
    min-width: 260px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.qh-nn-hero-title-line {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.qh-nn-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.22);
    flex-shrink: 0;
}

.qh-nn-hero-title {
    font-family: 'Lexend', 'Be Vietnam Pro', sans-serif;
    font-size: clamp(17px, 1.55vw, 19.5px);
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #ffffff !important;
    margin: 0 !important;
    line-height: 1.3;
}

.qh-nn-hero-meta-line {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #dbeafe;
    min-width: 0;
}

.qh-nn-hero-meta-line > strong {
    color: #ffffff;
    font-weight: 700;
}

.qh-nn-hero-meta-line #qhDutyScopeLabel strong {
    color: #ffffff;
    font-weight: 600;
}

.qh-nn-hero-meta-line .qh-nn-duty-desc {
    color: #bfdbfe;
    font-size: 12.5px;
    max-width: 60ch;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#qh-nenep-root .qh-nn-hero-sub,
body.qh-nenep-page .entry-content p.qh-nn-hero-sub,
body.page-slug-ne-nep .entry-content p.qh-nn-hero-sub {
    margin: 0 !important;
    color: #dbeafe !important;
    font-size: 12.5px !important;
    line-height: 1.4 !important;
    max-width: 96ch;
    font-weight: 400;
}

#qh-nenep-root .qh-nn-hero-sub strong {
    color: #ffffff !important;
    font-weight: 600;
}

.qh-nn-hero-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* Ẩn hàng nút phụ trên Desktop vì đã có thanh Tab điều hướng ngay bên dưới */
.qh-nn-hero-secondary {
    display: none !important;
}

#qh-nenep-root .qh-nn-btn-hero {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 36px;
    padding: 6px 14px;
    border-radius: 9px;
    font-size: 12.8px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(186, 230, 253, 0.35);
    background: rgba(255, 255, 255, 0.09);
    color: #ffffff !important;
    text-decoration: none !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14) !important;
    transition: transform 140ms var(--nn-ease), background-color 140ms ease, border-color 140ms ease;
}

#qh-nenep-root .qh-nn-btn-hero:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(186, 230, 253, 0.65);
    color: #ffffff !important;
    transform: translateY(-1px);
}

#qh-nenep-root .qh-nn-btn-hero:active {
    transform: scale(0.98);
}

/* Nút Đăng nhập Cán bộ / Giáo viên: Nổi bật thanh lịch trên nền Navy, không lấn át tiêu đề */
#qh-nenep-root .qh-nn-btn-hero.login-cta {
    background: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.95) !important;
    color: #0f2942 !important;
    font-weight: 700;
    padding: 7px 15px;
    min-height: 38px;
    box-shadow: 0 2px 6px rgba(9, 26, 43, 0.2) !important;
}

#qh-nenep-root .qh-nn-btn-hero.login-cta i {
    color: #0369a1;
}

#qh-nenep-root .qh-nn-btn-hero.login-cta:hover {
    background: #f1f5f9 !important;
    border-color: #ffffff !important;
    color: #091d34 !important;
}

#qh-nenep-root .qh-nn-btn-hero.emerald {
    background: #047857 !important;
    border-color: #34d399 !important;
    color: #ffffff !important;
    font-weight: 700;
}

#qh-nenep-root .qh-nn-btn-hero.emerald:hover {
    background: #065f46 !important;
    border-color: #6ee7b7 !important;
}

#qh-nenep-root .qh-nn-btn-hero.gold {
    background: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.92) !important;
    color: #0f2942 !important;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(9, 26, 43, 0.18) !important;
}

#qh-nenep-root .qh-nn-btn-hero.gold:hover {
    background: #f1f5f9 !important;
    color: #091d34 !important;
}

#qh-nenep-root .qh-nn-btn-hero.logout {
    background: rgba(185, 28, 28, 0.28) !important;
    border-color: rgba(252, 165, 165, 0.42) !important;
    color: #fecaca !important;
}

#qh-nenep-root .qh-nn-btn-hero.logout:hover {
    background: #991b1b !important;
    color: #ffffff !important;
}

/* 4 THẺ CHỈ SỐ KPI NGANG (CLEAN ELEVATED CARDS, KHÔNG VIỀN DỌC DÀY) */
.qh-nn-kpi-section {
    margin-bottom: 10px;
}

.qh-nn-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.qh-nn-kpi-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 11px;
    padding: 9px 12px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    min-width: 0;
    transition: transform 140ms var(--nn-ease), box-shadow 140ms ease, border-color 140ms ease;
}

.qh-nn-kpi-card:hover {
    transform: translateY(-1px);
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px -2px rgba(15, 41, 66, 0.07);
}

.qh-nn-kpi-card.kpi-crimson {
    border-color: #fecaca;
    background: #fffdfd;
}

.qh-nn-kpi-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    border: 1px solid transparent;
}

.qh-nn-kpi-icon.gold {
    background: #fffbeb;
    color: #b45309;
    border-color: #fde68a;
}

.qh-nn-kpi-icon.blue {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

.qh-nn-kpi-icon.emerald {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.qh-nn-kpi-icon.amber {
    background: #fffbeb;
    color: #b45309;
    border-color: #fde68a;
}

.qh-nn-kpi-icon.crimson {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.qh-nn-kpi-body {
    flex: 1;
    min-width: 0;
}

.qh-nn-kpi-head {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #64748b !important;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qh-nn-kpi-val {
    font-family: 'Lexend', 'Be Vietnam Pro', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #0f2942 !important;
    line-height: 1.28;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qh-nn-kpi-card.kpi-crimson .qh-nn-kpi-val {
    color: #991b1b !important;
}

.qh-nn-kpi-foot {
    font-size: 11.5px;
    color: #475569 !important;
    font-weight: 500;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qh-nn-kpi-foot strong {
    color: #0f2942;
    font-weight: 700;
}

/* =========================================================================
   2. NAVIGATION TABS (8 PHÂN HỆ — TỰ ĐỘNG VỪA KHÍT 100% TRONG KHUNG GIỚI HẠN)
   ========================================================================= */
.qh-nn-tabs-bar {
    display: flex;
    align-items: stretch;
    gap: 4px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: var(--nn-bg-surface);
    padding: 5px;
    border-radius: 11px;
    border: 1px solid var(--nn-border-default);
    box-shadow: var(--nn-shadow-xs);
    margin-bottom: 10px;
    flex-wrap: nowrap;
    overflow: hidden;
}

.qh-nn-tabs-bar::-webkit-scrollbar {
    display: none;
}

#qh-nenep-root .qh-nn-tab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 36px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: #1e293b !important;
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    flex: 0 0 auto;
    box-sizing: border-box;
    box-shadow: none !important;
    transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease, transform 120ms var(--nn-ease);
}

/* Khi có 7–8 tab trên 1 dòng rộng: co giãn thông minh vừa khít 100% khung 1380px trên 1 hàng ngang không tràn mép */
#qh-nenep-root .qh-nn-tabs-bar[data-tab-count="7"]:not(.is-wrapped-grid) .qh-nn-tab-btn,
#qh-nenep-root .qh-nn-tabs-bar[data-tab-count="8"]:not(.is-wrapped-grid) .qh-nn-tab-btn {
    flex: 1 0 auto;
    padding: 6px 5px;
    font-size: 11.5px;
    letter-spacing: -0.012em;
    gap: 4px;
}

#qh-nenep-root .qh-nn-tab-btn i {
    color: #475569;
    font-size: 12.5px;
    flex-shrink: 0;
}

#qh-nenep-root .qh-nn-tab-btn:hover {
    background: #f1f5f9;
    color: #0f172a !important;
}

#qh-nenep-root .qh-nn-tab-btn:active {
    transform: scale(0.98);
}

/* Tab 7: Quản lý Lớp, GV & Học sinh (Chỉ đẩy sang phải khi thanh có <= 6 tab) */
#qh-nenep-root .qh-nn-tab-btn.qh-nn-tab-master {
    background: #f0fdf4;
    border-color: #86efac;
    color: #065f46 !important;
    margin-left: auto;
}

#qh-nenep-root .qh-nn-tabs-bar[data-tab-count="7"] .qh-nn-tab-btn.qh-nn-tab-master,
#qh-nenep-root .qh-nn-tabs-bar[data-tab-count="8"] .qh-nn-tab-btn.qh-nn-tab-master {
    margin-left: 0;
}

/* Chế độ Lưới Cân Xứng Tự Động (.is-wrapped-grid hoặc màn hình < 1200px) — Khớp trục dọc 4 Thẻ KPI bên trên, tuyệt đối không cắt chữ */
#qh-nenep-root .qh-nn-tabs-bar.is-wrapped-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 6px;
}

#qh-nenep-root .qh-nn-tabs-bar.is-wrapped-grid[data-tab-count="5"],
#qh-nenep-root .qh-nn-tabs-bar.is-wrapped-grid[data-tab-count="6"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

#qh-nenep-root .qh-nn-tabs-bar.is-wrapped-grid[data-tab-count="2"],
#qh-nenep-root .qh-nn-tabs-bar.is-wrapped-grid[data-tab-count="3"],
#qh-nenep-root .qh-nn-tabs-bar.is-wrapped-grid[data-tab-count="4"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

#qh-nenep-root .qh-nn-tabs-bar.is-wrapped-grid .qh-nn-tab-btn {
    width: 100%;
    min-width: 0;
    margin-left: 0 !important;
    justify-content: flex-start;
    padding: 7px 10px;
    font-size: 12.3px;
    background: #f8fafc;
    border-color: #e2e8f0;
}

#qh-nenep-root .qh-nn-tabs-bar.is-wrapped-grid .qh-nn-tab-btn:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}

#qh-nenep-root .qh-nn-tabs-bar.is-wrapped-grid .qh-nn-tab-btn.qh-nn-tab-master {
    background: #f0fdf4;
    border-color: #86efac;
}

#qh-nenep-root .qh-nn-tabs-bar.is-wrapped-grid .qh-nn-tab-btn > span[id^="tabLabel"] {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#qh-nenep-root .qh-nn-tabs-bar.is-wrapped-grid .qh-nn-tab-btn .qh-nn-tab-badge {
    margin-left: auto;
    flex-shrink: 0;
}

@media (max-width: 1180px) and (min-width: 681px) {
    #qh-nenep-root .qh-nn-tabs-bar:not([data-tab-count="1"]):not([data-tab-count="2"]):not([data-tab-count="3"]):not([data-tab-count="4"]) {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
        padding: 6px;
    }
    #qh-nenep-root .qh-nn-tabs-bar[data-tab-count="5"],
    #qh-nenep-root .qh-nn-tabs-bar[data-tab-count="6"] {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    #qh-nenep-root .qh-nn-tabs-bar:not([data-tab-count="1"]):not([data-tab-count="2"]):not([data-tab-count="3"]):not([data-tab-count="4"]) .qh-nn-tab-btn {
        width: 100%;
        min-width: 0;
        margin-left: 0 !important;
        justify-content: flex-start;
        padding: 7px 10px;
        font-size: 12.3px;
        background: #f8fafc;
        border-color: #e2e8f0;
    }
    #qh-nenep-root .qh-nn-tabs-bar:not([data-tab-count="1"]):not([data-tab-count="2"]):not([data-tab-count="3"]):not([data-tab-count="4"]) .qh-nn-tab-btn.qh-nn-tab-master {
        background: #f0fdf4;
        border-color: #86efac;
    }
    #qh-nenep-root .qh-nn-tabs-bar:not([data-tab-count="1"]):not([data-tab-count="2"]):not([data-tab-count="3"]):not([data-tab-count="4"]) .qh-nn-tab-btn > span[id^="tabLabel"] {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    #qh-nenep-root .qh-nn-tabs-bar:not([data-tab-count="1"]):not([data-tab-count="2"]):not([data-tab-count="3"]):not([data-tab-count="4"]) .qh-nn-tab-btn .qh-nn-tab-badge {
        margin-left: auto;
        flex-shrink: 0;
    }
}

@media (max-width: 900px) and (min-width: 681px) {
    #qh-nenep-root .qh-nn-tabs-bar.is-wrapped-grid,
    #qh-nenep-root .qh-nn-tabs-bar:not([data-tab-count="1"]):not([data-tab-count="2"]) {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

#qh-nenep-root .qh-nn-tab-btn.qh-nn-tab-master i {
    color: #047857;
}

/* Tab đang chọn (Active) */
#qh-nenep-root .qh-nn-tab-btn.is-active {
    background: #0f2942 !important;
    border-color: #0f2942 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(15, 41, 66, 0.22) !important;
}

#qh-nenep-root .qh-nn-tab-btn.is-active i {
    color: #fde68a !important;
}

#qh-nenep-root .qh-nn-tab-btn.qh-nn-tab-master.is-active {
    background: #047857 !important;
    border-color: #047857 !important;
    color: #ffffff !important;
}

.qh-nn-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    background: #e2e8f0;
    color: #0f172a;
}

#qh-nenep-root .qh-nn-tab-btn.qh-nn-tab-master .qh-nn-tab-badge {
    background: #059669;
    color: #ffffff;
}

#qh-nenep-root .qh-nn-tab-btn.is-active .qh-nn-tab-badge {
    background: #f59e0b !important;
    color: #0f172a !important;
}

.qh-nn-panel {
    display: none;
}

.qh-nn-panel.is-active {
    display: block;
    animation: qhNnFadeIn 160ms var(--nn-ease);
}

@keyframes qhNnFadeIn {
    from { opacity: 0; transform: translateY(3px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================================================
   3. COMMON CARDS, CONTROLS & FILTERS (OPERATE DENSITY)
   ========================================================================= */
.qh-nn-card {
    background: var(--nn-bg-surface);
    border: 1px solid var(--nn-border-default);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: var(--nn-shadow-xs);
    margin-bottom: 12px;
    color: var(--nn-text-primary);
}

/* Banner trung tâm dữ liệu gốc Tab 7 */
.qh-nn-card.qh-nn-masterdata-banner {
    background: linear-gradient(135deg, #0b1f3a 0%, #16325c 100%) !important;
    color: #ffffff !important;
    border: 1px solid #1e3a5f !important;
}

.qh-nn-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--nn-border-subtle);
}

.qh-nn-card-title {
    font-family: 'Lexend', sans-serif;
    font-size: 17.5px;
    font-weight: 800;
    color: #0f172a !important;
    margin: 0 !important;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.35;
}

.qh-nn-card-sub,
body.qh-nenep-page .entry-content p.qh-nn-card-sub,
body.page-slug-ne-nep .entry-content p.qh-nn-card-sub {
    font-size: 13.5px !important;
    color: #334155 !important;
    margin: 4px 0 0 0 !important;
    line-height: 1.5;
}

.qh-nn-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.qh-nn-select,
.qh-nn-input,
.qh-nn-textarea {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    color: #0f172a !important;
    background: #ffffff !important;
    border: 1.5px solid #94a3b8 !important;
    border-radius: var(--nn-radius-sm);
    min-height: 40px;
    padding: 6px 12px;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.qh-nn-select::placeholder,
.qh-nn-input::placeholder,
.qh-nn-textarea::placeholder {
    color: #64748b !important;
    opacity: 1;
}

.qh-nn-select:focus,
.qh-nn-input:focus,
.qh-nn-textarea:focus {
    outline: 2px solid #0f2942;
    outline-offset: 1px;
    border-color: #0f2942 !important;
    box-shadow: 0 0 0 3px rgba(15, 41, 66, 0.16) !important;
}

/* NHÓM NÚT LỌC PILL (TẤT CẢ / KHỐI MŨI NHỌN / KHỐI CƠ BẢN...) */
.qh-nn-pill-group {
    display: inline-flex;
    background: #e2e8f0;
    border: 1px solid #cbd5e1;
    padding: 4px;
    border-radius: 10px;
    gap: 4px;
    flex-wrap: wrap;
}

#qh-nenep-root .qh-nn-pill-btn {
    border: 1px solid transparent;
    background: transparent;
    padding: 6px 13px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 700;
    color: #1e293b !important;
    cursor: pointer;
    box-shadow: none !important;
    transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

#qh-nenep-root .qh-nn-pill-btn:hover {
    background: rgba(255, 255, 255, 0.65);
    color: #0f172a !important;
}

#qh-nenep-root .qh-nn-pill-btn.is-active {
    background: #0f2942 !important;
    color: #ffffff !important;
    border-color: #0f2942 !important;
    box-shadow: 0 2px 5px rgba(15, 41, 66, 0.22) !important;
}

/* =========================================================================
   4. DẢI VINH DANH LỚP DẪN ĐẦU (.qh-nn-podium-grid — TINH GỌN, TRANG TRỌNG)
   ========================================================================= */
.qh-nn-podium-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.qh-nn-podium-grid:empty {
    display: none;
}

.qh-nn-podium-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 11px;
    padding: 7px 12px;
    position: relative;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.qh-nn-podium-card:hover {
    box-shadow: 0 3px 10px -2px rgba(15, 41, 66, 0.07);
}

.qh-nn-podium-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.qh-nn-podium-right {
    text-align: right;
    flex-shrink: 0;
}

.qh-nn-podium-card.rank-1 {
    background: linear-gradient(90deg, rgba(254, 243, 199, 0.35) 0%, #ffffff 46%);
    border-color: #fde68a;
}

.qh-nn-podium-card.rank-2 {
    background: linear-gradient(90deg, rgba(224, 242, 254, 0.42) 0%, #ffffff 46%);
    border-color: #bae6fd;
}

.qh-nn-podium-card.rank-3 {
    background: linear-gradient(90deg, rgba(241, 245, 249, 0.65) 0%, #ffffff 46%);
    border-color: #cbd5e1;
}

.qh-nn-podium-medal {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Lexend', sans-serif;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    border: 1px solid transparent;
}

.rank-1 .qh-nn-podium-medal {
    background: #fef3c7;
    color: #b45309;
    border-color: #fcd34d;
}
.rank-2 .qh-nn-podium-medal {
    background: #e0f2fe;
    color: #0369a1;
    border-color: #7dd3fc;
}
.rank-3 .qh-nn-podium-medal {
    background: #f1f5f9;
    color: #334155;
    border-color: #cbd5e1;
}

.qh-nn-podium-info,
.qh-nn-podium-body {
    flex: 1;
    min-width: 0;
}

.qh-nn-podium-label,
.qh-nn-podium-rank {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #92400e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rank-2 .qh-nn-podium-rank {
    color: #0369a1;
}

.rank-3 .qh-nn-podium-rank {
    color: #475569;
}

.qh-nn-podium-class-line {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}

.qh-nn-podium-class {
    font-family: 'Lexend', 'Be Vietnam Pro', sans-serif;
    font-size: 14.5px;
    font-weight: 700;
    color: #0f2942;
    margin: 1px 0;
    white-space: nowrap;
}

.qh-nn-podium-room {
    font-size: 11.5px;
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qh-nn-podium-gv,
.qh-nn-podium-teacher {
    font-size: 11.5px;
    font-weight: 500;
    color: #475569;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qh-nn-podium-teacher strong {
    color: #1e293b;
    font-weight: 600;
}

.qh-nn-podium-score {
    font-family: 'Lexend', 'Be Vietnam Pro', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: #0f2942;
    line-height: 1.2;
}

.qh-nn-podium-score span {
    font-size: 11.5px;
    color: #64748b;
    font-weight: 600;
    margin-left: 1px;
}

.qh-nn-podium-mini-meta {
    font-size: 11px;
    font-weight: 500;
    color: #475569;
    margin-top: 2px;
    white-space: nowrap;
}

/* =========================================================================
   5. BẢNG DỮ LIỆU XẾP HẠNG 24 LỚP CHUẨN CỔNG GIÁO DỤC (.qh-nn-table)
   ========================================================================= */
.qh-nn-mobile-scroll-hint {
    display: none;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-size: 12px;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.qh-nn-mobile-scroll-hint i {
    color: #0284c7;
}

.qh-nn-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e2e8f0;
    border-radius: 11px;
    background: #ffffff;
    max-width: 100%;
}

.qh-nn-table {
    width: 100%;
    margin: 0 !important;
    border-collapse: collapse;
    font-size: 13.5px;
    background: #ffffff;
    color: #0f172a;
}

.qh-nn-table th {
    background: #f1f5f9;
    color: #0f2942;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 9px 10px;
    border-bottom: 1px solid #cbd5e1;
    white-space: nowrap;
}

.qh-nn-table td {
    padding: 9px 10px;
    border-bottom: 1px solid #edf2f7;
    vertical-align: middle;
    color: #1e293b;
}

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

.qh-nn-table th.col-center,
.qh-nn-table td.col-center {
    text-align: center !important;
}

.qh-nn-table th.col-left,
.qh-nn-table td.col-left {
    text-align: left !important;
}

.qh-nn-table th.col-right,
.qh-nn-table td.col-right {
    text-align: right !important;
}

.qh-nn-table tbody tr {
    transition: background-color 120ms ease;
}

/* Nhấn nhẹ các hạng dẫn đầu (Hạng 1, 2) & lớp phụ trách */
.qh-nn-scoreboard-table tbody tr.is-rank-1 {
    background: linear-gradient(90deg, rgba(254, 243, 199, 0.28) 0%, rgba(255, 255, 255, 0) 45%);
}

.qh-nn-scoreboard-table tbody tr.is-rank-1 td:first-child {
    box-shadow: inset 3px 0 0 #d97706;
}

.qh-nn-scoreboard-table tbody tr.is-rank-2 td:first-child {
    box-shadow: inset 3px 0 0 #0284c7;
}

.qh-nn-scoreboard-table tbody tr.is-own-class {
    background: #fffdf5;
}

.qh-nn-scoreboard-table tbody tr.is-own-class td:first-child {
    box-shadow: inset 3px 0 0 #0f2942;
}

.qh-nn-scoreboard-table tbody tr.is-below-threshold {
    background: #fffafa;
}

.qh-nn-scoreboard-table tbody tr.is-below-threshold td:first-child {
    box-shadow: inset 3px 0 0 #dc2626;
}

.qh-nn-table tbody tr:hover,
.qh-nn-scoreboard-table tbody tr:hover {
    background: #f4f7fb !important;
}

/* Các phần tử định dạng trong ô Bảng xếp hạng */
.qh-nn-cell-stack-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.qh-nn-cell-stack-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
}

.qh-nn-cell-class {
    font-family: 'Lexend', 'Be Vietnam Pro', sans-serif;
    font-size: 14.5px;
    font-weight: 700;
    color: #0f2942;
    white-space: nowrap;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 6px;
}

.qh-nn-cell-track-row {
    margin-top: 3px;
}

.qh-nn-track-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11.2px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
}

.qh-nn-track-tag.is-mn {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}

.qh-nn-track-tag.is-cb {
    background: #f0f9ff;
    color: #075985;
    border-color: #bae6fd;
}

.qh-nn-own-tag {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: 999px;
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 11px;
    font-weight: 600;
    background: #e0f2fe;
    color: #075985;
    border: 1px solid #bae6fd;
}

.qh-nn-cell-teacher {
    font-size: 13.5px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
}

.qh-nn-cell-sub {
    font-size: 11.8px;
    color: #64748b;
    margin-top: 2px;
    white-space: nowrap;
}

.qh-nn-cell-sub strong {
    color: #334155;
    font-weight: 600;
}

.qh-nn-cell-sub.is-deduct-danger {
    color: #b91c1c;
    font-weight: 600;
}

.qh-nn-cell-sub.is-deduct-warn {
    color: #b45309;
    font-weight: 600;
}

.qh-nn-score-part {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
}

.qh-nn-score-part.is-deducted-danger {
    color: #b91c1c;
}

.qh-nn-score-part.is-deducted-warn {
    color: #b45309;
}

.qh-nn-score-denom {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
}

.qh-nn-total-score {
    font-family: 'Lexend', 'Be Vietnam Pro', sans-serif;
    font-size: 15.5px;
    font-weight: 700;
    color: #0f2942;
    white-space: nowrap;
}

.qh-nn-total-score small {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-left: 1px;
}

.qh-nn-total-score.is-below {
    color: #b91c1c;
}

.qh-nn-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
}

.qh-nn-status-chip.is-clean {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

.qh-nn-status-chip.is-neutral {
    background: #f8fafc;
    color: #475569;
    border-color: #e2e8f0;
}

.qh-nn-status-chip.is-info {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

.qh-nn-status-chip.is-muted {
    background: #f1f5f9;
    color: #64748b;
    border-color: #e2e8f0;
}

.qh-nn-std-note {
    font-size: 11.5px;
    color: #475569;
    font-weight: 500;
}

.qh-nn-labor-note {
    font-size: 11.8px;
    color: #991b1b;
    font-weight: 600;
}

.qh-nn-empty-cell {
    text-align: center !important;
    padding: 28px 16px !important;
    color: #64748b;
    font-size: 13.5px;
}

#qh-nenep-root .qh-nn-table-btn {
    min-height: 28px !important;
    padding: 3px 9px !important;
    font-size: 12px !important;
    border-radius: 6px !important;
}

#qh-nenep-root .qh-nn-table-btn.is-log-fault {
    background: #dc2626 !important;
    border-color: #b91c1c !important;
}

.qh-nn-status-dot.is-open {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    margin-right: 3px;
    vertical-align: middle;
}

/* Bảng quản lý Lớp / Học sinh / Giáo viên ở Tab 7 */
.qh-nn-md-table {
    min-width: 560px;
}

/* BADGES TƯƠNG PHẢN CAO, TIẾT CHẾ VIỀN */
.qh-nn-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
}

.qh-nn-badge.qh-nn-cls-badge {
    font-weight: 700;
}

.qh-nn-badge.success {
    background: #ecfdf5;
    color: #065f46 !important;
    border-color: #a7f3d0;
}
.qh-nn-badge.info {
    background: #eff6ff;
    color: #1e40af !important;
    border-color: #bfdbfe;
}
.qh-nn-badge.warning {
    background: #fffbeb;
    color: #92400e !important;
    border-color: #fde68a;
}
.qh-nn-badge.danger {
    background: #fef2f2;
    color: #991b1b !important;
    border-color: #fecaca;
}
.qh-nn-badge.subtle {
    background: #f1f5f9;
    color: #334155 !important;
    border-color: #cbd5e1;
}

/* =========================================================================
   6. HỆ THỐNG NÚT BẤM (.qh-nn-btn) — RÕ CHỮ, KHÔNG BỊ CHÌM MÀU
   ========================================================================= */
#qh-nenep-root .qh-nn-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 6px 14px;
    border-radius: var(--nn-radius-sm);
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: transform 120ms var(--nn-ease), background-color 150ms ease, border-color 150ms ease;
    text-decoration: none !important;
    box-shadow: none !important;
}

#qh-nenep-root .qh-nn-btn:active:not(:disabled) {
    transform: scale(0.98);
}

#qh-nenep-root .qh-nn-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

#qh-nenep-root .qh-nn-btn.primary {
    background: #991b1b;
    border-color: #7f1d1d;
    color: #ffffff !important;
}
#qh-nenep-root .qh-nn-btn.primary:hover:not(:disabled) {
    background: #7f1d1d;
    color: #ffffff !important;
}

/* Nút viền (Outline) xuất hiện trên toàn bộ 7 tab */
#qh-nenep-root .qh-nn-btn.outline {
    background: #ffffff;
    border: 1.5px solid #64748b;
    color: #0f2942 !important;
    font-weight: 700;
}
#qh-nenep-root .qh-nn-btn.outline:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: #0f2942;
    color: #0f172a !important;
}

#qh-nenep-root .qh-nn-btn.navy {
    background: #0f2942;
    border-color: #0f2942;
    color: #ffffff !important;
}
#qh-nenep-root .qh-nn-btn.navy:hover:not(:disabled) {
    background: #1e3a5f;
}

#qh-nenep-root .qh-nn-btn.emerald {
    background: #047857;
    border-color: #047857;
    color: #ffffff !important;
}

#qh-nenep-root .qh-nn-btn.gold {
    background: #f59e0b;
    border-color: #d97706;
    color: #0f172a !important;
    font-weight: 800;
}
#qh-nenep-root .qh-nn-btn.gold:hover:not(:disabled) {
    background: #d97706;
    color: #ffffff !important;
}

#qh-nenep-root .qh-nn-btn.subtle {
    background: #e2e8f0;
    color: #0f172a !important;
    border-color: #94a3b8;
}
#qh-nenep-root .qh-nn-btn.subtle:hover:not(:disabled) {
    background: #cbd5e1;
}

#qh-nenep-root .qh-nn-btn.sm {
    min-height: 32px;
    padding: 4px 10px;
    font-size: 12px;
}

/* =========================================================================
   7. SPLIT LAYOUT, FORM GRID, LESSON RATING CARDS & MODAL
   ========================================================================= */
.qh-nn-split-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
}

.qh-nn-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.qh-nn-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.qh-nn-checklist-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.qh-nn-field {
    margin-bottom: 12px;
}

.qh-nn-field label {
    display: block;
    font-size: 12.8px;
    font-weight: 700;
    color: #0f172a !important;
    margin-bottom: 5px;
}

.qh-nn-field .qh-nn-input,
.qh-nn-field .qh-nn-select,
.qh-nn-field .qh-nn-textarea {
    width: 100%;
    box-sizing: border-box;
}

.qh-nn-rating-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.qh-nn-rating-option {
    cursor: pointer;
    margin: 0 !important;
}

.qh-nn-rating-option input {
    display: none;
}

.qh-nn-rating-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    border-radius: 10px;
    border: 2px solid #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
    transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
    text-align: center;
}

.qh-nn-rating-box strong {
    font-size: 13.5px;
    color: #0f172a;
}

.qh-nn-rating-box em {
    font-style: normal;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    margin-top: 2px;
}

.qh-nn-rating-option input:checked + .qh-nn-rating-box.tot {
    border-color: #059669;
    background: #d1fae5;
    color: #065f46;
}
.qh-nn-rating-option input:checked + .qh-nn-rating-box.tot strong,
.qh-nn-rating-option input:checked + .qh-nn-rating-box.tot em {
    color: #065f46;
}

.qh-nn-rating-option input:checked + .qh-nn-rating-box.kha {
    border-color: #0284c7;
    background: #dbeafe;
    color: #1e40af;
}
.qh-nn-rating-option input:checked + .qh-nn-rating-box.kha strong,
.qh-nn-rating-option input:checked + .qh-nn-rating-box.kha em {
    color: #1e40af;
}

.qh-nn-rating-option input:checked + .qh-nn-rating-box.tb {
    border-color: #d97706;
    background: #fef3c7;
    color: #92400e;
}
.qh-nn-rating-option input:checked + .qh-nn-rating-box.tb strong,
.qh-nn-rating-option input:checked + .qh-nn-rating-box.tb em {
    color: #92400e;
}

.qh-nn-rating-option input:checked + .qh-nn-rating-box.yeu {
    border-color: #dc2626;
    background: #fee2e2;
    color: #991b1b;
}
.qh-nn-rating-option input:checked + .qh-nn-rating-box.yeu strong,
.qh-nn-rating-option input:checked + .qh-nn-rating-box.yeu em {
    color: #991b1b;
}

.qh-nn-rank-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 26px;
    padding: 0 9px;
    border-radius: 7px;
    font-weight: 700;
    font-size: 12.5px;
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.qh-nn-rank-pill.r-1 {
    background: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}

.qh-nn-rank-pill.r-2 {
    background: #e0f2fe;
    color: #075985;
    border-color: #bae6fd;
}

.qh-nn-rank-pill.r-3 {
    background: #f1f5f9;
    color: #0f2942;
    border-color: #cbd5e1;
}

/* TOAST NOTIFICATION */
.qh-nn-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100080;
    background: #0f2942;
    color: #ffffff;
    padding: 14px 20px;
    border-radius: 12px;
    box-shadow: var(--nn-shadow-lg);
    font-size: 14px;
    font-weight: 700;
    display: none;
    align-items: center;
    gap: 10px;
    max-width: 420px;
    border-left: 5px solid #10b981;
}

.qh-nn-toast.is-show,
.qh-nn-toast.is-visible {
    display: flex;
    animation: qhNnFadeIn 180ms var(--nn-ease);
}

.qh-nn-toast.is-error {
    border-left-color: #ef4444;
}

/* KHÓA CUỘN NỀN KHI MỞ OVERLAY PHÂN CÔNG CỜ ĐỎ (TRIỆT TIÊU THANH CUỘN KÉP) */
html.qh-nn-codo-modal-open,
body.qh-nn-codo-modal-open {
    overflow: hidden !important;
}

/* MODAL PHÂN RÃ ĐIỂM & HỆ THỐNG OVERLAY ĐA TẦNG (VƯỢT TRÊN #wpadminbar 99999) */
.qh-nn-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100010;
    background: rgba(15, 23, 42, 0.74);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.qh-nn-modal-backdrop.qh-nn-submodal-backdrop {
    z-index: 100030 !important;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(2px);
}

.qh-nn-modal-dialog {
    background: #ffffff;
    border-radius: 16px;
    max-width: 780px;
    width: 100%;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--nn-shadow-lg);
    overflow: hidden;
}

.qh-nn-modal-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--nn-border-default);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
}

.qh-nn-modal-body {
    padding: 18px;
    overflow-y: auto;
    font-size: 13.8px;
    line-height: 1.55;
    color: #0f172a;
}

/* PRINT A4 CHÀO CỜ STYLES */
.qh-nn-print-header {
    display: none;
}

@media print {
    header#masthead,
    .mobile-header,
    footer#colophon,
    .qh-nn-tabs-bar,
    .qh-nn-hero,
    .qh-nn-toolbar,
    .no-print {
        display: none !important;
    }
    .qh-nn-print-header {
        display: block !important;
        text-align: center;
        margin-bottom: 20px;
        border-bottom: 2px solid #000;
        padding-bottom: 12px;
    }
    .qh-nn-card {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }
    .qh-nn-table th,
    .qh-nn-table td {
        border: 1px solid #333 !important;
        padding: 6px 8px !important;
        font-size: 11pt !important;
    }
}

/* =========================================================================
   8. THIẾT KẾ ĐÁP ỨNG ĐA THIẾT BỊ & ĐIỆN THOẠI DI ĐỘNG (MOBILE-FIRST UX)
   ========================================================================= */
@media (max-width: 1120px) and (min-width: 768px) {
    .qh-nn-mobile-scroll-hint {
        display: flex;
    }
}

@media (max-width: 1024px) {
    .qh-nn-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .qh-nn-split-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .qh-nn-podium-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

@media (max-width: 768px) {
    body.page-slug-ne-nep .site-content,
    body.qh-nenep-page .site-content {
        padding-top: 10px !important;
        padding-bottom: 28px !important;
    }

    body.page-slug-ne-nep .site-content > .container,
    body.qh-nenep-page .site-content > .container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .qh-nn-app {
        padding: 0 0 24px;
    }

    /* Hero gọn gàng, rõ chữ trên điện thoại */
    .qh-nn-hero {
        padding: 14px 15px;
        border-radius: 12px;
        margin-bottom: 10px;
    }

    .qh-nn-eyebrow {
        font-size: 10.5px;
        padding: 5px 10px;
        line-height: 1.35;
    }

    .qh-nn-hero-title {
        font-size: 17.5px;
        line-height: 1.32;
    }

    #qh-nenep-root .qh-nn-hero-sub {
        font-size: 12.8px !important;
    }

    .qh-nn-hero-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    #qh-nenep-root.is-guest-public .qh-nn-hero-actions {
        grid-template-columns: 1fr;
    }

    #qh-nenep-root .qh-nn-btn-hero {
        width: 100%;
        padding: 9px 12px;
        font-size: 13px;
        min-height: 42px;
        text-align: center;
    }

    /* 4 ô KPI xếp lưới 2x2 gọn gàng, không cắt chữ trên điện thoại */
    .qh-nn-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .qh-nn-kpi-card {
        padding: 10px 12px;
        align-items: flex-start;
        gap: 9px;
    }

    .qh-nn-kpi-icon {
        width: 32px;
        height: 32px;
        border-radius: 8px;
        font-size: 13.5px;
        margin-top: 1px;
    }

    .qh-nn-kpi-head {
        font-size: 10.5px;
        white-space: normal;
        line-height: 1.3;
    }

    .qh-nn-kpi-val {
        font-size: 15px;
        white-space: normal;
        line-height: 1.28;
    }

    .qh-nn-kpi-foot {
        font-size: 11px;
        line-height: 1.35;
        white-space: normal;
    }

    /* Thanh 8 Tab chuyển thành Lưới Bento 2 cột trên điện thoại: dễ nhìn, không phải cuộn ngang */
    .qh-nn-tabs-bar,
    #qh-nenep-root .qh-nn-tabs-bar.is-wrapped-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px;
        padding: 8px;
        overflow: visible;
    }

    #qh-nenep-root .qh-nn-tab-btn {
        width: 100%;
        min-width: 0;
        min-height: 44px;
        margin-left: 0 !important;
        padding: 8px 10px;
        font-size: 12.5px;
        white-space: normal;
        text-align: left;
        justify-content: flex-start;
        line-height: 1.25;
    }

    #qh-nenep-root .qh-nn-tab-btn .qh-nn-tab-badge {
        margin-left: auto;
    }

    #qh-nenep-root .qh-nn-tabs-bar[data-tab-odd="1"] .qh-nn-tab-btn.is-last-visible-tab {
        grid-column: 1 / -1;
        justify-content: center;
    }

    /* Card & Header trên điện thoại */
    .qh-nn-card {
        padding: 14px 12px;
        border-radius: 12px;
        margin-bottom: 12px;
    }

    .qh-nn-card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .qh-nn-card-title {
        font-size: 16px;
    }

    /* Thanh công cụ lọc trên điện thoại */
    .qh-nn-toolbar {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 8px;
    }

    .qh-nn-toolbar .qh-nn-select,
    .qh-nn-toolbar .qh-nn-input,
    .qh-nn-toolbar .qh-nn-btn {
        width: 100% !important;
        max-width: 100% !important;
    }

    .qh-nn-toolbar .qh-nn-pill-group {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
    }

    #qh-nenep-root .qh-nn-toolbar .qh-nn-pill-btn {
        text-align: center;
        padding: 7px 6px;
        font-size: 12px;
    }

    /* Chuyển chế độ nhập Excel / Thêm lẻ trên điện thoại */
    .qh-nn-mode-switcher {
        flex-direction: column;
    }

    /* Form grid, Breakdown modal, Checklist Thứ Năm & Thẻ xếp loại giờ học */
    .qh-nn-form-grid,
    .qh-nn-breakdown-grid,
    .qh-nn-checklist-grid {
        grid-template-columns: 1fr;
    }

    .qh-nn-rating-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .qh-nn-scoreboard-table {
        min-width: 780px;
    }

    /* Banner nút tải file mẫu ở Tab 7 */
    .qh-nn-banner-actions {
        width: 100%;
        display: grid !important;
        grid-template-columns: 1fr;
    }

    .qh-nn-banner-actions .qh-nn-btn {
        width: 100%;
        justify-content: center;
    }

    .qh-nn-toast {
        left: 12px;
        right: 12px;
        bottom: 14px;
        max-width: none;
    }

    .qh-nn-duty-banner {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .qh-nn-duty-switcher {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .qh-nn-select-preview {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .qh-nn-kpi-card {
        flex-direction: column;
        gap: 6px;
        padding: 10px 11px;
    }
    .qh-nn-kpi-icon {
        width: 28px;
        height: 28px;
        font-size: 12.5px;
    }
    .qh-nn-kpi-val {
        font-size: 14.5px;
    }
}

@media (max-width: 420px) {
    .qh-nn-hero-actions {
        grid-template-columns: 1fr;
    }
}

/* =========================================================================
   14. THANH THÔNG TIN CHỨC NĂNG NHIỆM VỤ & CHẾ ĐỘ 1 CỘT THEO PHÂN QUYỀN
   ========================================================================= */
.qh-nn-duty-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: rgba(7, 22, 40, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    padding: 8px 14px;
    margin-top: 12px;
    margin-bottom: 0;
    color: #ffffff;
    position: relative;
    z-index: 1;
}

.qh-nn-duty-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
}

.qh-nn-duty-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(254, 243, 199, 0.92);
    color: #78350f !important;
    border: 1px solid #fcd34d;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.qh-nn-duty-badge.is-public {
    background: rgba(255, 255, 255, 0.12);
    color: #e0f2fe !important;
    border-color: rgba(186, 230, 253, 0.3);
}

.qh-nn-duty-text {
    font-size: 13px;
    line-height: 1.45;
    color: #f8fafc;
}

.qh-nn-duty-text strong {
    color: #fde68a;
    font-weight: 800;
}

.qh-nn-duty-desc {
    color: #e2e8f0;
    font-weight: 500;
}

.qh-nn-duty-switcher {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 8px;
    padding: 2px 6px 2px 8px;
}

.qh-nn-duty-switcher label {
    font-size: 12px;
    font-weight: 700;
    color: #bae6fd !important;
    margin: 0;
    white-space: nowrap;
}

.qh-nn-select-preview {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #93c5fd !important;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 700;
    min-height: 28px;
    max-width: 220px;
    cursor: pointer;
}

.qh-nn-split-2.qh-nn-split-single {
    grid-template-columns: 1fr !important;
}

#qh-nenep-root.is-guest-public .qh-nn-tabs-bar {
    display: none !important;
}

/* =========================================================================
   15. GIAO DIỆN CỜ ĐỎ NHẬP NHANH TRÊN ĐIỆN THOẠI (MOBILE ERGONOMIC ENTRY)
   ========================================================================= */
.qh-nn-codo-modebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 8px 12px;
    margin-bottom: 14px;
    box-shadow: var(--nn-shadow-xs);
}

.qh-nn-codo-subtabs {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
}

#qh-nenep-root .qh-nn-codo-subtab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding: 7px 14px;
    border-radius: 9px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #1e293b !important;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

#qh-nenep-root .qh-nn-codo-subtab.is-active {
    background: #dc2626 !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
    box-shadow: 0 3px 8px rgba(220, 38, 38, 0.25) !important;
}

.qh-nn-codo-subtab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    background: #e2e8f0;
    color: #0f172a;
}

#qh-nenep-root .qh-nn-codo-subtab.is-active .qh-nn-codo-subtab-badge {
    background: #ffffff;
    color: #dc2626;
}

#qh-nenep-root .qh-nn-codo-phone-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 6px 12px;
    border-radius: 9px;
    border: 1.5px solid #0f2942;
    background: #f8fafc;
    color: #0f2942 !important;
    font-size: 12.5px;
    font-weight: 800;
    cursor: pointer;
    transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

#qh-nenep-root .qh-nn-codo-phone-toggle.is-active {
    background: #0f2942 !important;
    color: #fde68a !important;
}

/* Chế độ Cờ Đỏ 1 cột trên Desktop khi bấm nút chuyển đổi */
#panel-violations.is-codo-phone-mode #qhViolationsSplitGrid {
    grid-template-columns: 1fr !important;
    max-width: 660px;
    margin: 0 auto;
}

#panel-violations.is-codo-phone-mode[data-vio-subtab="FORM"] #qhViolationFeedCard {
    display: none !important;
}

#panel-violations.is-codo-phone-mode[data-vio-subtab="FEED"] #qhViolationFormCard {
    display: none !important;
}

/* Banner trực tuần Cờ Đỏ & Lọc nhanh theo Khối 10 / 11 / 12 */
.qh-nn-codo-banner {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1.5px solid #fca5a5;
    background: linear-gradient(135deg, #fff1f2 0%, #fef2f2 100%);
}

.qh-nn-codo-banner-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.qh-nn-codo-grade-filter {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #fca5a5;
}

#qh-nenep-root .qh-nn-grade-pill {
    min-height: 30px;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155 !important;
    font-size: 11.5px;
    font-weight: 800;
    cursor: pointer;
}

#qh-nenep-root .qh-nn-grade-pill.is-active {
    background: #0f2942 !important;
    border-color: #0f2942 !important;
    color: #ffffff !important;
}

.qh-nn-codo-class-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

#qh-nenep-root .qh-nn-codo-class-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 36px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 800;
    cursor: pointer;
    border: 1.5px solid #fca5a5;
    background: #ffffff;
    color: #991b1b !important;
    transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

#qh-nenep-root .qh-nn-codo-class-pill:hover {
    border-color: #dc2626;
    background: #fef2f2;
}

#qh-nenep-root .qh-nn-codo-class-pill.is-active {
    background: #dc2626 !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
    box-shadow: 0 3px 8px rgba(220, 38, 38, 0.28) !important;
}

.qh-nn-codo-lock-tag {
    font-size: 12px;
    color: #7f1d1d;
    align-self: center;
    margin-left: 4px;
    font-weight: 700;
}

/* Các khối khu vực trong Phiếu Nhập Lỗi Trực Ban (Operate Mode — Tinh gọn, Không lồng thẻ rườm rà) */
.qh-nn-codo-step-box {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
}

.qh-nn-codo-step-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 800;
    color: #0f2942;
    margin-bottom: 8px;
}

.qh-nn-codo-step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #0f2942;
    color: #fde68a;
    font-size: 11.5px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Nút chọn Buổi Sáng / Chiều — Segmented Rõ Trạng Thái Active */
.qh-nn-session-toggle {
    display: inline-grid;
    grid-template-columns: repeat(2, minmax(64px, 1fr));
    gap: 3px;
    padding: 3px;
    border-radius: 8px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    flex-shrink: 0;
}

#qh-nenep-root .qh-nn-session-btn {
    min-height: 32px;
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: #334155 !important;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

#qh-nenep-root .qh-nn-session-btn:hover:not(.is-active) {
    background: #ffffff;
    color: #0f172a !important;
}

#qh-nenep-root .qh-nn-session-btn:focus-visible,
#qh-nenep-root .qh-nn-loc-chip:focus-visible,
#qh-nenep-root .qh-nn-target-seg-btn:focus-visible,
#qh-nenep-root .qh-nn-cat-pill:focus-visible,
#qh-nenep-root .qh-nn-preset-btn:focus-visible,
#qh-nenep-root .qh-nn-step-btn:focus-visible,
#qh-nenep-root .qh-nn-extra-pill:focus-visible {
    outline: 2px solid #0284c7 !important;
    outline-offset: 2px !important;
}

#qh-nenep-root .qh-nn-session-btn.is-active {
    background: #0f2942 !important;
    border-color: #0f2942 !important;
    color: #ffffff !important;
    font-weight: 800;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.18) !important;
}

/* Chip chọn nhanh Khu vực kiểm tra — Tách biệt hoàn toàn Hover và Active */
.qh-nn-quick-locations {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

#qh-nenep-root .qh-nn-loc-chip {
    min-height: 32px;
    padding: 4px 11px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155 !important;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

#qh-nenep-root .qh-nn-loc-chip:hover:not(.is-active) {
    background: #f1f5f9 !important;
    border-color: #64748b !important;
    color: #0f172a !important;
}

#qh-nenep-root .qh-nn-loc-chip.is-active {
    background: #0f2942 !important;
    border-color: #0f2942 !important;
    color: #ffffff !important;
    font-weight: 800;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18) !important;
}

/* Bước 3: Lưới Chip Học Sinh chạm 1 tay */
.qh-nn-student-quick-box {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px;
}

.qh-nn-stu-quick-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

#qh-nenep-root .qh-nn-stu-quick-btn {
    min-height: 36px;
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid #94a3b8;
    background: #f1f5f9;
    color: #0f172a !important;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

#qh-nenep-root .qh-nn-stu-quick-btn.clear {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #b91c1c !important;
}

.qh-nn-stu-chips-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 155px;
    overflow-y: auto;
    padding: 4px 2px;
}

#qh-nenep-root .qh-nn-stu-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 34px;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #1e293b !important;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

#qh-nenep-root .qh-nn-stu-chip:hover {
    border-color: #64748b;
    background: #f1f5f9;
}

#qh-nenep-root .qh-nn-stu-chip.is-selected {
    background: #dc2626 !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
    font-weight: 800;
}

.qh-nn-stu-chips-empty {
    font-size: 12px;
    color: #64748b;
    font-style: italic;
    padding: 4px;
}

/* Bước 4: Thanh Tìm kiếm gọn + Bộ lọc nhóm tiêu chí + Danh sách Tiêu chí dễ đọc */
.qh-nn-crit-toolbar {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 10px;
}

.qh-nn-cat-pills-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    margin-bottom: 0;
    scrollbar-width: thin;
}

#qh-nenep-root .qh-nn-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 34px;
    padding: 5px 11px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155 !important;
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
    transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

#qh-nenep-root .qh-nn-cat-pill:hover:not(.is-active) {
    background: #f1f5f9;
    border-color: #64748b;
    color: #0f172a !important;
}

#qh-nenep-root .qh-nn-cat-pill.is-selected-pill.has-items:not(.is-active) {
    border-color: #f59e0b;
    background: #fffbeb;
    color: #92400e !important;
    font-weight: 800;
}

#qh-nenep-root .qh-nn-cat-pill.is-active {
    background: #0f2942 !important;
    border-color: #0f2942 !important;
    color: #ffffff !important;
    font-weight: 800;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18) !important;
}

.qh-nn-criteria-rows-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.qh-nn-crit-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    scroll-margin-bottom: 112px;
    transition: background-color 120ms ease, border-color 120ms ease;
}

.qh-nn-crit-row:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.qh-nn-crit-row.is-selected {
    border-color: #dc2626 !important;
    background: #fff5f5 !important;
    box-shadow: inset 3px 0 0 #dc2626;
}

.qh-nn-crit-row-title strong {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.38;
}

.qh-nn-crit-row.is-selected .qh-nn-crit-row-title strong {
    font-weight: 800;
    color: #7f1d1d;
}

.qh-nn-crit-row-info {
    cursor: pointer;
}

.qh-nn-crit-cat-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    color: #475569;
    background: #f1f5f9;
    padding: 1px 6px;
    border-radius: 4px;
    margin-right: 4px;
}

.qh-nn-crit-row-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.qh-nn-crit-qty-label,
.qh-nn-crit-unit {
    font-size: 11.5px;
    font-weight: 700;
    color: #475569;
    padding: 0 6px;
}

/* Hộp tóm tắt Desktop gọn gàng */
.qh-nn-vio-summary-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
}

/* Bước 5: Chip ghi chú mẫu & Thanh Lưu Phiếu cố định dưới đáy (Sticky Submit Bar) */
.qh-nn-reminder-check-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: #0369a1;
    cursor: pointer;
    padding: 8px 12px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 13px;
}

.qh-nn-reminder-check-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.qh-nn-quick-notes-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

#qh-nenep-root .qh-nn-note-chip {
    min-height: 30px;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155 !important;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

#qh-nenep-root .qh-nn-note-chip:hover {
    border-color: #0f2942;
    background: #f1f5f9;
    color: #0f172a !important;
}

.qh-nn-sticky-submit-bar {
    position: sticky;
    bottom: 8px;
    z-index: 35;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 14px;
    border-radius: 10px;
    background: #0f2942;
    border: 1px solid #1e3a5f;
    color: #ffffff;
    box-shadow: 0 8px 20px -4px rgba(15, 23, 42, 0.28);
    margin-top: 10px;
}

.qh-nn-sticky-submit-bar.has-selection {
    background: linear-gradient(135deg, #0f2942 0%, #7f1d1d 100%);
    border-color: #fca5a5;
}

.qh-nn-sticky-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
    min-width: 0;
}

.qh-nn-sticky-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.qh-nn-sticky-class {
    font-weight: 800;
    color: #fde68a;
}

.qh-nn-sticky-sep {
    color: #94a3b8;
}

.qh-nn-sticky-turns {
    font-weight: 700;
    color: #ffffff;
}

.qh-nn-sticky-delta {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 12.5px;
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.qh-nn-sticky-delta.is-deduct {
    background: #fee2e2;
    color: #991b1b;
}

.qh-nn-sticky-delta.is-bonus {
    background: #d1fae5;
    color: #065f46;
}

#qh-nenep-root .qh-nn-btn-submit-main,
#qh-nenep-root .qh-nn-sticky-submit-btn {
    min-height: 40px;
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 800;
    background: #dc2626 !important;
    border: 1px solid #f87171 !important;
    color: #ffffff !important;
    white-space: nowrap;
}

#qh-nenep-root .qh-nn-btn-submit-main:hover:not(:disabled),
#qh-nenep-root .qh-nn-sticky-submit-btn:hover:not(:disabled) {
    background: #b91c1c !important;
}

/* Tự động tối ưu hóa giao diện 1 cột trên Điện thoại & Máy tính bảng (<= 960px) */
@media (max-width: 960px) {
    .qh-nn-codo-phone-toggle {
        display: none !important;
    }

    #panel-violations #qhViolationsSplitGrid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    #panel-violations[data-vio-subtab="FORM"] #qhViolationFeedCard {
        display: none !important;
    }

    #panel-violations[data-vio-subtab="FEED"] #qhViolationFormCard {
        display: none !important;
    }

    #panel-violations:not([data-vio-subtab="FEED"]) #qhViolationFeedCard {
        display: none !important;
    }
}


/* =========================================================================
   MILESTONE 2: BENTO CARDS, RESPONSIVE MOBILE, MY CLASS WIDGET & WCAG DIALOGS
   ========================================================================= */

/* --- Bento Grid Mặc định: Ẩn trên Desktop & Tablet (>= 768px) --- */
.qh-nn-scoreboard-bento-grid {
    display: none;
}

/* --- 1. Desktop Full-View Table (>= 1024px): Không cuộn dọc trong khung nhỏ, hiển thị trọn vẹn 100% chiều ngang --- */
@media (min-width: 1024px) {
    .qh-nn-table-wrap {
        max-height: none !important;
        overflow-y: visible !important;
        overflow-x: auto;
        position: relative;
    }
    .qh-nn-scoreboard-table {
        width: 100%;
    }
    .qh-nn-scoreboard-bento-grid {
        display: none !important;
    }
}

/* --- 2. Mobile Bento Cards (< 768px) --- */
@media (max-width: 767px) {
    .qh-nn-table-wrap,
    .qh-nn-mobile-scroll-hint {
        display: none !important;
    }
    .qh-nn-scoreboard-bento-grid {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
        margin-top: 4px;
    }
    .qh-nn-bento-card {
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 12px 13px;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
        display: flex;
        flex-direction: column;
        gap: 10px;
        transition: transform 0.14s ease, box-shadow 0.14s ease;
    }
    .qh-nn-bento-card:active {
        transform: scale(0.99);
    }
    .qh-nn-bento-card.is-top1 {
        border-color: #fcd34d;
        background: linear-gradient(180deg, rgba(254, 243, 199, 0.28) 0%, #ffffff 42%);
    }
    .qh-nn-bento-card.is-top2 {
        border-color: #bae6fd;
        background: linear-gradient(180deg, rgba(224, 242, 254, 0.28) 0%, #ffffff 42%);
    }
    .qh-nn-bento-card.is-top3 {
        border-color: #cbd5e1;
        background: linear-gradient(180deg, rgba(241, 245, 249, 0.5) 0%, #ffffff 42%);
    }
    .qh-nn-bento-card.is-warning-labor {
        border: 1px solid #fca5a5 !important;
        background: #fffafa;
    }
    .qh-nn-bento-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
        flex-wrap: wrap;
        border-bottom: 1px solid #f1f5f9;
        padding-bottom: 8px;
    }
    .qh-nn-bento-class-meta {
        display: flex;
        align-items: center;
        gap: 7px;
        flex-wrap: wrap;
        min-width: 0;
    }
    .qh-nn-bento-cls-badge-wrap {
        margin-left: auto;
    }
    .qh-nn-bento-teacher-meta {
        width: 100%;
        font-size: 12px;
        color: #475569;
        margin-top: 1px;
    }
    .qh-nn-bento-teacher-meta strong {
        color: #1e293b;
        font-weight: 600;
    }
    .qh-nn-bento-rank-badge {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 3px 9px;
        border-radius: 7px;
        font-weight: 700;
        font-size: 11.5px;
    }
    .qh-nn-bento-rank-badge.rank-gold {
        background: #fef3c7;
        color: #92400e;
        border: 1px solid #fcd34d;
    }
    .qh-nn-bento-rank-badge.rank-silver {
        background: #e0f2fe;
        color: #075985;
        border: 1px solid #bae6fd;
    }
    .qh-nn-bento-rank-badge.rank-bronze {
        background: #f1f5f9;
        color: #0f2942;
        border: 1px solid #cbd5e1;
    }
    .qh-nn-bento-rank-badge.rank-normal {
        background: #f8fafc;
        color: #475569;
        border: 1px solid #e2e8f0;
    }
    .qh-nn-bento-class-name {
        font-family: 'Lexend', 'Be Vietnam Pro', sans-serif;
        font-size: 15.5px;
        font-weight: 700;
        color: #0f2942;
        margin: 0;
    }
    .qh-nn-bento-grid-2x2 {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    .qh-nn-bento-metric-cell {
        background: #f8fafc;
        border: 1px solid #edf2f7;
        border-radius: 9px;
        padding: 8px 10px;
        display: flex;
        flex-direction: column;
        gap: 2px;
        min-width: 0;
    }
    .qh-nn-bento-metric-cell.cell-total {
        background: #eff6ff;
        border-color: #dbeafe;
    }
    .qh-nn-bento-label {
        font-size: 10.5px;
        font-weight: 700;
        color: #64748b;
        letter-spacing: 0.02em;
        text-transform: uppercase;
    }
    .qh-nn-bento-val {
        font-size: 15px;
        font-weight: 700;
        color: #0f172a;
    }
    .qh-nn-bento-val.val-hero {
        font-family: 'Lexend', 'Be Vietnam Pro', sans-serif;
        font-size: 17.5px;
        color: #0f2942;
    }
    .qh-nn-bento-val.val-warn {
        color: #b91c1c;
    }
    .qh-nn-bento-sub {
        font-size: 11px;
        color: #64748b;
    }
    .qh-nn-bento-sub.sub-success {
        color: #047857;
        font-weight: 600;
    }
    .qh-nn-bento-sub.sub-danger {
        color: #b91c1c;
        font-weight: 600;
    }
    .qh-nn-bento-labor-alert {
        background: #fef2f2;
        border: 1px solid #fecaca;
        color: #991b1b;
        padding: 7px 10px;
        border-radius: 8px;
        font-size: 11.5px;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 6px;
    }
    .qh-nn-bento-footer {
        display: flex;
        gap: 8px;
        margin-top: 2px;
    }
    .qh-nn-bento-footer.qh-nn-bento-period-foot {
        justify-content: space-between;
        align-items: center;
        padding: 7px 10px;
        background: #f8fafc;
        border-radius: 8px;
        border: 1px solid #edf2f7;
        font-size: 12px;
    }
    .qh-nn-deduct-txt {
        color: #b91c1c;
        font-weight: 600;
    }
    .qh-nn-bonus-txt {
        color: #047857;
        font-weight: 600;
    }
    .qh-nn-bento-footer .qh-nn-btn {
        flex: 1;
        min-height: 44px; /* WCAG touch target */
        font-size: 13px;
        font-weight: 600;
        justify-content: center;
    }
}

/* --- 3. My Class Pinned Widget --- */
.qh-nn-my-class-pinned {
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 55%, #ffffff 100%);
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    padding: 14px 18px;
    box-shadow: 0 2px 8px -2px rgba(15, 41, 66, 0.08);
    margin-bottom: 14px;
    position: relative;
    overflow: hidden;
}
.qh-nn-pinned-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.qh-nn-pinned-title {
    display: flex;
    align-items: center;
    gap: 8px;
}
.qh-nn-pinned-heading {
    font-size: 15.5px;
    font-weight: 700;
    color: #0f2942;
}
.qh-nn-pinned-gap-badge {
    font-size: 12px;
    font-weight: 600;
    color: #1e3a8a;
    background: #dbeafe;
    padding: 4px 10px;
    border-radius: 999px;
}
.qh-nn-pinned-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}
.qh-nn-pinned-stat-item {
    background: #ffffff;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.qh-nn-pinned-stat-item .stat-lbl {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
}
.qh-nn-pinned-stat-item .stat-val {
    font-size: 15.5px;
    font-weight: 700;
    color: #0f2942;
}
.qh-nn-pinned-stat-item .stat-val.highlight {
    color: #047857;
    font-size: 17px;
}
.qh-nn-pinned-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* --- 4. Segmented Filter Bar 1 Chạm (Navy Active, Nhất quán) --- */
.qh-nn-segmented-bar {
    margin-bottom: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.qh-nn-segmented-bar::-webkit-scrollbar {
    display: none;
}
.qh-nn-segmented-track {
    display: inline-flex;
    align-items: center;
    background: #eef2f6;
    border: 1px solid #dbe3ec;
    padding: 3px;
    border-radius: 9px;
    gap: 2px;
}
.qh-nn-segment-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    min-height: 30px;
    padding: 4px 11px;
    font-size: 12.5px;
    font-weight: 600;
    color: #334155 !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
    white-space: nowrap;
}
.qh-nn-segment-btn:hover {
    color: #0f2942 !important;
    background: rgba(255, 255, 255, 0.7);
}
.qh-nn-segment-btn.is-active {
    background: #0f2942 !important;
    color: #ffffff !important;
    border-color: #0f2942;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(15, 41, 66, 0.2);
}
.qh-nn-segment-count {
    font-size: 11px;
    font-weight: 700;
    background: rgba(15, 23, 42, 0.08);
    color: #334155;
    padding: 1px 6px;
    border-radius: 999px;
    line-height: 1.35;
}
.qh-nn-segment-btn.is-active .qh-nn-segment-count {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}
.qh-nn-segment-btn.qh-nn-segment-below.has-alert:not(.is-active) {
    color: #991b1b !important;
}
.qh-nn-segment-btn.qh-nn-segment-below.has-alert:not(.is-active) .qh-nn-segment-count {
    background: #fee2e2;
    color: #b91c1c;
}

/* --- 5. Floating Action Bar (Sticky Submit Bar) & Double-submit Guard --- */
@media (max-width: 767px) {
    .qh-nn-sticky-submit-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(10px);
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12);
        padding: 10px 16px;
        border-top: 1px solid #E2E8F0;
    }
}
.qh-nn-btn.is-submitting {
    opacity: 0.75;
    cursor: not-allowed;
    pointer-events: none;
}

/* --- 6. Smart Student Autocomplete & Evidence Box --- */
.qh-nn-stu-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #FFFFFF;
    border: 1.5px solid #CBD5E1;
    border-radius: 10px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 100;
    max-height: 240px;
    overflow-y: auto;
    margin-top: 4px;
}
.qh-nn-autocomplete-item:hover {
    background: #F1F5F9;
}
.qh-nn-evidence-box {
    background: #F8FAFC;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 12px 14px;
}

/* --- 7. Accessible Bottom Sheet & Centered Modal (WCAG 2.1 AA) --- */
.qh-nn-dialog-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.68);
    backdrop-filter: blur(4px);
    z-index: 100050 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: qhFadeIn 0.2s ease;
}

/* Desktop Modal: Căn giữa màn hình */
@media (min-width: 768px) {
    .qh-nn-dialog-container {
        background: #ffffff;
        border-radius: 16px;
        width: 100%;
        max-width: 520px;
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.08);
        padding: 22px 24px;
        animation: qhModalZoom 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .qh-nn-bottom-sheet-handle {
        display: none;
    }
}

/* Mobile Bottom Sheet (< 768px): Vuốt trượt từ đáy màn hình */
@media (max-width: 767px) {
    .qh-nn-dialog-backdrop {
        align-items: flex-end;
        padding: 0;
    }
    .qh-nn-dialog-container {
        background: #ffffff;
        border-radius: 20px 20px 0 0;
        width: 100%;
        max-height: 85vh;
        overflow-y: auto;
        padding: 14px 18px 24px;
        box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.2);
        animation: qhSheetSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .qh-nn-bottom-sheet-handle {
        width: 44px;
        height: 5px;
        background: #cbd5e1;
        border-radius: 999px;
        margin: 0 auto 12px;
    }
    .qh-nn-dialog-footer .qh-nn-btn {
        flex: 1;
        min-height: 44px; /* WCAG touch target */
    }
}

.qh-nn-dialog-quick-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}
.qh-nn-dialog-chip {
    background: #f1f5f9;
    color: #1e293b;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.qh-nn-dialog-chip:hover,
.qh-nn-dialog-chip:focus {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #94a3b8;
}

@keyframes qhFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes qhModalZoom {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
@keyframes qhSheetSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* =========================================================================
   MILESTONE 4 & 5: CONTROL DECK BỘ LỌC MẠCH LẠC & ĐỢT THI ĐUA TUẦN X – Y
   ========================================================================= */
.qh-nn-scoreboard-main-card {
    padding: 13px 16px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.05), 0 1px 3px -1px rgba(15, 23, 42, 0.03);
}

.qh-nn-card-header.qh-nn-scoreboard-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 9px;
    padding-bottom: 0;
    margin-bottom: 10px;
    border-bottom: none;
}

.qh-nn-scoreboard-head-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.qh-nn-scoreboard-title-cluster {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.qh-nn-sb-title-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    color: #0f2942;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13.5px;
    flex-shrink: 0;
}

#qh-nenep-root .qh-nn-sb-compact-title {
    font-size: 17px !important;
    font-weight: 700 !important;
    color: #0f2942 !important;
    gap: 9px;
}

.qh-nn-scoreboard-meta-cluster {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.qh-nn-formula-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #475569;
    white-space: nowrap;
}

.qh-nn-formula-pill code {
    font-weight: 700;
    color: #0f2942;
    background: transparent;
    padding: 0;
    font-size: 12px;
}

/* Khu vực Điều khiển & Bộ lọc Thống nhất (Control Deck) */
.qh-nn-control-deck {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 11px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.qh-nn-control-row-primary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.qh-nn-time-mode-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 100%;
    flex: 0 1 auto;
}

.qh-nn-time-mode-scroll::-webkit-scrollbar {
    display: none;
}

.qh-nn-time-mode-bar {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    background: #eef2f6;
    padding: 3px;
    border-radius: 9px;
    gap: 2px;
    margin: 0;
    border: 1px solid #dbe3ec;
}

.qh-nn-time-mode-btn {
    background: transparent;
    border: 1px solid transparent;
    min-height: 30px;
    padding: 4px 11px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: #334155 !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.qh-nn-time-mode-btn i {
    font-size: 12px;
    color: #64748b;
}

.qh-nn-time-mode-btn:hover {
    color: #0f2942 !important;
    background: rgba(255, 255, 255, 0.72);
}

.qh-nn-time-mode-btn.qh-nn-mode-campaign i {
    color: #d97706;
}

.qh-nn-time-mode-btn.is-active,
.qh-nn-time-mode-btn.qh-nn-mode-campaign.is-active {
    background: #0f2942 !important;
    color: #ffffff !important;
    border-color: #0f2942;
    box-shadow: 0 1px 3px rgba(15, 41, 66, 0.2);
}

.qh-nn-time-mode-btn.is-active i,
.qh-nn-time-mode-btn.qh-nn-mode-campaign.is-active i {
    color: #93c5fd !important;
}

.qh-nn-scoreboard-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: auto;
}

#qh-nenep-root select.qh-nn-sb-period-sel {
    min-height: 36px !important;
    height: 36px !important;
    line-height: 34px !important;
    padding: 0 10px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #0f2942 !important;
    background-color: #ffffff !important;
    background-image: none !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    min-width: 245px;
    max-width: 350px;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
}

#qh-nenep-root select.qh-nn-sb-period-sel:hover {
    border-color: #94a3b8 !important;
}

#qh-nenep-root .qh-nn-sb-action-btn {
    min-height: 36px !important;
    height: 36px !important;
    padding: 0 13px !important;
    font-size: 12.8px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #0f2942 !important;
}

#qh-nenep-root .qh-nn-sb-action-btn.qh-nn-btn-excel i {
    color: #059669;
}

#qh-nenep-root .qh-nn-sb-action-btn.qh-nn-btn-excel:hover {
    background: #f0fdf4 !important;
    border-color: #86efac !important;
    color: #065f46 !important;
}

#qh-nenep-root .qh-nn-sb-action-btn.qh-nn-btn-campaign-cfg {
    background: #fffbeb !important;
    border-color: #fcd34d !important;
    color: #92400e !important;
}

#qh-nenep-root .qh-nn-sb-action-btn.qh-nn-btn-campaign-cfg i {
    color: #d97706;
}

.qh-nn-unified-filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
}

.qh-nn-unified-filter-row .qh-nn-segmented-bar {
    margin-bottom: 0;
    padding-bottom: 0;
    flex: 1;
    min-width: 0;
}

.qh-nn-search-box-wrap {
    position: relative;
    width: 248px;
    flex-shrink: 0;
}

.qh-nn-search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 12.5px;
    pointer-events: none;
}

#qh-nenep-root .qh-nn-search-input {
    width: 100% !important;
    padding: 4px 12px 4px 32px !important;
    min-height: 36px !important;
    height: 36px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    background: #ffffff !important;
}

#qh-nenep-root .qh-nn-search-input:hover {
    border-color: #94a3b8 !important;
}

/* Khung Banner & Bộ chọn Đợt Thi Đua Từ Tuần X Đến Tuần Y */
.qh-nn-campaign-banner {
    background: #ffffff;
    border: 1px solid #dbeafe;
    border-left: 3px solid #0f2942;
    border-radius: 10px;
    padding: 12px 14px;
    margin: 0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.qh-nn-campaign-banner-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}
.qh-nn-campaign-title-box {
    flex: 1;
    min-width: 240px;
}
.qh-nn-campaign-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #0f2942;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.qh-nn-campaign-heading {
    display: block;
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #0f2942 !important;
    margin: 0 0 2px 0 !important;
    line-height: 1.35 !important;
}
.qh-nn-campaign-desc {
    display: block;
    font-size: 12.5px !important;
    color: #475569 !important;
    margin: 0 !important;
    line-height: 1.45 !important;
}
.qh-nn-campaign-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.qh-nn-campaign-control-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.qh-nn-campaign-control-group label {
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
    margin: 0;
    white-space: nowrap;
}
.qh-nn-campaign-control-group .qh-nn-select {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    font-weight: 600;
    color: #0f2942 !important;
    min-height: 36px !important;
    height: 36px !important;
}
.qh-nn-range-inputs {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 12.5px;
    font-weight: 600;
    color: #475569;
}

/* Huy hiệu điểm từng tuần trong đợt */
.qh-nn-week-chips-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-width: 280px;
}
.qh-nn-week-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #1e293b;
    white-space: nowrap;
}
.qh-nn-week-chip.good {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}
.qh-nn-week-chip.mid {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}
.qh-nn-week-chip.low {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

/* Huy hiệu biến động thứ hạng so với tuần trước */
.qh-nn-rank-delta {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    line-height: 1.3;
}
.qh-nn-rank-delta.up {
    background: #dcfce7;
    color: #15803d;
}
.qh-nn-rank-delta.down {
    background: #fee2e2;
    color: #b91c1c;
}
.qh-nn-rank-delta.same {
    background: #f1f5f9;
    color: #64748b;
}

/* Ẩn thanh subtab Mobile của Tab 2 trên màn hình Desktop (> 960px) vì đã hiển thị đủ 2 cột song song */
@media (min-width: 961px) {
    #qh-nenep-root .qh-nn-mobile-only-subbar {
        display: none !important;
    }
    .qh-nn-scoreboard-table thead th {
        position: sticky;
        top: 0;
        z-index: 4;
    }
}

@media (max-width: 1024px) {
    .qh-nn-control-row-primary {
        align-items: stretch;
    }
    .qh-nn-scoreboard-head-actions {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .qh-nn-podium-card {
        padding: 8px 10px;
        gap: 8px;
    }
    .qh-nn-podium-left {
        gap: 8px;
    }
    .qh-nn-podium-medal {
        width: 26px;
        height: 26px;
        font-size: 11.5px;
        border-radius: 7px;
    }
    .qh-nn-podium-score {
        font-size: 15px;
    }
    .qh-nn-podium-mini-meta {
        font-size: 10.2px;
    }
    .qh-nn-scoreboard-main-card {
        padding: 12px;
    }
    .qh-nn-scoreboard-head-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .qh-nn-formula-pill {
        white-space: normal;
        line-height: 1.4;
        border-radius: 8px;
        padding: 4px 10px;
    }
    .qh-nn-control-deck {
        padding: 9px;
        gap: 8px;
    }
    .qh-nn-control-row-primary {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    #qh-nenep-root .qh-nn-time-mode-scroll {
        contain: inline-size;
        width: 100% !important;
    }
    .qh-nn-time-mode-bar {
        display: inline-flex;
        flex-wrap: nowrap;
        width: max-content;
        min-width: 100%;
        gap: 3px;
    }
    .qh-nn-time-mode-btn {
        min-height: 36px;
        padding: 6px 12px;
        font-size: 12.8px;
        white-space: nowrap;
        flex: 1 0 auto;
        justify-content: center;
    }
    .qh-nn-scoreboard-head-actions {
        width: 100%;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        margin-left: 0;
    }
    #qh-nenep-root select.qh-nn-sb-period-sel {
        width: 100% !important;
        min-width: 0;
        max-width: 100%;
        min-height: 42px !important;
        height: 42px !important;
        line-height: 40px !important;
        font-size: 16px !important; /* Chống iOS Safari tự phóng to */
    }
    #qh-nenep-root .qh-nn-sb-action-btn {
        min-height: 42px !important;
        height: 42px !important;
        padding: 0 14px !important;
        font-size: 13px !important;
    }
    .qh-nn-unified-filter-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding-top: 8px;
    }
    .qh-nn-segment-btn {
        min-height: 36px;
        padding: 6px 12px;
        font-size: 12.8px;
    }
    .qh-nn-search-box-wrap {
        width: 100%;
    }
    #qh-nenep-root .qh-nn-search-input {
        min-height: 42px !important;
        height: 42px !important;
        font-size: 16px !important; /* Chống iOS Safari tự phóng to */
    }
    .qh-nn-campaign-controls,
    .qh-nn-campaign-control-group,
    .qh-nn-range-inputs {
        width: 100%;
    }
    .qh-nn-campaign-control-group .qh-nn-select {
        width: 100% !important;
        min-height: 42px !important;
        height: 42px !important;
        font-size: 16px !important;
    }
}

@media (max-width: 480px) {
    .qh-nn-scoreboard-head-actions {
        grid-template-columns: 1fr;
    }
    #qh-nenep-root .qh-nn-sb-action-btn {
        width: 100%;
        justify-content: center;
    }
}

/* =========================================================================
   MILESTONE 6: SỔ TRỰC CỜ ĐỎ DI ĐỘNG TINH GỌN & TRUNG TÂM PHÂN CÔNG ĐOÀN TRƯỜNG
   ========================================================================= */

/* --- 1. Thanh Appbar Trực Ban Cờ Đỏ — Gọn Chiều Cao, Rõ Thông Tin (PC & Mobile) --- */
.qh-nn-codo-mobile-appbar {
    display: none;
    background: linear-gradient(135deg, #0b192c 0%, #0f2942 62%, #7f1d1d 100%);
    color: #ffffff;
    border-radius: 12px;
    padding: 8px 12px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

/* Khi vai trò Cờ đỏ đăng nhập (CO_DO): Tự động thích ứng theo thiết bị (Mobile/Tablet 1 cột • Desktop 2 cột) */
#qh-nenep-root.is-codo-role-active .qh-nn-codo-mobile-appbar,
#qh-nenep-root.is-codo-mobile-focused .qh-nn-codo-mobile-appbar {
    display: block !important;
}
#qh-nenep-root.is-codo-role-active .qh-nn-hero,
#qh-nenep-root.is-codo-role-active .qh-nn-kpi-section,
#qh-nenep-root.is-codo-role-active .qh-nn-tabs-bar,
#qh-nenep-root.is-codo-role-active .qh-nn-codo-modebar,
#qh-nenep-root.is-codo-role-active #qhSlaCountdownBanner,
#qh-nenep-root.is-codo-role-active #qhCoDoMonitorBanner,
#qh-nenep-root.is-codo-role-active #btnShortcutEditClass,
#qh-nenep-root.is-codo-role-active #btnShortcutEditStudent,
#qh-nenep-root.is-codo-role-active #btnOpenCriteriaConfigModal,
#qh-nenep-root.is-codo-role-active #qhViolationFormCard > .qh-nn-card-header,
#qh-nenep-root.is-codo-mobile-focused #qhViolationFormCard > .qh-nn-card-header,
#qh-nenep-root.is-codo-mobile-focused .qh-nn-desktop-only-summary,
#qh-nenep-root[data-role="CO_DO"] #qhNnPodiumGrid,
#qh-nenep-root[data-role="CO_DO"] .qh-nn-unified-filter-row,
#qh-nenep-root[data-role="CO_DO"] .qh-nn-time-mode-bar {
    display: none !important;
}

/* Không dùng transform animation trên #panel-violations để thanh cố định đáy bám chuẩn viewport */
#panel-violations.is-active {
    animation: none !important;
}

/* Tỷ lệ 2 cột tối ưu trên Desktop (>= 961px): Ưu tiên không gian cho cột Nhập lỗi */
@media (min-width: 961px) {
    #panel-violations:not(.is-codo-phone-mode) #qhViolationsSplitGrid {
        grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.95fr);
        gap: 14px;
    }
    #qh-nenep-root.is-codo-role-active .qh-nn-codo-mobile-appbar {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        flex-wrap: wrap;
        padding: 7px 14px;
    }
    #qh-nenep-root.is-codo-role-active .qh-nn-codo-appbar-top {
        flex: 1 1 auto;
        align-items: center;
        gap: 12px;
    }
    #qh-nenep-root.is-codo-role-active .qh-nn-codo-appbar-identity {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
    }
    #qh-nenep-root.is-codo-role-active .qh-nn-codo-appbar-eyebrow,
    #qh-nenep-root.is-codo-role-active .qh-nn-codo-appbar-sub {
        margin: 0;
    }
    #qh-nenep-root.is-codo-role-active .qh-nn-codo-appbar-nav {
        margin-top: 0;
        min-width: 360px;
        flex: 0 0 auto;
    }
    #qh-nenep-root.is-codo-role-active .qh-nn-codo-appbar-note {
        flex: 1 1 100%;
        margin-top: 4px;
    }
}

#qh-nenep-root.is-codo-mobile-focused #qhViolationsSplitGrid,
.qh-nn-split-2.qh-nn-split-single {
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 auto;
}

/* Chống tràn ngang 100% trên mọi khung cha/con */
#qh-nenep-root,
#qh-nenep-root .qh-nn-container,
#qh-nenep-root .qh-nn-panel,
#qh-nenep-root #qhViolationsSplitGrid,
#qh-nenep-root #qhViolationFormCard,
#qh-nenep-root #qhViolationFeedCard,
#qh-nenep-root #qhViolationForm,
#qh-nenep-root .qh-nn-codo-step-box,
#qh-nenep-root .qh-nn-crit-picker-box,
#qh-nenep-root .qh-nn-criteria-rows-list,
#qh-nenep-root .qh-nn-crit-row,
#qh-nenep-root .qh-nn-cat-pills-bar,
#qh-nenep-root .qh-nn-quick-loc-bar {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}
#qh-nenep-root,
#qh-nenep-root .qh-nn-panel {
    overflow-x: clip;
}
#qh-nenep-root.is-codo-mobile-focused #panel-violations[data-vio-subtab="FORM"] #qhViolationFeedCard,
#qh-nenep-root.is-codo-mobile-focused #panel-violations[data-vio-subtab="form"] #qhViolationFeedCard,
#qh-nenep-root.is-codo-mobile-focused #panel-violations:not([data-vio-subtab="FEED"]):not([data-vio-subtab="feed"]) #qhViolationFeedCard {
    display: none !important;
}
#qh-nenep-root.is-codo-role-active #panel-violations[data-vio-subtab="FEED"] #qhViolationsSplitGrid,
#qh-nenep-root.is-codo-role-active #panel-violations[data-vio-subtab="feed"] #qhViolationsSplitGrid {
    grid-template-columns: minmax(0, 1fr) !important;
}
#qh-nenep-root.is-codo-role-active #panel-violations[data-vio-subtab="FEED"] #qhViolationFormCard,
#qh-nenep-root.is-codo-role-active #panel-violations[data-vio-subtab="feed"] #qhViolationFormCard,
#qh-nenep-root.is-codo-mobile-focused #panel-violations[data-vio-subtab="FEED"] #qhViolationFormCard,
#qh-nenep-root.is-codo-mobile-focused #panel-violations[data-vio-subtab="feed"] #qhViolationFormCard {
    display: none !important;
}

/* Thu gọn tiêu đề & khoảng đệm của Thẻ Lập Phiếu (#qhViolationFormCard) để hiển thị nhiều tiêu chí ngay trên màn hình đầu */
#qh-nenep-root #qhViolationFormCard {
    padding: 12px 14px;
    border-radius: 12px;
}
#qh-nenep-root #qhViolationFormCard > .qh-nn-card-header {
    padding-bottom: 8px;
    margin-bottom: 10px;
}
#qh-nenep-root #qhViolationFormCard > .qh-nn-card-header .qh-nn-card-title {
    font-size: 16px;
}
#qh-nenep-root #qhViolationFormCard > .qh-nn-card-header .qh-nn-card-sub {
    font-size: 12px;
    margin-top: 2px;
}
#qh-nenep-root #qhCoDoMonitorBanner {
    padding: 9px 12px;
    margin-bottom: 10px;
    border-radius: 10px;
}
#qh-nenep-root #qhVioTopModeBar {
    padding: 5px 8px;
    margin-bottom: 10px;
    border-radius: 10px;
}

/* Khối 1: Thẻ Lớp + Ngày/Buổi + Khu vực gom gọn thành 1 khối mạch lạc, rõ thứ tự */
#qh-nenep-root .qh-nn-codo-compact-context {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
}
.qh-nn-codo-context-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
    gap: 10px;
    align-items: end;
    margin-bottom: 8px;
}
.qh-nn-codo-field-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.qh-nn-codo-mini-shortcut {
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1.3;
}
.qh-nn-codo-mini-shortcut.is-emerald {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #6ee7b7;
}

/* Thẻ khóa lớp được phân công trực ban (gọn gàng, ngang hàng với Ngày & Buổi) */
.qh-nn-codo-locked-class-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 11px;
    margin-bottom: 0;
    border-radius: 8px;
    background: #fffbeb;
    border: 1px solid #f59e0b;
    min-width: 0;
}
.qh-nn-codo-locked-left {
    min-width: 0;
    flex: 1;
}
.qh-nn-codo-locked-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: #b45309;
    text-transform: uppercase;
    line-height: 1.2;
}
.qh-nn-codo-locked-mainline {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 2px;
}
.qh-nn-codo-locked-name {
    font-family: 'Lexend', sans-serif;
    font-size: 15.5px;
    font-weight: 800;
    color: #0f2942;
    line-height: 1.25;
}
.qh-nn-codo-locked-meta {
    font-size: 12px;
    font-weight: 600;
    color: #78350f;
    line-height: 1.3;
}
.qh-nn-codo-locked-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    background: #059669;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Thanh Appbar Cờ đỏ chi tiết */
.qh-nn-codo-appbar-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.qh-nn-codo-appbar-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #fde68a;
    margin-bottom: 2px;
}
.qh-nn-codo-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.25);
}
.qh-nn-codo-appbar-title-row {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}
.qh-nn-codo-appbar-class {
    font-family: 'Lexend', sans-serif;
    font-size: 16.5px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
}
.qh-nn-codo-appbar-shift {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.14);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.22);
}
.qh-nn-codo-appbar-sub {
    font-size: 11.5px;
    color: #e2e8f0;
    margin-top: 2px;
}
.qh-nn-codo-appbar-sub strong {
    color: #fde68a;
}
.qh-nn-codo-appbar-logout {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.24);
    color: #fecaca !important;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none !important;
    white-space: nowrap;
}
.qh-nn-codo-appbar-logout:hover {
    background: rgba(185, 28, 28, 0.7);
    color: #ffffff !important;
}
.qh-nn-codo-appbar-note {
    margin-top: 6px;
    padding: 5px 10px;
    border-radius: 8px;
    background: rgba(254, 243, 199, 0.14);
    border: 1px solid rgba(253, 224, 71, 0.35);
    color: #fef08a;
    font-size: 11.5px;
    line-height: 1.35;
}
.qh-nn-codo-appbar-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin-top: 7px;
    background: rgba(7, 22, 40, 0.5);
    padding: 3px;
    border-radius: 9px;
}
#qh-nenep-root .qh-nn-codo-nav-pill {
    min-height: 34px;
    padding: 4px 8px;
    border-radius: 7px;
    border: none;
    background: transparent;
    color: #cbd5e1 !important;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 120ms ease, color 120ms ease;
}
#qh-nenep-root .qh-nn-codo-nav-pill:hover:not(.is-active) {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff !important;
}
#qh-nenep-root .qh-nn-codo-nav-pill.is-active {
    background: #ffffff !important;
    color: #0f2942 !important;
    font-weight: 800;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18) !important;
}

/* Hàng Ngày & Buổi trực + Khu vực tự xuống dòng trên màn hình nhỏ (không tràn ngang) */
.qh-nn-date-session-row {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}
#qh-nenep-root .qh-nn-date-session-row #vioDateInput,
#qh-nenep-root #qhViolationForm #vioClassSelect {
    min-height: 38px;
    height: 38px;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 13.5px;
}
#qh-nenep-root .qh-nn-date-session-row #vioDateInput {
    flex: 1 1 138px;
    min-width: 0;
}
.qh-nn-quick-loc-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
}
.qh-nn-quick-loc-label {
    font-size: 12px;
    font-weight: 800;
    color: #334155;
    white-space: nowrap;
}
.qh-nn-quick-loc-chips {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    min-width: 0;
}
#qh-nenep-root .qh-nn-loc-chip {
    white-space: nowrap;
}

/* Khối 2: Đối tượng theo dõi [Tập thể lớp] | [Chọn học sinh] — Không lồng thẻ thừa, tương phản cao */
#qh-nenep-root .qh-nn-stu-picker-box {
    background: transparent;
    border: none;
    padding: 0;
    margin-bottom: 8px;
}
.qh-nn-target-mode-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.qh-nn-target-segmented {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    padding: 3px;
    border-radius: 9px;
    flex: 1;
}
#qh-nenep-root .qh-nn-target-seg-btn {
    min-height: 34px;
    border-radius: 7px;
    border: 1px solid transparent;
    background: transparent;
    color: #334155 !important;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}
#qh-nenep-root .qh-nn-target-seg-btn:hover:not(.is-active) {
    background: #ffffff;
    color: #0f172a !important;
}
#qh-nenep-root .qh-nn-target-seg-btn.is-active {
    background: #0f2942 !important;
    border-color: #0f2942 !important;
    color: #ffffff !important;
    font-weight: 800;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2) !important;
}
#qhVioStudentPickerDrawer {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px;
    margin-top: 6px !important;
}
.qh-nn-stu-search-row {
    position: relative;
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 6px;
}
#qh-nenep-root .qh-nn-stu-clear-btn {
    min-height: 36px;
    color: #b91c1c !important;
    border-color: #fca5a5 !important;
    white-space: nowrap;
}
.qh-nn-selected-students-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.qh-nn-selected-stu-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    font-size: 12px;
    font-weight: 800;
}
.qh-nn-selected-stu-tag button {
    background: transparent;
    border: none;
    color: #991b1b;
    font-weight: 900;
    font-size: 15px;
    line-height: 1;
    padding: 0 2px;
    cursor: pointer;
}

/* Khối 3: Danh sách Tiêu chí lỗi — Phẳng, sạch, không lồng thẻ, cố định chuẩn icon tìm kiếm */
#qh-nenep-root .qh-nn-crit-picker-box {
    background: transparent;
    border: none;
    padding: 2px 0 0;
    margin-bottom: 8px;
}
.qh-nn-crit-box-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    width: 100%;
    min-width: 0;
    flex-wrap: wrap;
}
.qh-nn-crit-box-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
    flex: 1;
}
.qh-nn-crit-box-title span {
    font-size: 14.5px;
    font-weight: 800;
    color: #0f2942;
}
.qh-nn-crit-box-title small {
    font-size: 11.8px;
    color: #475569;
    line-height: 1.35;
}
.qh-nn-crit-box-actions {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

/* Sửa dứt điểm lỗi icon kính lúp (tương thích cả <i> và <svg> của Font Awesome 6) */
.qh-nn-search-input-wrap {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: flex;
    align-items: center;
}
.qh-nn-search-icon-slot,
.qh-nn-search-input-wrap > i.fa-search,
.qh-nn-search-input-wrap > svg {
    position: absolute !important;
    left: 11px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    color: #64748b;
    pointer-events: none;
    z-index: 2;
}
.qh-nn-search-icon-slot svg,
.qh-nn-search-icon-slot i {
    width: 14px;
    height: 14px;
    font-size: 14px;
    display: block;
}
#qh-nenep-root .qh-nn-search-input-wrap .qh-nn-input {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 36px;
    height: 36px;
    padding: 5px 12px 5px 34px !important;
    border-radius: 8px !important;
    font-size: 13px;
    background: #f8fafc;
    box-sizing: border-box !important;
    display: block !important;
}
#qh-nenep-root .qh-nn-search-input-wrap .qh-nn-input:focus {
    background: #ffffff;
}

/* Hàng tùy chọn mở rộng (Ảnh • Nhắc nhở 0đ • Ghi chú) */
.qh-nn-codo-extras-bar {
    margin-top: 8px;
    margin-bottom: 12px;
    padding-bottom: 4px;
    scroll-margin-bottom: 112px;
}
.qh-nn-codo-extra-pills {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}
#qh-nenep-root .qh-nn-extra-pill {
    min-height: 38px;
    padding: 5px 8px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155 !important;
    font-size: 12.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    margin: 0;
    text-align: center;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
#qh-nenep-root .qh-nn-extra-pill:hover:not(.is-active) {
    background: #f1f5f9;
    border-color: #64748b;
    color: #0f172a !important;
}
.qh-nn-extra-check input {
    display: none;
}
#qh-nenep-root .qh-nn-extra-pill.is-active {
    background: #0f2942 !important;
    border-color: #0f2942 !important;
    color: #ffffff !important;
    font-weight: 800;
}

.qh-nn-sticky-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
#qh-nenep-root .qh-nn-btn-good-class {
    min-height: 40px;
    padding: 7px 13px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    background: #059669 !important;
    border-color: #34d399 !important;
    color: #ffffff !important;
    white-space: nowrap;
}
#qh-nenep-root .qh-nn-btn-good-class:hover:not(:disabled) {
    background: #047857 !important;
}

/* Chuẩn cảm ứng & hiển thị từng dòng Tiêu chí lỗi */
.qh-nn-crit-row-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.qh-nn-crit-unit-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 11.5px;
    font-weight: 800;
    line-height: 1.3;
}
.qh-nn-crit-scope-lbl {
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    background: #f1f5f9;
    padding: 2px 7px;
    border-radius: 6px;
}
.qh-nn-crit-row-total {
    min-width: 0 !important;
    padding: 2px 8px !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    white-space: nowrap;
}
.qh-nn-crit-row-total.is-deduct {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}
.qh-nn-crit-row-total.is-bonus {
    background: #d1fae5;
    border: 1px solid #6ee7b7;
    color: #065f46;
}
.qh-nn-crit-row-total.is-exempt {
    background: #f0f9ff;
    border: 1px solid #7dd3fc;
    color: #0369a1;
}
.qh-nn-crit-row-total.is-zero {
    display: none !important;
}

/* Bộ đếm [−][Số][+], Phím chọn nhanh [0][1][2][3] & Nút ✕ Xóa về 0 */
.qh-nn-crit-row-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-width: 0;
}
.qh-nn-crit-row-info {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}
#qh-nenep-root .qh-nn-crit-clear-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px !important;
    min-height: 26px !important;
    border-radius: 6px !important;
    border: 1px solid #fca5a5 !important;
    background: #ffffff !important;
    color: #dc2626 !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
}
#qh-nenep-root .qh-nn-crit-clear-btn:hover {
    background: #fee2e2 !important;
}

.qh-nn-crit-stepper {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #94a3b8;
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
    flex-shrink: 0;
}
#qh-nenep-root .qh-nn-step-btn {
    width: 38px !important;
    height: 38px !important;
    border: none !important;
    background: #334155 !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    font-size: 19px !important;
    line-height: 1 !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    flex-shrink: 0;
    transition: background-color 120ms ease;
}
#qh-nenep-root .qh-nn-step-btn.minus:hover:not(.is-muted) {
    background: #0f2942 !important;
}
#qh-nenep-root .qh-nn-step-btn.minus.is-muted {
    background: #f1f5f9 !important;
    color: #94a3b8 !important;
}
#qh-nenep-root .qh-nn-step-btn.plus {
    background: #0f2942 !important;
    color: #ffffff !important;
}
#qh-nenep-root .qh-nn-step-btn.plus:hover {
    background: #1e3a5f !important;
}
#qh-nenep-root .qh-nn-crit-row.is-selected .qh-nn-step-btn.plus {
    background: #dc2626 !important;
    color: #ffffff !important;
}
#qh-nenep-root .qh-nn-crit-row.is-selected .qh-nn-step-btn.plus:hover {
    background: #b91c1c !important;
}
#qh-nenep-root input.qh-nn-crit-qty-input {
    width: 46px !important;
    min-width: 46px !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-left: 1px solid #cbd5e1 !important;
    border-right: 1px solid #cbd5e1 !important;
    border-radius: 0 !important;
    text-align: center !important;
    font-family: 'Lexend', 'Be Vietnam Pro', sans-serif !important;
    font-size: 15.5px !important;
    font-weight: 800 !important;
    line-height: 38px !important;
    color: #0f172a !important;
    background: #ffffff !important;
    -webkit-appearance: none !important;
    -moz-appearance: textfield !important;
    appearance: none !important;
    box-shadow: none !important;
}
#qh-nenep-root input.qh-nn-crit-qty-input.has-val {
    background: #fffbeb !important;
    color: #b91c1c !important;
    font-size: 16.5px !important;
}
#qh-nenep-root input.qh-nn-crit-qty-input:focus {
    outline: none !important;
    background: #fef3c7 !important;
    color: #991b1b !important;
}

.qh-nn-crit-preset-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
}
#qh-nenep-root .qh-nn-preset-btn {
    min-width: 34px !important;
    height: 36px !important;
    padding: 0 8px !important;
    border-radius: 7px !important;
    border: 1px solid #cbd5e1 !important;
    background: #f8fafc !important;
    color: #334155 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}
#qh-nenep-root .qh-nn-preset-btn:hover:not(.is-active) {
    background: #f1f5f9 !important;
    border-color: #64748b !important;
    color: #0f172a !important;
}
#qh-nenep-root .qh-nn-preset-btn[data-val="0"].is-active {
    background: #e2e8f0 !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
    font-weight: 800 !important;
}
#qh-nenep-root .qh-nn-preset-btn:not([data-val="0"]).is-active,
#qh-nenep-root .qh-nn-crit-row.is-selected .qh-nn-preset-btn.is-active {
    background: #dc2626 !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
    font-weight: 800 !important;
}
#qh-nenep-root .qh-nn-btn-sticky-reset {
    min-height: 40px;
    padding: 7px 11px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.14) !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    color: #fecaca !important;
    font-size: 12.5px;
    font-weight: 800;
}

/* Thẻ lịch sử phiếu vi phạm (#qhNnRecordsFeed) rõ ràng trên cả PC & Mobile */
.qh-nn-records-feed-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 760px;
    overflow-y: auto;
}
.qh-nn-feed-filter-pills {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    max-width: 100%;
    scrollbar-width: none;
}
.qh-nn-feed-filter-pills::-webkit-scrollbar {
    display: none;
}
.qh-nn-feed-filter-pills .qh-nn-pill-btn {
    white-space: nowrap;
    flex-shrink: 0;
}
.qh-nn-vio-feed-card {
    padding: 11px 13px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.qh-nn-vio-feed-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    padding-bottom: 6px;
    margin-bottom: 6px;
    border-bottom: 1px dashed #e2e8f0;
}
.qh-nn-vio-feed-cls-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.qh-nn-vio-feed-cls {
    display: inline-flex;
    padding: 2px 9px;
    border-radius: 6px;
    background: #0f2942;
    color: #fde68a;
    font-size: 12.5px;
    font-weight: 800;
}
.qh-nn-vio-feed-time {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
}
.qh-nn-vio-feed-badges {
    display: inline-flex;
    gap: 5px;
    flex-wrap: wrap;
}
.qh-nn-vio-feed-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}
.qh-nn-vio-feed-title {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.38;
    flex: 1;
    min-width: 180px;
}
.qh-nn-vio-feed-pts {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}
.qh-nn-vio-feed-pts.is-deduct {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}
.qh-nn-vio-feed-pts.is-bonus {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}
.qh-nn-vio-feed-pts.is-neutral {
    background: #e0f2fe;
    color: #0369a1;
}
.qh-nn-vio-feed-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-top: 5px;
    font-size: 12.5px;
    color: #334155;
}
.qh-nn-vio-feed-note {
    margin-top: 6px;
    padding: 6px 9px;
    border-radius: 8px;
    background: #f8fafc;
    font-size: 12.5px;
    color: #334155;
    border: 1px solid #e2e8f0;
}

/* =========================================================================
   RESPONSIVE TABLET & MOBILE CHO TRANG NHẬP LỖI TRỰC BAN (<= 768px & <= 560px)
   ========================================================================= */
@media (max-width: 768px) {
    #panel-violations {
        --nn-vio-sticky-h: 78px;
    }
    #qh-nenep-root .qh-nn-split-2 {
        grid-template-columns: minmax(0, 1fr) !important;
    }
    .qh-nn-codo-context-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 8px;
    }
    .qh-nn-date-session-row {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        width: 100% !important;
    }
    #qh-nenep-root .qh-nn-date-session-row #vioDateInput,
    #qh-nenep-root #qhViolationForm #vioClassSelect {
        min-height: 42px;
        height: 42px;
    }
    #qh-nenep-root .qh-nn-session-btn {
        min-height: 36px;
        padding: 6px 14px;
        font-size: 13.5px;
    }
    #qh-nenep-root .qh-nn-target-seg-btn {
        min-height: 38px;
        font-size: 13.5px;
    }
    .qh-nn-desktop-only-summary {
        display: none !important;
    }
    #qh-nenep-root #panel-violations input.qh-nn-input,
    #qh-nenep-root #panel-violations select.qh-nn-select,
    #qh-nenep-root #panel-violations textarea.qh-nn-textarea {
        font-size: 16px !important;
    }
    #qh-nenep-root .qh-nn-search-input-wrap .qh-nn-input {
        min-height: 42px;
        height: 42px;
    }
    /* Bộ lọc nhóm tiêu chí cuộn ngang 1 dòng mượt trên điện thoại */
    #qh-nenep-root .qh-nn-cat-pills-bar {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        scrollbar-width: none;
    }
    #qh-nenep-root .qh-nn-cat-pills-bar::-webkit-scrollbar {
        display: none;
    }
    #qh-nenep-root .qh-nn-cat-pill {
        min-height: 36px;
        padding: 6px 12px;
    }
    .qh-nn-records-feed-list {
        max-height: none !important;
        overflow-y: visible !important;
    }
    /* Đệm đáy khớp chiều cao thanh cố định để không bao giờ che khuất nội dung cuối danh sách */
    #qh-nenep-root #panel-violations #qhViolationFormCard {
        padding: 10px 11px calc(var(--nn-vio-sticky-h, 78px) + env(safe-area-inset-bottom, 0px) + 12px) !important;
        margin-bottom: 0 !important;
    }
    /* Thanh tổng kết & nút Lớp Tốt / Gửi Phiếu cố định dưới đáy màn hình */
    #panel-violations .qh-nn-sticky-submit-bar {
        position: fixed !important;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 95;
        margin: 0 !important;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 9px 12px calc(9px + env(safe-area-inset-bottom, 0px)) !important;
        border-radius: 12px 12px 0 0 !important;
        border-left: none;
        border-right: none;
        border-bottom: none;
        background: #0f2942 !important;
        color: #ffffff !important;
        box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.24) !important;
    }
    #panel-violations .qh-nn-sticky-submit-bar.has-selection {
        background: linear-gradient(135deg, #0f2942 0%, #7f1d1d 100%) !important;
    }
    #qh-nenep-root .qh-nn-btn-good-class,
    #qh-nenep-root .qh-nn-btn-submit-main,
    #qh-nenep-root .qh-nn-btn-sticky-reset {
        min-height: 44px;
    }
}

/* Điện thoại màn hình dọc (<= 600px): Dòng tiêu chí rộng rãi & Thanh cố định tách 2 hàng thoáng đãng */
@media (max-width: 600px) {
    #panel-violations {
        --nn-vio-sticky-h: 112px;
    }
    .qh-nn-crit-box-title small {
        display: block;
        width: 100%;
    }
    .qh-nn-crit-row {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
        padding: 10px 12px !important;
        border-radius: 10px !important;
    }
    .qh-nn-crit-row-title strong {
        font-size: 14.5px;
        line-height: 1.38;
        color: #0f172a;
    }
    .qh-nn-crit-row-controls {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        flex-wrap: wrap !important;
        width: 100% !important;
        padding-top: 7px !important;
        border-top: 1px dashed #e2e8f0 !important;
        gap: 8px !important;
    }
    #qh-nenep-root .qh-nn-step-btn {
        width: 44px !important;
        height: 42px !important;
        font-size: 21px !important;
    }
    #qh-nenep-root input.qh-nn-crit-qty-input {
        width: 52px !important;
        min-width: 52px !important;
        height: 42px !important;
        min-height: 42px !important;
        line-height: 42px !important;
        font-size: 17px !important;
    }
    #qh-nenep-root .qh-nn-preset-btn {
        min-width: 36px !important;
        height: 38px !important;
    }
    .qh-nn-codo-extra-pills {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5px;
    }
    #qh-nenep-root .qh-nn-extra-pill {
        min-height: 40px;
        padding: 5px 6px;
        font-size: 12px;
    }
    #panel-violations .qh-nn-sticky-submit-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 7px !important;
    }
    #panel-violations .qh-nn-sticky-summary {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100%;
    }
    #panel-violations .qh-nn-sticky-actions {
        width: 100%;
        display: flex;
        gap: 8px;
    }
    #qh-nenep-root #panel-violations .qh-nn-btn-good-class,
    #qh-nenep-root #panel-violations .qh-nn-btn-submit-main {
        flex: 1 1 0;
        justify-content: center;
        font-size: 13.5px;
        padding: 8px 10px;
    }
    #qh-nenep-root #panel-violations .qh-nn-btn-sticky-reset {
        flex: 0 0 auto;
        padding: 8px 12px;
    }
}

/* --- 3. Trung Tâm Phân Công Cờ Đỏ & Ủy Quyền BCH Đoàn Trường --- */
.qh-nn-codo-center-tabs {
    display: inline-flex;
    gap: 6px;
    background: #e2e8f0;
    padding: 5px;
    border-radius: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
#qh-nenep-root .qh-nn-codo-center-tab {
    min-height: 40px;
    padding: 8px 16px;
    border-radius: 9px;
    border: none;
    background: transparent;
    color: #334155 !important;
    font-size: 13.5px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
}
#qh-nenep-root .qh-nn-codo-center-tab.is-active {
    background: #0f2942 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(15, 41, 66, 0.22) !important;
}

/* --- Modal Trung tâm Phân công Đội Cờ đỏ (High-Density Operate Mode — 100% Fit-in-Viewport) --- */
#qh-nenep-root .qh-nn-codo-backdrop {
    position: fixed !important;
    inset: 0 !important;
    z-index: 100010 !important;
    padding: 10px 14px !important;
    box-sizing: border-box !important;
    background: rgba(15, 23, 42, 0.78) !important;
    backdrop-filter: blur(3px);
}
#qh-nenep-root .qh-nn-codo-center-dialog {
    max-width: 1460px;
    width: min(1460px, calc(100vw - 28px));
    height: calc(100vh - 20px);
    height: calc(100dvh - 20px);
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    margin: auto;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.48);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#qh-nenep-root .qh-nn-codo-compact-header {
    background: linear-gradient(135deg, #0b1f3a 0%, #681818 100%);
    color: #ffffff;
    padding: 8px 14px;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}
.qh-nn-codo-hdr-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
#qh-nenep-root .qh-nn-codo-role-pill {
    background: #f59e0b !important;
    color: #0f172a !important;
    font-weight: 800;
    font-size: 10.5px;
    padding: 3px 8px;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}
#qh-nenep-root .qh-nn-codo-hdr-title {
    margin: 0 !important;
    font-size: 14.5px !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
#qh-nenep-root .qh-nn-codo-hdr-title i {
    color: #fde68a;
}

/* Dải 4 chỉ số KPI tích hợp siêu gọn ngay trên Header */
.qh-nn-codo-stats-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-variant-numeric: tabular-nums;
}
.qh-nn-codo-kpi-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #f8fafc;
    white-space: nowrap;
}
.qh-nn-codo-kpi-chip strong {
    font-weight: 800;
    color: #ffffff;
}
.qh-nn-codo-kpi-chip .kpi-sub {
    color: #cbd5e1;
    font-size: 10.5px;
    font-weight: 600;
}
.qh-nn-codo-kpi-chip.is-ok {
    background: rgba(16, 185, 129, 0.22);
    border-color: rgba(110, 231, 183, 0.45);
    color: #ecfdf5;
}
.qh-nn-codo-kpi-chip.is-warn {
    background: rgba(245, 158, 11, 0.26);
    border-color: rgba(253, 230, 138, 0.55);
    color: #fef3c7;
}
.qh-nn-codo-kpi-chip.is-danger {
    background: rgba(239, 68, 68, 0.32);
    border-color: rgba(252, 165, 165, 0.65);
    color: #fee2e2;
}

.qh-nn-codo-hdr-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}
#qh-nenep-root .qh-nn-btn.outline.qh-nn-codo-hdr-btn,
#qh-nenep-root .qh-nn-codo-hdr-btn {
    background: rgba(255, 255, 255, 0.14) !important;
    color: #fef08a !important;
    border: 1px solid rgba(254, 240, 138, 0.52) !important;
    font-weight: 700 !important;
    font-size: 12px !important;
    min-height: 32px !important;
    padding: 4px 11px !important;
    border-radius: 8px !important;
}
#qh-nenep-root .qh-nn-btn.outline.qh-nn-codo-hdr-btn:hover:not(:disabled),
#qh-nenep-root .qh-nn-codo-hdr-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.24) !important;
    color: #ffffff !important;
    border-color: #fde68a !important;
}
#qh-nenep-root .qh-nn-btn.outline.qh-nn-codo-close-btn,
#qh-nenep-root .qh-nn-codo-close-btn {
    background: #ffffff !important;
    color: #991b1b !important;
    border: 1.5px solid #fecaca !important;
    font-weight: 800 !important;
    font-size: 12.5px !important;
    min-height: 32px !important;
    padding: 4px 14px !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.22) !important;
}
#qh-nenep-root .qh-nn-btn.outline.qh-nn-codo-close-btn:hover:not(:disabled),
#qh-nenep-root .qh-nn-codo-close-btn:hover:not(:disabled) {
    background: #fef2f2 !important;
    color: #7f1d1d !important;
    border-color: #f87171 !important;
    transform: translateY(-1px);
}

/* Modal Body Flex Khóa Chiều Cao — Chỉ Cuộn Vùng Bảng */
#qh-nenep-root .qh-nn-codo-modal-body {
    flex: 1;
    min-height: 0;
    max-height: none !important;
    overflow: hidden !important;
    padding: 8px 12px 10px !important;
    background: #f1f5f9;
    display: flex;
    flex-direction: column;
}
.qh-nn-codo-panel-flex {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Khung Điều Phối Mật Độ Cao 3 Dải Gọn */
.qh-nn-codo-engine-box {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 7px 11px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.qh-nn-codo-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}
.qh-nn-codo-band-top,
.qh-nn-codo-band-methods {
    padding-bottom: 6px;
    border-bottom: 1px solid #e2e8f0;
}

.qh-nn-codo-week-picker {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}
.qh-nn-codo-week-picker label,
.qh-nn-codo-band-lbl,
.qh-nn-codo-step-wrap label {
    font-size: 12px;
    font-weight: 800;
    color: #0f2942;
    margin: 0;
    white-space: nowrap;
}
.qh-nn-codo-sep-txt {
    font-size: 11.5px;
    color: #475569;
    font-weight: 700;
}
#qh-nenep-root select.qh-nn-codo-compact-sel {
    min-height: 29px !important;
    height: 29px !important;
    padding: 2px 24px 2px 8px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    border-radius: 7px !important;
}
.qh-nn-codo-engine-opts {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.qh-nn-codo-limit-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 7px;
    padding: 2px 7px;
    font-size: 11.5px;
    font-weight: 800;
    color: #991b1b;
    font-variant-numeric: tabular-nums;
}
#qh-nenep-root .qh-nn-codo-limit-pill select {
    width: 46px !important;
    min-height: 24px !important;
    height: 24px !important;
    padding: 1px 4px !important;
    font-size: 11.5px !important;
    font-weight: 800 !important;
    border-radius: 5px !important;
}
#qh-nenep-root .qh-nn-codo-save-lim-btn {
    min-height: 24px !important;
    padding: 2px 7px !important;
    font-size: 11px !important;
    background: #0f766e !important;
    border-color: #0d9488 !important;
    border-radius: 5px !important;
}
.qh-nn-codo-opt-chk {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 700;
    color: #0f2942;
    cursor: pointer;
    margin: 0;
    user-select: none;
    transition: opacity 140ms ease;
}
.qh-nn-codo-step-wrap {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: opacity 140ms ease;
}
.qh-nn-codo-opt-chk.is-dimmed,
.qh-nn-codo-step-wrap.is-dimmed {
    opacity: 0.45;
}
#qh-nenep-root .qh-nn-codo-seed-btn {
    min-height: 29px !important;
    padding: 3px 9px !important;
    font-size: 11.5px !important;
    font-weight: 800 !important;
    background: #f0fdfa !important;
    color: #0f766e !important;
    border-color: #5eead4 !important;
    border-radius: 7px !important;
}

/* Dải 2: 6 Chip Chọn Phương Án + Nút Phân Công Trực Tuần */
.qh-nn-codo-methods-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}
.qh-nn-codo-methods-grid {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}
#qh-nenep-root .qh-nn-method-card {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    min-height: 30px;
    padding: 4px 10px;
    border-radius: 7px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    cursor: pointer;
    user-select: none;
    transition: transform 140ms cubic-bezier(0.23, 1, 0.32, 1), border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}
#qh-nenep-root .qh-nn-method-card:hover {
    background: #ffffff;
    border-color: #64748b;
}
#qh-nenep-root .qh-nn-method-card:active {
    transform: scale(0.98);
}
#qh-nenep-root .qh-nn-method-card:focus-visible {
    outline: 2px solid #0284c7;
    outline-offset: 1px;
}
.qh-nn-method-card .m-chk {
    display: none;
    width: 15px;
    height: 15px;
    border-radius: 999px;
    background: #0f2942;
    color: #ffffff;
    font-size: 9px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.qh-nn-method-card .m-ico {
    font-size: 12px;
}
.qh-nn-method-card .m-title {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    white-space: nowrap;
}
#qh-nenep-root .qh-nn-method-card.is-selected {
    background: #eff6ff !important;
    border-color: #1d4ed8 !important;
    box-shadow: 0 1px 2px rgba(29, 78, 216, 0.14) !important;
}
#qh-nenep-root .qh-nn-method-card.is-selected .m-chk {
    display: inline-flex;
    background: #1d4ed8;
}
#qh-nenep-root .qh-nn-method-card.is-selected .m-title {
    color: #0f172a;
    font-weight: 800;
}
#qh-nenep-root .qh-nn-method-card[data-codo-method="split_pair_cross"].is-selected {
    background: #fffbeb !important;
    border-color: #d97706 !important;
}
#qh-nenep-root .qh-nn-method-card[data-codo-method="split_pair_cross"].is-selected .m-chk {
    background: #d97706;
}

/* Nút Chính: Phân Công Trực Tuần theo Phương án đã chọn */
#qh-nenep-root .qh-nn-btn-exec-plan {
    background: #059669 !important;
    border: 1px solid #047857 !important;
    color: #ffffff !important;
    min-height: 32px !important;
    padding: 5px 14px !important;
    font-size: 12.5px !important;
    font-weight: 800 !important;
    border-radius: 8px !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.22) !important;
    transition: transform 140ms cubic-bezier(0.23, 1, 0.32, 1), background-color 140ms ease;
}
#qh-nenep-root .qh-nn-btn-exec-plan:hover {
    background: #047857 !important;
    transform: translateY(-1px);
}
#qh-nenep-root .qh-nn-btn-exec-plan:active {
    transform: scale(0.98);
}

/* Dải 3: Bộ lọc, Chế độ xem, Xuất Excel & Lưu Thủ Công */
.qh-nn-codo-toolbar-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.qh-nn-codo-filter-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
}
#qh-nenep-root .qh-nn-codo-grade-pills,
#qh-nenep-root .qh-nn-codo-density-pills {
    padding: 2px !important;
    border-radius: 8px !important;
    gap: 2px !important;
}
#qh-nenep-root .qh-nn-codo-grade-pills .qh-nn-pill-btn,
#qh-nenep-root .qh-nn-codo-density-pills .qh-nn-pill-btn {
    min-height: 26px !important;
    padding: 3px 9px !important;
    font-size: 11.5px !important;
    border-radius: 6px !important;
}
#qh-nenep-root input.qh-nn-codo-search-inp {
    width: 175px !important;
    min-height: 29px !important;
    height: 29px !important;
    padding: 3px 9px !important;
    font-size: 12px !important;
    border-radius: 7px !important;
}
.qh-nn-codo-plan-hint {
    font-size: 11.5px;
    font-weight: 700;
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 3px 8px;
    white-space: nowrap;
    max-width: 380px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.qh-nn-codo-actions-right {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
#qh-nenep-root .qh-nn-btn-excel-export {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    border: 1px solid #93c5fd !important;
    min-height: 30px !important;
    padding: 4px 11px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    border-radius: 7px !important;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: transform 140ms cubic-bezier(0.23, 1, 0.32, 1), background-color 140ms ease;
}
#qh-nenep-root .qh-nn-btn-excel-export:hover {
    background: #dbeafe !important;
}
#qh-nenep-root .qh-nn-btn-excel-export:active {
    transform: scale(0.98);
}
#qh-nenep-root .qh-nn-btn-save-manual {
    background: #dc2626 !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
    min-height: 30px !important;
    padding: 4px 13px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    border-radius: 7px !important;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Vùng Bảng Cuộn Độc Lập + Sticky Header + Dòng Mật Độ Cao */
.qh-nn-codo-scroll-table {
    flex: 1;
    min-height: 0;
    overflow: auto !important;
    scrollbar-gutter: stable;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
}
.qh-nn-codo-dense-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-variant-numeric: tabular-nums;
}
.qh-nn-codo-dense-table thead th {
    position: sticky;
    top: 0;
    z-index: 6;
    background: #0f2942 !important;
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    padding: 7px 8px !important;
    border-bottom: 1px solid #0b1f3a !important;
    white-space: nowrap;
}
.qh-nn-codo-dense-table tbody td {
    padding: 5px 8px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    vertical-align: middle !important;
    font-size: 12.5px !important;
}
.qh-nn-codo-dense-table tbody tr:nth-child(even) {
    background: #f8fafc;
}
.qh-nn-codo-dense-table tbody tr:hover {
    background: #eff6ff !important;
}
.codo-row-subsep {
    border-top: 1px dashed #cbd5e1;
    margin-top: 4px;
    padding-top: 4px;
}
.codo-orig-cell-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}
.codo-orig-cls-badge {
    font-weight: 800;
    font-size: 13px;
    color: #0f2942;
}
.codo-gvcn-sub {
    font-size: 11px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 148px;
}
.codo-member-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    flex-wrap: wrap;
}
.codo-cred-inline {
    font-size: 11px;
    color: #0f766e;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 2px;
}
.codo-cred-inline code {
    background: #f1f5f9;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 10.8px;
    color: #0f172a;
    border: 1px solid #e2e8f0;
}
#qh-nenep-root button.codo-inline-act-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    min-height: 21px;
    padding: 1px 6px;
    border-radius: 5px;
    font-size: 10.8px;
    font-weight: 800;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 120ms cubic-bezier(0.23, 1, 0.32, 1), background-color 140ms ease, border-color 140ms ease;
}
#qh-nenep-root button.codo-inline-act-btn:active {
    transform: scale(0.96);
}
#qh-nenep-root button.codo-inline-act-btn.edit-tk {
    background: #fef2f2;
    color: #b91c1c !important;
    border: 1px solid #fca5a5;
}
#qh-nenep-root button.codo-inline-act-btn.edit-tk:hover {
    background: #fee2e2;
    border-color: #ef4444;
    color: #7f1d1d !important;
}
#qh-nenep-root button.codo-inline-act-btn.swap-hs {
    background: #f0fdfa;
    color: #0f766e !important;
    border: 1px solid #99f6e4;
}
#qh-nenep-root button.codo-inline-act-btn.swap-hs:hover {
    background: #ccfbf1;
    border-color: #14b8a6;
    color: #115e59 !important;
}
#qh-nenep-root button.codo-inline-act-btn.add-hs {
    background: #eff6ff;
    color: #1d4ed8 !important;
    border: 1px solid #bfdbfe;
}
#qh-nenep-root button.codo-inline-act-btn.add-hs:hover {
    background: #dbeafe;
    border-color: #60a5fa;
}
#qh-nenep-root .qh-nn-btn-save-manual.has-unsaved-changes {
    box-shadow: 0 0 0 2px #fde68a, 0 2px 6px rgba(220, 38, 38, 0.32) !important;
}
.codo-duty-single-line {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}
#qh-nenep-root .codo-sched-target-sel {
    min-height: 29px !important;
    height: 29px !important;
    padding: 2px 22px 2px 7px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    border-radius: 6px !important;
}
#qh-nenep-root .codo-sched-session-sel,
#qh-nenep-root .codo-sched-focus-sel,
#qh-nenep-root .codo-sched-note-inp {
    min-height: 28px !important;
    height: 28px !important;
    padding: 2px 6px !important;
    font-size: 11.5px !important;
    border-radius: 6px !important;
}
#qh-nenep-root .codo-pin-btn,
#qh-nenep-root .codo-swap-btn {
    min-height: 28px;
    height: 28px;
    padding: 2px 7px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155 !important;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}
#qh-nenep-root .codo-pin-btn.is-pinned {
    background: #fef3c7 !important;
    border-color: #f59e0b !important;
    color: #92400e !important;
}
#qh-nenep-root .codo-swap-btn.is-swap-source {
    background: #dbeafe !important;
    border-color: #2563eb !important;
    color: #1e40af !important;
}
#qh-nenep-root select.codo-sched-target-sel.is-self-conflict {
    border-color: #dc2626 !important;
    background: #fef2f2 !important;
    color: #991b1b !important;
}

/* Chế độ Lưới 24 Lớp (2 Cột Song Song — Nhìn Trọn 24 Lớp Trên 1 Khung Hình) */
.qh-nn-codo-grid2-wrap {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
    background: #f8fafc;
}
.qh-nn-codo-grid2-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 9px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    font-variant-numeric: tabular-nums;
}
.qh-nn-codo-grid2-card:hover {
    border-color: #64748b;
    background: #eff6ff;
}
.qh-nn-codo-grid2-left {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    flex: 1;
}
.qh-nn-codo-grid2-cls {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    padding: 2px 6px;
    border-radius: 6px;
    background: #0f2942;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
}
.qh-nn-codo-grid2-meta {
    min-width: 0;
    flex: 1;
}
.qh-nn-codo-grid2-name {
    font-size: 12px;
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.qh-nn-codo-grid2-sub {
    font-size: 10.5px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.qh-nn-codo-grid2-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.qh-nn-codo-mini-status {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}
.qh-nn-codo-mini-status.pending {
    background: #f1f5f9;
    color: #64748b;
}
.qh-nn-codo-mini-status.ok {
    background: #d1fae5;
    color: #065f46;
}
.qh-nn-codo-mini-status.active {
    background: #fee2e2;
    color: #991b1b;
}

/* Thanh chân trang cố định gọn nhẹ đáy khung Overlay Cờ đỏ */
.qh-nn-codo-modal-footer {
    background: #ffffff;
    border-top: 1px solid #cbd5e1;
    padding: 6px 14px;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.qh-nn-codo-footer-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
    flex-wrap: wrap;
}
.qh-nn-codo-foot-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}
.qh-nn-codo-foot-badge.is-synced {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.qh-nn-codo-foot-badge.is-dirty {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fcd34d;
}
.qh-nn-codo-foot-guide {
    font-size: 11.5px;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.qh-nn-codo-foot-guide strong {
    color: #0f2942;
    font-weight: 800;
}
.qh-nn-codo-footer-right {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
#qh-nenep-root .qh-nn-btn.outline.qh-nn-codo-footer-close-btn {
    min-height: 28px !important;
    padding: 3px 12px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    border-radius: 7px !important;
    background: #f8fafc !important;
    color: #0f2942 !important;
    border: 1px solid #94a3b8 !important;
}
#qh-nenep-root .qh-nn-btn.outline.qh-nn-codo-footer-close-btn:hover:not(:disabled) {
    background: #fee2e2 !important;
    color: #991b1b !important;
    border-color: #f87171 !important;
}

@media (max-height: 680px) {
    #qh-nenep-root .qh-nn-codo-backdrop {
        padding: 6px 10px !important;
    }
    #qh-nenep-root .qh-nn-codo-center-dialog {
        height: calc(100vh - 12px);
        height: calc(100dvh - 12px);
        max-height: calc(100vh - 12px);
        max-height: calc(100dvh - 12px);
    }
    #qh-nenep-root .qh-nn-codo-compact-header {
        padding: 5px 12px;
        min-height: 40px;
    }
    #qh-nenep-root .qh-nn-codo-modal-body {
        padding: 5px 10px 6px !important;
    }
    .qh-nn-codo-engine-box {
        padding: 5px 9px;
        gap: 4px;
    }
    .qh-nn-codo-band-top,
    .qh-nn-codo-band-methods {
        padding-bottom: 4px;
    }
    .qh-nn-codo-modal-footer {
        padding: 4px 12px;
        min-height: 32px;
    }
}

@media (max-width: 1024px) {
    .qh-nn-codo-grid2-wrap {
        grid-template-columns: 1fr;
    }
    .qh-nn-codo-plan-hint,
    .qh-nn-codo-foot-guide {
        display: none;
    }
}
@media (max-width: 768px) {
    #qh-nenep-root .qh-nn-codo-backdrop {
        padding: 4px !important;
    }
    #qh-nenep-root .qh-nn-codo-center-dialog {
        width: calc(100vw - 8px);
        height: calc(100dvh - 8px);
        max-height: calc(100dvh - 8px);
        border-radius: 10px;
    }
    #qh-nenep-root .qh-nn-codo-modal-body {
        overflow-y: auto !important;
    }
}

/* =========================================================================
   TRUNG TÂM TÀI KHOẢN & PHÂN QUYỀN TẬP TRUNG HỢP NHẤT (TAB 6 — OPERATE MODE)
   ========================================================================= */
.qh-nn-rbac-subtabs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    background: #ffffff;
    border: 1px solid var(--nn-border);
    border-radius: var(--nn-radius-md);
    padding: 6px;
    margin-bottom: 16px;
    box-shadow: var(--nn-shadow-xs);
}

#qh-nenep-root .qh-nn-rbac-subtab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 16px;
    border-radius: 9px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--nn-text-secondary) !important;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 150ms var(--nn-ease), color 150ms ease, transform 120ms var(--nn-ease);
}

#qh-nenep-root .qh-nn-rbac-subtab:hover {
    background: #f1f5f9;
    color: var(--nn-navy) !important;
}

#qh-nenep-root .qh-nn-rbac-subtab.is-active {
    background: var(--nn-navy) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(15, 41, 66, 0.18);
}

.qh-nn-rbac-subtab-cnt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 20px;
    padding: 0 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    background: rgba(15, 23, 42, 0.08);
    color: inherit;
}

#qh-nenep-root .qh-nn-rbac-subtab.is-active .qh-nn-rbac-subtab-cnt {
    background: rgba(255, 255, 255, 0.2);
    color: #fde68a;
}

.qh-nn-rbac-hub-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--nn-border-subtle);
}

.qh-nn-rbac-hub-title-wrap {
    flex: 1;
    min-width: 280px;
}

.qh-nn-rbac-sync-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.qh-nn-rbac-sync-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #059669;
    flex-shrink: 0;
}

.qh-nn-rbac-hub-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

#qh-nenep-root .qh-nn-btn.emerald {
    background: #059669 !important;
    border: 1px solid #047857 !important;
    color: #ffffff !important;
}

#qh-nenep-root .qh-nn-btn.emerald:hover {
    background: #047857 !important;
}

.qh-nn-rbac-drawer {
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--nn-radius-md);
    padding: 16px 18px;
    margin-bottom: 16px;
}

.qh-nn-rbac-drawer.bch-theme {
    background: #f0fdf4;
    border-color: #86efac;
}

.qh-nn-rbac-drawer-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.qh-nn-rbac-drawer-title {
    display: block;
    font-size: 0.96rem;
    font-weight: 800;
    color: var(--nn-navy);
    margin-bottom: 3px;
}

.qh-nn-rbac-drawer-desc {
    font-size: 0.8rem;
    color: var(--nn-text-muted);
    line-height: 1.5;
}

.qh-nn-rbac-form-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.qh-nn-rbac-bch-inline-box {
    background: #ffffff;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 12px;
}

.qh-nn-rbac-bch-inline-grid {
    display: grid;
    grid-template-columns: 1.2fr 1.2fr auto;
    gap: 12px;
    align-items: end;
}

.qh-nn-rbac-bch-form-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.qh-nn-rbac-bch-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 700;
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    padding: 9px 13px;
    border-radius: 9px;
    margin: 0;
}

.qh-nn-rbac-bch-check.compact {
    min-height: 40px;
    white-space: nowrap;
}

.qh-nn-rbac-bch-check input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: #dc2626;
    flex-shrink: 0;
}

.qh-nn-rbac-bch-submit-group {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 1;
    min-width: 260px;
    justify-content: flex-end;
}

.qh-nn-rbac-bch-submit-group .qh-nn-input {
    flex: 1;
    max-width: 300px;
}

.qh-nn-rbac-restriction-hint {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.79rem;
    line-height: 1.45;
    margin-bottom: 12px;
}

.qh-nn-rbac-drawer-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

#qh-nenep-root .qh-nn-mini-link-btn {
    border: none;
    background: #e0f2fe;
    color: #0369a1 !important;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 5px;
    cursor: pointer;
}

#qh-nenep-root .qh-nn-mini-link-btn:hover {
    background: #bae6fd;
}

.qh-nn-rbac-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.qh-nn-rbac-pills {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
}

#qh-nenep-root .qh-nn-rbac-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155 !important;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 140ms ease, border-color 140ms ease, transform 100ms ease;
}

#qh-nenep-root .qh-nn-rbac-pill-btn:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

#qh-nenep-root .qh-nn-rbac-pill-btn:active {
    transform: scale(0.98);
}

#qh-nenep-root .qh-nn-rbac-pill-btn.is-active {
    background: var(--nn-navy) !important;
    border-color: var(--nn-navy) !important;
    color: #ffffff !important;
}

.qh-nn-rbac-pill-btn .cnt {
    background: rgba(15, 23, 42, 0.09);
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

#qh-nenep-root .qh-nn-rbac-pill-btn.is-active .cnt {
    background: rgba(255, 255, 255, 0.22);
    color: #fde68a;
}

.qh-nn-rbac-filter-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    margin-left: auto;
}

.qh-nn-rbac-search-wrap {
    position: relative;
    width: 280px;
    min-width: 200px;
    flex: 0 1 280px;
}

.qh-nn-rbac-search-wrap i,
.qh-nn-rbac-search-wrap svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
}

#qh-nenep-root .qh-nn-rbac-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 0 13px;
    border-radius: 9px;
    border: 1px solid #059669 !important;
    background: #f0fdf4 !important;
    color: #065f46 !important;
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 140ms ease, border-color 140ms ease;
}

#qh-nenep-root .qh-nn-rbac-export-btn:hover:not(:disabled) {
    background: #dcfce7 !important;
    border-color: #047857 !important;
    color: #064e3b !important;
}

#qh-nenep-root .qh-nn-rbac-export-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

@media (max-width: 640px) {
    .qh-nn-rbac-filter-tools {
        width: 100%;
        flex-wrap: wrap;
    }
    .qh-nn-rbac-search-wrap {
        width: auto;
        min-width: 0;
        flex: 1 1 180px;
    }
}

#qh-nenep-root .qh-nn-rbac-search-wrap .qh-nn-input {
    width: 100%;
    padding-left: 34px !important;
    min-height: 38px;
    font-size: 13px;
}

.qh-nn-rbac-table-viewport {
    max-height: 620px;
    overflow-y: auto;
    border: 1px solid var(--nn-border);
    border-radius: 12px;
}

.qh-nn-unified-rbac-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #0f2942 !important;
    color: #ffffff !important;
}

.qh-nn-acc-name {
    font-weight: 800;
    font-size: 0.88rem;
    color: var(--nn-text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.qh-nn-acc-sub {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 3px;
}

.qh-nn-acc-scope-line {
    font-size: 0.77rem;
    color: #334155;
    margin-top: 4px;
}

.qh-nn-pass-chip {
    display: inline-block;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0369a1;
    padding: 0 5px;
    border-radius: 4px;
    font-size: 0.71rem;
    margin-left: 4px;
}

.qh-nn-origin-chip {
    display: inline-block;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    color: #92400e;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 0.69rem;
    font-weight: 700;
}

.qh-nn-badge.emerald {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.qh-nn-badge.primary {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.qh-nn-codo-right-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
}

.qh-nn-codo-right-tag.ok {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.qh-nn-codo-right-tag.muted {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #cbd5e1;
}

.qh-nn-bch-quick-links {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    flex-wrap: wrap;
}

#qh-nenep-root .qh-nn-inline-link-btn {
    border: none;
    background: none;
    padding: 0;
    font-size: 0.74rem;
    font-weight: 700;
    color: #0284c7 !important;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

#qh-nenep-root .qh-nn-inline-link-btn.danger {
    color: #dc2626 !important;
}

.qh-nn-rbac-row-actions {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap;
}

#qh-nenep-root .qh-nn-row-del-btn {
    color: #b91c1c !important;
    border-color: #fca5a5 !important;
}

#qh-nenep-root .qh-nn-row-del-btn:hover {
    background: #fef2f2 !important;
}

.qh-nn-audit-item {
    padding: 8px 12px;
    border-bottom: 1px dashed var(--nn-border);
    font-size: 0.82rem;
    line-height: 1.5;
}

.qh-nn-audit-time {
    color: var(--nn-text-muted);
    margin-right: 4px;
}

.qh-nn-audit-code {
    background: #f1f5f9;
    color: #0f2942;
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 700;
}

@media (max-width: 1080px) {
    .qh-nn-rbac-form-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .qh-nn-rbac-bch-inline-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .qh-nn-rbac-form-grid-4 {
        grid-template-columns: 1fr;
    }
    .qh-nn-rbac-search-wrap {
        flex: 1 1 100%;
    }
}

/* =========================================================================
   MILESTONE 8: TAB 7 MASTER DATA & ADMIN PANELS HIGH-DENSITY OPERATE MODE
   (Progressive Disclosure Drawers • Unified 1-Row Toolbars • Sticky Viewports)
   ========================================================================= */

#qh-nenep-root .qh-nn-btn.xs {
    min-height: 28px !important;
    padding: 3px 8px !important;
    font-size: 0.73rem !important;
    font-weight: 700 !important;
    border-radius: 7px !important;
    gap: 4px;
}

#qh-nenep-root .qh-nn-btn.xxs {
    min-height: 24px !important;
    padding: 2px 6px !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    border-radius: 6px !important;
    gap: 3px;
}

/* --- 1. Bố cục 2 cột song song cân đối cho Tab 7 --- */
#qh-nenep-root .qh-nn-md-split-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.96fr) minmax(0, 1.04fr);
    gap: 12px;
    align-items: start;
    margin-bottom: 14px;
}

#qh-nenep-root .qh-nn-md-split-grid.qh-nn-split-single {
    grid-template-columns: minmax(0, 1fr) !important;
    max-width: 100% !important;
}

#qh-nenep-root .qh-nn-md-card {
    padding: 12px 14px !important;
    border-radius: 14px;
}

/* --- 2. Tầng Header gọn gàng tích hợp công cụ Đóng/Mở ngăn kéo & Excel --- */
.qh-nn-md-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid #E2E8F0;
}

.qh-nn-md-title-group,
.qh-nn-md-class-picker-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
}

#qh-nenep-root .qh-nn-md-title {
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    margin: 0 !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.qh-nn-md-kpi-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    color: #065F46;
    font-size: 0.71rem;
    font-weight: 800;
    white-space: nowrap;
}

#qh-nenep-root select.qh-nn-md-cls-select {
    min-height: 30px !important;
    height: 30px !important;
    padding: 2px 24px 2px 8px !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    color: #1E3A8A !important;
    background-color: #EFF6FF !important;
    border-color: #93C5FD !important;
    border-radius: 7px !important;
    min-width: 165px;
    max-width: 245px;
}

#qh-nenep-root select.qh-nn-md-grp-select {
    min-height: 30px !important;
    height: 30px !important;
    padding: 2px 22px 2px 7px !important;
    font-size: 0.74rem !important;
    font-weight: 700 !important;
    border-radius: 7px !important;
    width: 122px;
}

.qh-nn-md-action-cluster {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

#qh-nenep-root .qh-nn-md-action-cluster .qh-nn-btn.sm {
    min-height: 29px !important;
    padding: 3px 9px !important;
    font-size: 0.74rem !important;
    font-weight: 700 !important;
    border-radius: 7px !important;
    text-decoration: none !important;
}

#qh-nenep-root .qh-nn-md-drawer-btn.is-active {
    background: #0F2942 !important;
    border-color: #0F2942 !important;
    color: #FFFFFF !important;
    box-shadow: 0 2px 6px rgba(15, 41, 66, 0.22);
}

#qh-nenep-root .qh-nn-md-link-btn.is-export {
    color: #047857 !important;
    border-color: #6EE7B7 !important;
    background: #F0FDF4 !important;
}

#qh-nenep-root .qh-nn-md-link-btn.is-export:hover {
    background: #DCFCE7 !important;
}

/* --- 3. Ngăn kéo nhập liệu (Progressive Disclosure Drawers) --- */
.qh-nn-md-drawer {
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
    animation: qhFadeIn 150ms cubic-bezier(0.23, 1, 0.32, 1);
}

.qh-nn-md-drawer.is-amber {
    background: #FFFBEB;
    border: 1.5px solid #F59E0B;
}

.qh-nn-md-drawer.is-blue {
    background: #EFF6FF;
    border: 1.5px solid #60A5FA;
}

.qh-nn-md-drawer.is-emerald {
    background: #ECFDF5;
    border: 1.5px solid #34D399;
}

.qh-nn-md-drawer.is-slate {
    background: #F8FAFC;
    border: 1.5px solid #94A3B8;
}

.qh-nn-md-drawer-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.qh-nn-md-drawer-head strong {
    font-size: 0.82rem;
    color: #0F2942;
}

.qh-nn-md-drawer-head-right {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.qh-nn-md-drawer-hint {
    font-size: 0.75rem;
    color: #334155;
    line-height: 1.4;
    margin-bottom: 8px;
}

.qh-nn-md-excel-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

#qh-nenep-root .qh-nn-md-excel-inline input[type="file"] {
    flex: 1;
    min-width: 200px;
    min-height: 34px !important;
    padding: 5px 8px !important;
    font-size: 0.77rem !important;
    background: #FFFFFF !important;
}

.qh-nn-md-danger-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    color: #991B1B;
    margin: 0;
}

.qh-nn-md-form-grid-3 {
    display: grid;
    grid-template-columns: 1.35fr 0.85fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.qh-nn-md-form-grid-3 .qh-nn-field {
    margin-bottom: 0 !important;
}

#qh-nenep-root .qh-nn-md-drawer .qh-nn-field label {
    font-size: 0.73rem !important;
    margin-bottom: 3px !important;
}

#qh-nenep-root .qh-nn-md-drawer .qh-nn-input,
#qh-nenep-root .qh-nn-md-drawer .qh-nn-select {
    min-height: 32px !important;
    padding: 4px 8px !important;
    font-size: 0.79rem !important;
}

.qh-nn-md-gvcn-box {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    background: #ECFDF5;
    border: 1px solid #34D399;
    border-radius: 8px;
    padding: 6px 10px;
    margin-bottom: 8px;
}

.qh-nn-md-gvcn-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 800;
    color: #065F46;
    cursor: pointer;
    margin: 0;
    white-space: nowrap;
}

.qh-nn-md-gvcn-check input {
    width: 15px;
    height: 15px;
    accent-color: #059669;
}

.qh-nn-md-role-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    padding: 5px 8px;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: 7px;
}

.qh-nn-md-role-checks label {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    font-size: 0.73rem !important;
    font-weight: 700 !important;
    color: #1E293B;
    cursor: pointer;
    margin: 0 !important;
}

/* --- 4. Dải tóm tắt Cờ đỏ & Ban Cán sự lớp siêu gọn --- */
.qh-nn-md-officers-strip {
    background: #F8FAFC;
    border: 1px solid #CBD5E1;
    border-left: 3.5px solid #DC2626;
    border-radius: 9px;
    padding: 6px 9px;
    margin-bottom: 8px;
}

.qh-nn-md-officers-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 5px;
}

.qh-nn-md-officers-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.qh-nn-md-officers-title {
    font-size: 0.78rem;
    font-weight: 800;
    color: #991B1B;
    white-space: nowrap;
}

.qh-nn-md-cls-meta {
    font-size: 0.73rem;
    color: #334155;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 999px;
    padding: 1px 8px;
}

.qh-nn-md-officers-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.qh-nn-md-limit-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #FFFFFF;
    border: 1px solid #FECACA;
    border-radius: 7px;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #7F1D1D;
}

#qh-nenep-root .qh-nn-md-limit-pill .qh-nn-select {
    width: 44px !important;
    min-width: 44px !important;
    min-height: 22px !important;
    height: 22px !important;
    padding: 0 16px 0 5px !important;
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    border-radius: 5px !important;
}

.qh-nn-md-officers-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.qh-nn-md-officer-mini {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 7px;
    padding: 4px 7px;
    min-width: 0;
}

.qh-nn-md-officer-mini.is-codo {
    border-left: 2.5px solid #EF4444;
}

.qh-nn-md-officer-mini.is-codo.is-warn {
    border-color: #F59E0B;
    background: #FFFBEB;
}

.qh-nn-md-officer-mini.is-lt {
    border-left: 2.5px solid #3B82F6;
}

.qh-nn-md-officer-mini.is-bt {
    border-left: 2.5px solid #10B981;
}

.qh-nn-md-officer-mini-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    margin-bottom: 2px;
}

.qh-nn-md-officer-mini-top .lbl {
    font-size: 0.71rem;
    font-weight: 800;
    color: #0F2942;
    white-space: nowrap;
}

.qh-nn-md-officer-mini-top .cnt {
    font-size: 0.67rem;
    font-weight: 700;
    color: #64748B;
}

.qh-nn-md-officer-mini .empty {
    font-size: 0.7rem;
    color: #64748B;
}

.qh-nn-md-officer-line {
    font-size: 0.71rem;
    line-height: 1.35;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qh-nn-md-officer-line .nm {
    font-weight: 700;
}

.qh-nn-md-officer-line .tk {
    font-size: 0.67rem;
    color: #0F766E;
    background: #F0FDFA;
    padding: 0 4px;
    border-radius: 3px;
}

.qh-nn-md-officer-line .act {
    font-size: 0.68rem;
    font-weight: 800;
    color: #1D4ED8;
    text-decoration: none;
}

.qh-nn-md-officer-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 3px;
}

/* --- 5. Thanh lọc + Tìm kiếm + Xóa hàng loạt hợp nhất trên 1 dòng --- */
.qh-nn-md-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 4px 8px;
    margin-bottom: 7px;
}

.qh-nn-md-toolbar-left,
.qh-nn-md-toolbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
}

#qh-nenep-root .qh-nn-md-pills {
    padding: 2px;
    gap: 2px;
}

#qh-nenep-root .qh-nn-md-pills .qh-nn-pill-btn {
    min-height: 25px !important;
    padding: 2px 8px !important;
    font-size: 0.72rem !important;
    border-radius: 6px !important;
}

.qh-nn-md-count-lbl {
    font-size: 0.78rem;
    font-weight: 800;
    color: #0F2942;
    white-space: nowrap;
}

.qh-nn-md-search-wrap {
    position: relative;
    width: 175px;
}

.qh-nn-md-search-wrap i {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    color: #64748B;
    pointer-events: none;
}

#qh-nenep-root input.qh-nn-md-search {
    width: 100% !important;
    min-height: 27px !important;
    height: 27px !important;
    padding: 2px 8px 2px 24px !important;
    font-size: 0.75rem !important;
    border-radius: 6px !important;
    background: #FFFFFF !important;
}

.qh-nn-md-bulk-check {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    margin: 0;
    white-space: nowrap;
}

.qh-nn-md-bulk-check.is-muted {
    color: #64748B;
    font-weight: 600;
}

#qh-nenep-root .qh-nn-md-del-sel {
    color: #B91C1C !important;
    border-color: #FCA5A5 !important;
    background: #FFFFFF !important;
}

#qh-nenep-root .qh-nn-md-del-sel:hover {
    background: #FEF2F2 !important;
}

#qh-nenep-root .qh-nn-md-del-all {
    color: #FFFFFF !important;
    background: #DC2626 !important;
    border-color: #DC2626 !important;
}

/* --- 6. Bảng dữ liệu Giáo viên & Học sinh mật độ cao (Sticky Header) --- */
.qh-nn-md-table-viewport {
    max-height: calc(100dvh - 245px);
    min-height: 440px;
    overflow-y: auto;
    border: 1px solid #CBD5E1;
    border-radius: 10px;
}

.qh-nn-md-table-viewport.is-students {
    max-height: calc(100dvh - 330px);
    min-height: 395px;
}

#qh-nenep-root .qh-nn-md-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #0F2942 !important;
    color: #FFFFFF !important;
    padding: 7px 8px !important;
    font-size: 0.71rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

#qh-nenep-root .qh-nn-md-table tbody td {
    padding: 5px 8px !important;
    vertical-align: middle;
    border-bottom: 1px solid #EDF2F7;
}

#qh-nenep-root .qh-nn-md-table tbody tr:hover td {
    background: #F8FAFC;
}

#qh-nenep-root .qh-nn-md-table tbody tr.is-officer-row td {
    background: #FFFDF5;
}

#qh-nenep-root .qh-nn-md-table tbody tr.is-gvcn-row td:first-child {
    box-shadow: inset 3px 0 0 #10B981;
}

.qh-nn-md-name-cell {
    max-width: 185px;
}

.qh-nn-md-primary-name {
    font-weight: 800;
    font-size: 0.81rem;
    color: #0F2942;
    line-height: 1.25;
}

.qh-nn-md-sub-code {
    font-size: 0.69rem;
    color: #64748B;
    line-height: 1.25;
    margin-top: 1px;
}

.qh-nn-md-sub-code code {
    font-size: 0.68rem;
    padding: 0 4px;
    background: #F1F5F9;
    border-radius: 3px;
    color: #334155;
}

.qh-nn-md-inline-assign {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap;
}

.qh-nn-md-row-chk {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
    margin: 0;
    white-space: nowrap;
}

.qh-nn-md-row-chk input {
    width: 14px;
    height: 14px;
    accent-color: #059669;
}

#qh-nenep-root select.qh-nn-md-inline-select {
    min-height: 26px !important;
    height: 26px !important;
    padding: 2px 22px 2px 7px !important;
    font-size: 0.73rem !important;
    font-weight: 700 !important;
    border-radius: 6px !important;
    min-width: 108px;
}

.qh-nn-md-role-line {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.qh-nn-md-role-line .subj {
    font-size: 0.72rem;
    font-weight: 700;
    color: #047857;
}

.qh-nn-md-scope-sub {
    font-size: 0.7rem;
    color: #475569;
    margin-top: 1px;
    line-height: 1.25;
}

.qh-nn-md-stu-role-cell {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.qh-nn-md-stu-role-top {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
}

#qh-nenep-root .qh-nn-md-stu-role-top .qh-nn-md-inline-select {
    flex: 1;
    min-width: 145px;
    max-width: 215px;
}

.qh-nn-md-stu-cred {
    font-size: 0.69rem;
    color: #334155;
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 5px;
    padding: 1px 6px;
    line-height: 1.35;
}

.qh-nn-md-stu-cred code {
    font-weight: 800;
    color: #0F766E;
    background: transparent;
    padding: 0;
}

.qh-nn-md-stu-cred code.pw {
    color: #B91C1C;
}

.qh-nn-md-demog-cell {
    font-size: 0.74rem;
    color: #334155;
    white-space: nowrap;
}

/* --- 7. Đồng bộ mật độ cao cho Tab 6 (RBAC) & các bảng quản trị Tab 3-5 --- */
#panel-rbac .qh-nn-rbac-subtabs {
    margin-bottom: 10px;
    padding: 4px;
}

#panel-rbac .qh-nn-rbac-subtab {
    min-height: 34px;
    padding: 5px 12px;
    font-size: 0.8rem;
}

#panel-rbac .qh-nn-rbac-unified-card {
    padding: 12px 15px;
}

#panel-rbac .qh-nn-rbac-hub-header {
    padding-bottom: 10px;
    margin-bottom: 10px;
    gap: 10px;
}

#panel-rbac .qh-nn-rbac-hub-header .qh-nn-card-sub {
    display: none;
}

#panel-rbac .qh-nn-rbac-filter-bar {
    margin-bottom: 10px;
    gap: 8px;
}

#panel-rbac .qh-nn-unified-rbac-table tbody td {
    padding: 6px 10px !important;
}

#panel-lessons .qh-nn-table thead th,
#panel-attendance .qh-nn-table thead th,
#panel-thursday .qh-nn-table thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #0F2942 !important;
    color: #FFFFFF !important;
}

@media (max-width: 1180px) {
    #qh-nenep-root .qh-nn-md-split-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .qh-nn-md-table-viewport,
    .qh-nn-md-table-viewport.is-students {
        max-height: 520px;
        min-height: 320px;
    }
}

@media (max-width: 768px) {
    .qh-nn-md-form-grid-3,
    .qh-nn-md-officers-cards {
        grid-template-columns: 1fr;
    }
    .qh-nn-md-search-wrap {
        width: 100%;
    }
    #qh-nenep-root select.qh-nn-md-cls-select {
        max-width: 100%;
        flex: 1 1 100%;
    }
}

/* =========================================================================
   MILESTONE 9: TAB 8 — TRUNG TÂM NHẬT KÝ HỆ THỐNG & ĐỐI CHIẾU CDC (OPERATE MODE)
   ========================================================================= */

#qh-nenep-root .qh-nn-tab-btn.qh-nn-tab-audit {
    background: #F8FAFC;
    border-color: #94A3B8;
    color: #0F2942 !important;
}

#qh-nenep-root .qh-nn-tab-btn.qh-nn-tab-audit i {
    color: #0369A1;
}

#qh-nenep-root .qh-nn-tab-btn.qh-nn-tab-audit.is-active {
    background: #0F2942 !important;
    border-color: #0F2942 !important;
    color: #FFFFFF !important;
}

#qh-nenep-root .qh-nn-audit-main-card {
    padding: 12px 15px !important;
    border-radius: 14px;
}

.qh-nn-audit-hub-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid #E2E8F0;
}

.qh-nn-audit-title-cluster {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

#qh-nenep-root .qh-nn-audit-title {
    font-size: 1rem !important;
    font-weight: 800 !important;
    margin: 0 !important;
}

.qh-nn-audit-scope-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    background: #EFF6FF;
    border: 1px solid #93C5FD;
    color: #1E3A8A;
    font-size: 0.72rem;
    font-weight: 800;
}

.qh-nn-audit-immutable-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #ECFDF5;
    border: 1px solid #6EE7B7;
    color: #065F46;
    font-size: 0.7rem;
    font-weight: 800;
}

.qh-nn-audit-head-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

#qh-nenep-root .qh-nn-audit-date-presets {
    padding: 2px;
    gap: 2px;
}

#qh-nenep-root .qh-nn-audit-date-presets .qh-nn-pill-btn {
    min-height: 27px !important;
    padding: 3px 9px !important;
    font-size: 0.73rem !important;
    border-radius: 7px !important;
}

/* --- Dải 6 chỉ số KPI tương tác 1 dòng gọn --- */
.qh-nn-audit-kpi-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

#qh-nenep-root .qh-nn-audit-kpi-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 7px 10px;
    border-radius: 9px;
    background: #F8FAFC;
    border: 1px solid #CBD5E1;
    cursor: pointer;
    text-align: left;
    transition: transform 120ms cubic-bezier(0.23, 1, 0.32, 1), border-color 140ms ease, background-color 140ms ease;
}

#qh-nenep-root .qh-nn-audit-kpi-card:hover {
    background: #FFFFFF;
    border-color: #64748B;
}

#qh-nenep-root .qh-nn-audit-kpi-card:active {
    transform: scale(0.98);
}

#qh-nenep-root .qh-nn-audit-kpi-card.is-active {
    background: #0F2942;
    border-color: #0F2942;
    color: #FFFFFF;
}

.qh-nn-audit-kpi-card .kpi-lbl {
    font-size: 0.69rem;
    font-weight: 700;
    color: #475569;
    line-height: 1.25;
}

.qh-nn-audit-kpi-card.is-create .kpi-lbl { color: #047857; }
.qh-nn-audit-kpi-card.is-update .kpi-lbl { color: #1D4ED8; }
.qh-nn-audit-kpi-card.is-delete .kpi-lbl { color: #B91C1C; }

.qh-nn-audit-kpi-card.is-active .kpi-lbl,
.qh-nn-audit-kpi-card.is-active .kpi-val {
    color: #FFFFFF !important;
}

.qh-nn-audit-kpi-card .kpi-val {
    font-family: 'Lexend', sans-serif;
    font-size: 0.96rem;
    font-weight: 800;
    color: #0F172A;
    margin-top: 2px;
    line-height: 1.2;
}

/* --- Thanh lọc đa chiều 2 tầng gọn --- */
.qh-nn-audit-filter-box {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 7px 10px;
    margin-bottom: 9px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.qh-nn-audit-filter-row1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.qh-nn-audit-op-pills {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

#qh-nenep-root .qh-nn-audit-op-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 26px;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid #CBD5E1;
    background: #FFFFFF;
    color: #334155 !important;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease, transform 100ms ease;
}

#qh-nenep-root .qh-nn-audit-op-pill:hover {
    background: #F1F5F9;
    border-color: #94A3B8;
}

#qh-nenep-root .qh-nn-audit-op-pill.is-active {
    background: #0F2942 !important;
    border-color: #0F2942 !important;
    color: #FFFFFF !important;
}

.qh-nn-audit-diff-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.73rem;
    font-weight: 700;
    color: #0F766E;
    background: #F0FDFA;
    border: 1px solid #99F6E4;
    border-radius: 999px;
    padding: 2px 10px;
    cursor: pointer;
    margin: 0;
}

.qh-nn-audit-filter-row2 {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

#qh-nenep-root select.qh-nn-audit-sel {
    min-height: 30px !important;
    height: 30px !important;
    padding: 2px 24px 2px 8px !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    border-radius: 7px !important;
    max-width: 195px;
}

.qh-nn-audit-date-range {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: #64748B;
}

#qh-nenep-root input.qh-nn-audit-date {
    min-height: 30px !important;
    height: 30px !important;
    padding: 2px 6px !important;
    font-size: 0.74rem !important;
    border-radius: 7px !important;
    width: 124px;
}

.qh-nn-audit-search-wrap {
    position: relative;
    flex: 1;
    min-width: 190px;
}

.qh-nn-audit-search-wrap i {
    position: absolute;
    left: 9px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.72rem;
    color: #64748B;
    pointer-events: none;
}

#qh-nenep-root input.qh-nn-audit-search {
    width: 100% !important;
    min-height: 30px !important;
    height: 30px !important;
    padding: 2px 9px 2px 26px !important;
    font-size: 0.76rem !important;
    border-radius: 7px !important;
}

/* --- Bảng Nhật ký mật độ cao (Sticky Header) --- */
.qh-nn-audit-table-viewport {
    max-height: calc(100dvh - 305px);
    min-height: 430px;
    overflow-y: auto;
    border: 1px solid #CBD5E1;
    border-radius: 10px;
}

#qh-nenep-root .qh-nn-audit-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #0F2942 !important;
    color: #FFFFFF !important;
    padding: 7px 9px !important;
    font-size: 0.71rem !important;
    font-weight: 800 !important;
    white-space: nowrap;
}

#qh-nenep-root .qh-nn-audit-table tbody td {
    padding: 6px 9px !important;
    vertical-align: middle;
    border-bottom: 1px solid #EDF2F7;
}

#qh-nenep-root .qh-nn-audit-table tbody tr:hover td {
    background: #F8FAFC;
}

.qh-nn-audit-table .aud-dt {
    font-size: 0.74rem;
    font-weight: 700;
    color: #0F172A;
    white-space: nowrap;
}

.qh-nn-audit-table .aud-id {
    font-size: 0.67rem;
    color: #64748B;
}

.qh-nn-audit-table .aud-actor-name {
    font-size: 0.8rem;
    font-weight: 800;
    color: #0F2942;
    line-height: 1.25;
}

.qh-nn-audit-table .aud-actor-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.qh-nn-audit-table .aud-uname {
    font-size: 0.67rem;
    color: #0369A1;
    background: #F0F9FF;
    padding: 0 4px;
    border-radius: 3px;
}

.qh-nn-audit-op-tag {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 0.67rem;
    font-weight: 800;
    white-space: nowrap;
}

.qh-nn-audit-op-tag.op-create { background: #DCFCE7; color: #065F46; border: 1px solid #86EFAC; }
.qh-nn-audit-op-tag.op-update { background: #DBEAFE; color: #1E40AF; border: 1px solid #93C5FD; }
.qh-nn-audit-op-tag.op-delete { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; }
.qh-nn-audit-op-tag.op-import { background: #FEF3C7; color: #92400E; border: 1px solid #FCD34D; }
.qh-nn-audit-op-tag.op-lock   { background: #E0E7FF; color: #3730A3; border: 1px solid #A5B4FC; }
.qh-nn-audit-op-tag.op-export { background: #F0FDFA; color: #0F766E; border: 1px solid #99F6E4; }
.qh-nn-audit-op-tag.op-auth   { background: #F1F5F9; color: #334155; border: 1px solid #CBD5E1; }

.qh-nn-audit-table .aud-mod-lbl {
    font-size: 0.69rem;
    color: #475569;
    margin-top: 2px;
}

.qh-nn-audit-cls-chip {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 6px;
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    color: #1E3A8A;
    font-size: 0.72rem;
    font-weight: 800;
}

.qh-nn-audit-cls-all {
    font-size: 0.69rem;
    color: #64748B;
}

.qh-nn-audit-table .aud-desc-main {
    font-size: 0.79rem;
    font-weight: 600;
    color: #1E293B;
    line-height: 1.35;
}

.qh-nn-audit-table .aud-code-sub {
    margin-top: 2px;
}

.qh-nn-audit-table .aud-code-sub code {
    font-size: 0.66rem;
    color: #64748B;
    background: #F1F5F9;
    padding: 0 5px;
    border-radius: 3px;
}

.qh-nn-audit-table .aud-dev {
    font-size: 0.71rem;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
}

.qh-nn-audit-table .aud-ip {
    font-size: 0.68rem;
    color: #64748B;
}

.qh-nn-audit-empty {
    text-align: center !important;
    padding: 28px 16px !important;
    color: #64748B;
    font-size: 0.84rem;
}

.qh-nn-audit-empty.is-err {
    color: #B91C1C;
    background: #FEF2F2;
}

/* --- Thanh phân trang gọn --- */
.qh-nn-audit-pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
    padding-top: 6px;
}

.qh-nn-audit-page-info {
    font-size: 0.75rem;
    color: #475569;
}

.qh-nn-audit-page-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

#qh-nenep-root select.qh-nn-audit-perpage {
    min-height: 26px !important;
    height: 26px !important;
    padding: 1px 22px 1px 8px !important;
    font-size: 0.73rem !important;
    border-radius: 6px !important;
}

.qh-nn-audit-page-btns {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.aud-pg-dots {
    font-size: 0.75rem;
    color: #64748B;
    padding: 0 3px;
}

/* --- Modal Đối Chiếu Trước & Sau (CDC Diff Inspector) --- */
#qh-nenep-root .qh-nn-audit-diff-modal-box {
    max-width: 960px !important;
    width: 95vw !important;
    max-height: 90dvh !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 16px;
}

.qh-nn-audit-diff-head {
    background: linear-gradient(135deg, #0B1F3A 0%, #16325C 100%) !important;
    color: #FFFFFF !important;
    padding: 12px 18px !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.qh-nn-audit-diff-eyebrow {
    font-size: 0.69rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #6EE7B7;
    text-transform: uppercase;
}

#qh-nenep-root .qh-nn-audit-diff-title {
    font-size: 0.98rem !important;
    font-weight: 800 !important;
    color: #FFFFFF !important;
    margin: 2px 0 0 0 !important;
    line-height: 1.35;
}

.qh-nn-audit-diff-body {
    padding: 14px 18px !important;
    overflow-y: auto;
    flex: 1;
}

.qh-nn-audit-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
}

.qh-nn-audit-meta-grid .meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.79rem;
    color: #0F172A;
}

.qh-nn-audit-meta-grid .meta-item .lbl {
    font-size: 0.69rem;
    font-weight: 700;
    color: #64748B;
    text-transform: uppercase;
}

.qh-nn-audit-diff-section {
    border: 1px solid #CBD5E1;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.qh-nn-audit-diff-sec-head {
    background: #F1F5F9;
    padding: 7px 12px;
    font-size: 0.8rem;
    color: #0F2942;
    border-bottom: 1px solid #CBD5E1;
}

#qh-nenep-root .qh-nn-audit-diff-table thead th {
    background: #1E293B !important;
    color: #FFFFFF !important;
    padding: 7px 10px !important;
    font-size: 0.72rem !important;
}

#qh-nenep-root .qh-nn-audit-diff-table tbody td {
    padding: 6px 10px !important;
    font-size: 0.78rem;
    vertical-align: top;
}

#qh-nenep-root .qh-nn-audit-diff-table tr.is-diff-changed td.diff-col-field {
    background: #FFFBEB;
    box-shadow: inset 3px 0 0 #F59E0B;
}

#qh-nenep-root .qh-nn-audit-diff-table tr.is-diff-changed td.diff-col-before {
    background: #FEF2F2;
    color: #991B1B;
}

#qh-nenep-root .qh-nn-audit-diff-table tr.is-diff-changed td.diff-col-after {
    background: #ECFDF5;
    color: #065F46;
    font-weight: 700;
}

.diff-key-code code {
    font-size: 0.66rem;
    color: #64748B;
}

.aud-val-empty {
    font-style: italic;
    color: #94A3B8;
    font-size: 0.74rem;
}

.aud-val-json,
.qh-nn-audit-json-pre {
    margin: 0;
    padding: 8px 10px;
    background: #0F172A;
    color: #E2E8F0;
    border-radius: 7px;
    font-size: 0.73rem;
    line-height: 1.45;
    max-height: 240px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.qh-nn-audit-payload-details {
    border: 1px solid #CBD5E1;
    border-radius: 9px;
    padding: 8px 12px;
    background: #F8FAFC;
}

.qh-nn-audit-payload-details summary {
    cursor: pointer;
    font-size: 0.79rem;
    font-weight: 700;
    color: #0F2942;
}

.qh-nn-audit-payload-details[open] summary {
    margin-bottom: 8px;
}

@media (max-width: 1100px) {
    .qh-nn-audit-kpi-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .qh-nn-audit-kpi-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .qh-nn-audit-meta-grid {
        grid-template-columns: 1fr;
    }
    #qh-nenep-root select.qh-nn-audit-sel {
        max-width: 100%;
        flex: 1 1 48%;
    }
}

/* ==========================================================================
   PHÂN HỆ NHẬP ĐIỂM HỌC TẬP THEO TUẦN (24 LỚP) & THIẾT LẬP GIỜ CHỐT TUẦN
   ========================================================================== */
#qh-nenep-root .qh-nn-btn-lesson-quick {
    border-color: #BFDBFE;
    background: #EFF6FF;
    color: #1E3A8A;
    font-weight: 700;
}
#qh-nenep-root .qh-nn-btn-lesson-quick:hover {
    background: #DBEAFE;
    border-color: #93C5FD;
}
#qh-nenep-root .qh-nn-btn-cutoff-cfg {
    border-color: #CBD5E1;
    background: #F8FAFC;
    color: #0F2942;
    font-weight: 700;
}
#qh-nenep-root .qh-nn-btn-cutoff-cfg:hover {
    background: #E2E8F0;
    border-color: #94A3B8;
}

#qh-nenep-root .qh-nn-inline-les-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 5px;
    padding: 2px 6px;
    border-radius: 5px;
    border: 1px solid #BFDBFE;
    background: #EFF6FF;
    color: #1D4ED8;
    font-size: 0.69rem;
    font-weight: 700;
    line-height: 1.3;
    cursor: pointer;
    vertical-align: middle;
    transition: background 0.15s ease, border-color 0.15s ease;
}
#qh-nenep-root .qh-nn-inline-les-btn:hover {
    background: #DBEAFE;
    border-color: #60A5FA;
    color: #1E3A8A;
}

#qh-nenep-root .qh-nn-lesson-modebar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 8px 12px;
    margin-bottom: 14px;
}
#qh-nenep-root .qh-nn-lesson-mode-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
#qh-nenep-root .qh-nn-lesson-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    background: #F8FAFC;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}
#qh-nenep-root .qh-nn-lesson-mode-btn.is-active {
    background: #0F2942;
    border-color: #0F2942;
    color: #FFFFFF;
}
#qh-nenep-root .qh-nn-lesson-mode-meta {
    font-size: 0.79rem;
    color: #475569;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    padding: 5px 10px;
    border-radius: 999px;
}

#qh-nenep-root .qh-nn-les-sum-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}
#qh-nenep-root .qh-nn-les-sum-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 14px;
    margin-bottom: 12px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
}
#qh-nenep-root .qh-nn-les-sum-filters,
#qh-nenep-root .qh-nn-les-sum-quickfill {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
#qh-nenep-root .qh-nn-les-sum-quickfill label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #334155;
    margin: 0;
}
#qh-nenep-root .qh-nn-grade-def-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #334155;
    white-space: nowrap;
}
#qh-nenep-root .qh-nn-grade-def-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
#qh-nenep-root .qh-nn-grade-def-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 4px 3px 9px;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
    cursor: pointer;
}
#qh-nenep-root .qh-nn-grade-def-item span {
    font-size: 0.78rem;
    font-weight: 700;
    color: #0F2942;
    white-space: nowrap;
}
#qh-nenep-root .qh-nn-grade-def-item.is-grade-focused {
    background: #EFF6FF;
    border-color: #3B82F6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.14);
}
#qh-nenep-root .qh-nn-grade-def-item input.qh-nn-input {
    width: 56px !important;
    min-height: 30px !important;
    height: 30px !important;
    padding: 2px 4px !important;
    text-align: center;
    font-weight: 800;
    font-size: 0.85rem;
    border-radius: 6px;
    border: 1px solid #CBD5E1;
    background: #F8FAFC;
    color: #0F2942;
}
#qh-nenep-root .qh-nn-grade-def-item input.qh-nn-input:focus {
    background: #FFFFFF;
    border-color: #0F2942;
}

#qh-nenep-root .qh-nn-lesson-sum-table th small {
    font-weight: 600;
    color: #64748B;
    font-size: 0.68rem;
}
#qh-nenep-root .qh-les-sum-inp {
    width: 74px !important;
    min-height: 36px;
    padding: 4px 6px !important;
    text-align: center;
    font-weight: 800;
    font-size: 0.88rem;
    border-radius: 8px;
}
#qh-nenep-root .qh-les-sum-inp.is-tot {
    border-color: #A7F3D0;
    background: #F0FDF4;
    color: #065F46;
}
#qh-nenep-root .qh-les-sum-inp.is-kha {
    border-color: #BFDBFE;
    background: #EFF6FF;
    color: #1E3A8A;
}
#qh-nenep-root .qh-les-sum-inp.is-tb {
    border-color: #FDE68A;
    background: #FFFBEB;
    color: #92400E;
}
#qh-nenep-root .qh-les-sum-inp.is-yeu {
    border-color: #FECACA;
    background: #FEF2F2;
    color: #991B1B;
}
#qh-nenep-root .qh-les-sum-note {
    width: 100%;
    min-width: 140px;
    min-height: 36px;
    padding: 5px 9px !important;
    font-size: 0.81rem;
}
#qh-nenep-root .qh-nn-les-ded-active {
    color: #DC2626;
    font-weight: 800;
}
#qh-nenep-root .qh-nn-les-score-val {
    color: #047857;
    font-size: 0.92rem;
    font-weight: 800;
}
#qh-nenep-root .qh-nn-les-score-val.is-deducted {
    color: #B45309;
}

#qh-nenep-root .qh-nn-quick-les-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
#qh-nenep-root .qh-nn-quick-les-box {
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #E2E8F0;
    background: #F8FAFC;
    text-align: center;
}
#qh-nenep-root .qh-nn-quick-les-box label {
    display: block;
    font-size: 0.76rem;
    font-weight: 800;
    margin-bottom: 6px;
}
#qh-nenep-root .qh-nn-quick-les-box input {
    width: 100%;
    text-align: center;
    font-weight: 800;
    font-size: 1rem;
}
#qh-nenep-root .qh-nn-quick-les-box.is-tot { background: #F0FDF4; border-color: #A7F3D0; color: #065F46; }
#qh-nenep-root .qh-nn-quick-les-box.is-kha { background: #EFF6FF; border-color: #BFDBFE; color: #1E3A8A; }
#qh-nenep-root .qh-nn-quick-les-box.is-tb  { background: #FFFBEB; border-color: #FDE68A; color: #92400E; }
#qh-nenep-root .qh-nn-quick-les-box.is-yeu { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }

#qh-nenep-root .qh-nn-cutoff-summary-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #EFF6FF 0%, #F8FAFC 100%);
    border: 1px solid #BFDBFE;
    border-radius: 12px;
}
#qh-nenep-root .qh-nn-cutoff-summary-main {
    display: flex;
    align-items: center;
    gap: 12px;
}
#qh-nenep-root .qh-nn-cutoff-summary-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #0F2942;
    color: #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
#qh-nenep-root .qh-nn-cutoff-summary-title {
    font-size: 0.9rem;
    color: #0F2942;
    font-weight: 700;
}
#qh-nenep-root .qh-nn-cutoff-summary-sub {
    font-size: 0.8rem;
    color: #475569;
    margin-top: 2px;
}

@media (max-width: 640px) {
    #qh-nenep-root .qh-nn-quick-les-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ==========================================================================
   KHKT 2026–2027 UPGRADES (v4.6.0):
   1. Interactive SVG Multi-Week Trend Analytics & Pedagogical Early Warning
   2. Thông tư 22/2021/TT-BGDĐT Conduct Evaluation Panel
   3. Hardened Mobile Cờ Đỏ Live Network / Offline Queue Pill
   ========================================================================== */

#qh-nenep-root .qh-nn-analytics-deck {
    margin-bottom: 16px;
    padding: 16px 18px;
    border: 1px solid #CBD5E1;
    border-radius: 14px;
    background: #FFFFFF;
}

#qh-nenep-root .qh-nn-analytics-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

#qh-nenep-root .qh-nn-analytics-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

#qh-nenep-root .qh-nn-analytics-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #0F2942;
    color: #F8FAFC;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#qh-nenep-root .qh-nn-analytics-title {
    margin: 0 !important;
    font-size: 1rem !important;
    font-weight: 800 !important;
    color: #0F172A !important;
    line-height: 1.25 !important;
}

#qh-nenep-root .qh-nn-analytics-sub {
    margin: 2px 0 0 !important;
    font-size: 0.8rem !important;
    color: #475569 !important;
    line-height: 1.35 !important;
}

#qh-nenep-root .qh-nn-analytics-head-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

#qh-nenep-root .qh-nn-analytics-delta-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 11px;
    border-radius: 999px;
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    color: #065F46;
    font-size: 0.79rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

#qh-nenep-root .qh-nn-analytics-body {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 1fr);
    gap: 16px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #E2E8F0;
}

#qh-nenep-root .qh-nn-analytics-body.is-single-col {
    grid-template-columns: minmax(0, 1fr);
}

#qh-nenep-root .qh-nn-analytics-chart-col {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#qh-nenep-root .qh-nn-svg-readout-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px 12px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    font-size: 0.81rem;
    color: #1E293B;
}

#qh-nenep-root .qh-nn-svg-readout-bar .readout-ver {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    background: #E2E8F0;
    color: #334155;
    font-size: 0.72rem;
    font-weight: 700;
}

#qh-nenep-root .qh-nn-svg-readout-bar .readout-metrics {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-variant-numeric: tabular-nums;
}

#qh-nenep-root .qh-nn-svg-readout-bar .readout-diff.is-up {
    color: #047857;
    font-weight: 700;
}

#qh-nenep-root .qh-nn-svg-readout-bar .readout-diff.is-down {
    color: #B91C1C;
    font-weight: 700;
}

#qh-nenep-root .qh-nn-svg-readout-bar .txt-danger {
    color: #DC2626;
}

#qh-nenep-root .qh-nn-svg-readout-bar .txt-ok {
    color: #047857;
}

#qh-nenep-root .qh-nn-svg-chart-wrap {
    padding: 8px 6px 2px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
}

#qh-nenep-root .qh-nn-svg-chart-wrap .svg-week-col:hover .svg-guide-line,
#qh-nenep-root .qh-nn-svg-chart-wrap .svg-week-col.is-active .svg-guide-line {
    opacity: 0.42 !important;
}

#qh-nenep-root .qh-nn-svg-chart-wrap .svg-week-col:hover .svg-main-dot,
#qh-nenep-root .qh-nn-svg-chart-wrap .svg-week-col.is-active .svg-main-dot {
    r: 6px;
    fill: #1D4ED8;
}

#qh-nenep-root .qh-nn-svg-legend {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 0.77rem;
    color: #475569;
}

#qh-nenep-root .qh-nn-svg-legend .legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#qh-nenep-root .qh-nn-svg-legend .legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    display: inline-block;
}

#qh-nenep-root .qh-nn-svg-legend .legend-dot.is-final { background: #0F2942; }
#qh-nenep-root .qh-nn-svg-legend .legend-dot.is-hoctap { background: #059669; }
#qh-nenep-root .qh-nn-svg-legend .legend-dot.is-nenep { background: #D97706; }

#qh-nenep-root .qh-nn-svg-legend .legend-bar.is-below {
    width: 11px;
    height: 9px;
    border-radius: 2px;
    background: #FCA5A5;
    display: inline-block;
}

#qh-nenep-root .qh-nn-cat-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

#qh-nenep-root .qh-nn-cat-pill {
    padding: 8px 10px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 9px;
}

#qh-nenep-root .qh-nn-cat-pill .cat-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 6px;
    font-size: 0.75rem;
    margin-bottom: 5px;
}

#qh-nenep-root .qh-nn-cat-pill .cat-lbl {
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#qh-nenep-root .qh-nn-cat-pill .cat-val {
    color: #0F172A;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

#qh-nenep-root .qh-nn-cat-pill .cat-val.is-bonus {
    color: #047857;
}

#qh-nenep-root .qh-nn-cat-pill .cat-bar-track {
    height: 5px;
    background: #E2E8F0;
    border-radius: 999px;
    overflow: hidden;
}

#qh-nenep-root .qh-nn-cat-pill .cat-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: #0F2942;
}

#qh-nenep-root .qh-nn-cat-pill .cat-bar-fill.cat-chuyen_can { background: #2563EB; }
#qh-nenep-root .qh-nn-cat-pill .cat-bar-fill.cat-dinh_luong { background: #D97706; }
#qh-nenep-root .qh-nn-cat-pill .cat-bar-fill.cat-ve_sinh { background: #64748B; }
#qh-nenep-root .qh-nn-cat-pill .cat-bar-fill.is-bonus { background: #059669; }

/* Early Warning Pedagogical Column */
#qh-nenep-root .qh-nn-ew-col {
    display: flex;
    flex-direction: column;
    background: #F8FAFC;
    border: 1px solid #CBD5E1;
    border-radius: 12px;
    padding: 12px 14px;
    min-width: 0;
}

#qh-nenep-root .qh-nn-ew-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

#qh-nenep-root .qh-nn-ew-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: #0F172A;
}

#qh-nenep-root .qh-nn-ew-desc {
    margin: 3px 0 8px !important;
    font-size: 0.76rem !important;
    color: #475569 !important;
    line-height: 1.35 !important;
}

#qh-nenep-root .qh-nn-ew-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

#qh-nenep-root .qh-nn-ew-filter-pill {
    border: 1px solid #CBD5E1;
    background: #FFFFFF;
    color: #334155;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    min-height: 32px;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

#qh-nenep-root .qh-nn-ew-filter-pill:active {
    transform: scale(0.97);
}

#qh-nenep-root .qh-nn-ew-filter-pill.is-active {
    background: #0F2942;
    border-color: #0F2942;
    color: #FFFFFF;
}

#qh-nenep-root .qh-nn-ew-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    max-height: 255px;
    overflow-y: auto;
    padding-right: 2px;
    flex: 1;
}

#qh-nenep-root .qh-nn-ew-item {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 9px;
    padding: 8px 10px;
}

#qh-nenep-root .qh-nn-ew-item .ew-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

#qh-nenep-root .qh-nn-ew-item .ew-stu-name {
    font-size: 0.83rem;
    color: #0F172A;
}

#qh-nenep-root .qh-nn-ew-item .ew-cls-tag {
    font-size: 0.75rem;
    font-weight: 700;
    color: #1D4ED8;
}

#qh-nenep-root .qh-nn-ew-item .ew-item-metrics {
    font-size: 0.75rem;
    color: #475569;
    margin-top: 3px;
    font-variant-numeric: tabular-nums;
}

#qh-nenep-root .qh-nn-ew-item .ew-item-action {
    font-size: 0.74rem;
    color: #334155;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed #E2E8F0;
    line-height: 1.35;
}

#qh-nenep-root .qh-nn-ew-empty {
    padding: 18px 12px;
    text-align: center;
    font-size: 0.8rem;
    color: #64748B;
}

#qh-nenep-root .qh-nn-ew-foot {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #E2E8F0;
}

/* Thông tư 22 Conduct Panel */
#qh-nenep-root .qh-nn-tt22-kpi-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

#qh-nenep-root .qh-nn-tt22-pill {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 9px 12px;
    background: #F8FAFC;
    border: 1px solid #CBD5E1;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    min-height: 52px;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

#qh-nenep-root button.qh-nn-tt22-pill:active {
    transform: scale(0.98);
}

#qh-nenep-root .qh-nn-tt22-pill .pill-lbl {
    font-size: 0.74rem;
    font-weight: 600;
    color: #475569;
}

#qh-nenep-root .qh-nn-tt22-pill .pill-val {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0F172A;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}

#qh-nenep-root .qh-nn-tt22-pill.is-active {
    background: #0F2942;
    border-color: #0F2942;
}

#qh-nenep-root .qh-nn-tt22-pill.is-active .pill-lbl,
#qh-nenep-root .qh-nn-tt22-pill.is-active .pill-val {
    color: #FFFFFF !important;
}

#qh-nenep-root .qh-nn-tt22-pill.level-tot .pill-val { color: #047857; }
#qh-nenep-root .qh-nn-tt22-pill.level-kha .pill-val { color: #1D4ED8; }
#qh-nenep-root .qh-nn-tt22-pill.level-dat .pill-val { color: #B45309; }
#qh-nenep-root .qh-nn-tt22-pill.level-chuadat .pill-val { color: #DC2626; }
#qh-nenep-root .qh-nn-tt22-pill.level-exempt {
    cursor: default;
    background: #ECFDF5;
    border-color: #A7F3D0;
}
#qh-nenep-root .qh-nn-tt22-pill.level-exempt .pill-val { color: #065F46; }

#qh-nenep-root .qh-nn-tt22-footer-meta {
    margin-top: 10px;
    font-size: 0.8rem;
    color: #475569;
    text-align: right;
}

/* Mobile Cờ Đỏ Live Network / Offline Queue Pill */
#qh-nenep-root .qh-nn-codo-net-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 800;
    margin-left: 6px;
    cursor: pointer;
    font-variant-numeric: tabular-nums;
}

#qh-nenep-root .qh-nn-codo-net-pill.is-online {
    background: rgba(16, 185, 129, 0.24);
    border: 1px solid rgba(110, 231, 183, 0.5);
    color: #ECFDF5;
}

#qh-nenep-root .qh-nn-codo-net-pill.is-offline {
    background: #FEF2F2;
    border: 1px solid #FCA5A5;
    color: #991B1B;
}

#qh-nenep-root .qh-nn-codo-net-pill.is-pending {
    background: #FEF3C7;
    border: 1px solid #F59E0B;
    color: #92400E;
}

@media (max-width: 1024px) {
    #qh-nenep-root .qh-nn-analytics-body {
        grid-template-columns: minmax(0, 1fr);
    }
    #qh-nenep-root .qh-nn-cat-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    #qh-nenep-root .qh-nn-tt22-kpi-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    #qh-nenep-root .qh-nn-tt22-kpi-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    #qh-nenep-root #qhTt22SearchInput,
    #qh-nenep-root #qhTt22ClassSelect {
        font-size: 16px;
        min-height: 44px;
    }
}

@media print {
    #qh-nenep-root .qh-nn-analytics-deck,
    #qh-nenep-root .qh-nn-tt22-card,
    #qh-nenep-root .qh-nn-codo-net-pill {
        display: none !important;
    }
}
