/* HMU IRB - giao dien chung (lay tu QLGN) + phan rieng IRB o cuoi file */
:root {
    --qg-pri: #0B4F6C; --qg-pri-2: #12709A; --qg-acc: #F2B705;
    --qg-bg: #F3F5F8; --qg-card: #FFFFFF; --qg-line: #E3E7ED; --qg-text: #1E2A38; --qg-muted: #667385;
    --qg-ok: #1E8E3E; --qg-warn: #E37400; --qg-bad: #C5221F;
    --qg-top-h: 56px; --qg-side-w: 252px; --qg-tab-h: 62px; --qg-nav-h: 0px; /* menu da nam trong header nen = 0 */
    /* Do cao phan dinh tren cung (header + menu ngang desktop): dung cho cac khoi sticky */
    --qg-stick: calc(var(--qg-top-h) + var(--qg-nav-h));
}
html, body { background: var(--qg-bg); color: var(--qg-text); }
body { font-family: "Segoe UI", Roboto, Arial, sans-serif; font-size: 14.5px; }
a { color: var(--qg-pri-2); }

/* ---- Top bar ---- */
.qg-top { position: sticky; top: 0; z-index: 1030; height: var(--qg-top-h); display: flex; align-items: center; gap: 10px;
    padding: 0 14px; background: var(--qg-pri); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.qg-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.qg-logo { width: 34px; height: 34px; border-radius: 9px; background: var(--qg-acc); color: #3a2a00; display: grid; place-items: center; font-size: 1.15rem; flex: none; }
.qg-brand-t { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.qg-brand-t b { font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qg-brand-tr { font-weight: 600; }
.qg-brand-t small { font-size: .78rem; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.qg-top-r { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.qg-selso { width: 230px; background-color: rgba(255,255,255,.95); }
.qg-ico, .qg-user, .qg-burger { border: 0; background: transparent; color: #fff; height: 38px; min-width: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; position: relative; padding: 0 8px; }
.qg-ico:hover, .qg-user:hover, .qg-burger:hover { background: rgba(255,255,255,.14); }
.qg-ico i, .qg-user i, .qg-burger i { font-size: 1.25rem; }
a.qg-ico { text-decoration: none; }
.qg-ico.active { background: rgba(255,255,255,.22); box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
.qg-badge { position: absolute; top: 3px; right: 2px; background: var(--qg-bad); color: #fff; font-size: 10px; font-weight: 700; border-radius: 9px; padding: 1px 5px; }

/* ---- Shell ---- */
.qg-shell { display: flex; min-height: calc(100vh - var(--qg-top-h)); }
.qg-side { width: var(--qg-side-w); flex: none; background: #fff; border-right: 1px solid var(--qg-line); padding: 10px 8px 30px;
    position: sticky; top: var(--qg-top-h); height: calc(100vh - var(--qg-top-h)); overflow-y: auto; }
.qg-side-grp { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--qg-muted); font-weight: 700; padding: 14px 12px 6px; }
.qg-side a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 9px; color: var(--qg-text); text-decoration: none; font-weight: 500; }
.qg-side a i { font-size: 1.05rem; color: var(--qg-muted); width: 20px; text-align: center; }
.qg-side a:hover { background: #EEF3FA; }
.qg-side a.active { background: #E3EDF9; color: var(--qg-pri); font-weight: 650; }
.qg-side a.active i { color: var(--qg-pri); }
.qg-side-bg { display: none; }
/* Khoi nhom menu: moi nhom mot mau nen / mau nhan */
.qg-side-sec { --sec-bg: #F4F7FB; --sec-line: #E2E9F2; --sec-ink: #5B6B80;
    background: var(--sec-bg); border: 1px solid var(--sec-line); border-radius: 12px; padding: 2px 4px 5px; margin-bottom: 10px; }
.qg-side-sec .qg-side-grp { display: flex; align-items: center; gap: 7px; padding: 9px 9px 6px; color: var(--sec-ink); }
.qg-side-sec .qg-side-grp::before { content: ""; flex: none; width: 4px; height: 13px; border-radius: 2px; background: var(--sec-ink); }
.qg-side-sec a:hover { background: rgba(255,255,255,.8); }
.qg-side-sec a.active { background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.10), inset 3px 0 0 var(--sec-ink); }
.qg-side-sec.g-tq { --sec-bg: #F1F6FD; --sec-line: #D6E4F5; --sec-ink: #0E4D92; }
.qg-side-sec.g-kh { --sec-bg: #FFF8E6; --sec-line: #F3DFA8; --sec-ink: #8A5A00; }
.qg-side-sec.g-dm { --sec-bg: #EEF8F1; --sec-line: #CDE9D6; --sec-ink: #1D6B34; }
.qg-side-sec.g-ti { --sec-bg: #F5F2FB; --sec-line: #E0D8F0; --sec-ink: #5B3B99; }
.qg-side-sec.g-qt { --sec-bg: #FDF1F0; --sec-line: #F3D3CF; --sec-ink: #A5281B; }
/* So buoc nhap lieu trong vong tron (menu nhom Ke hoach & giai ngan) */
.qg-step { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--qg-pri); color: #fff; font-size: .78rem; font-weight: 800;
    display: inline-grid; place-items: center; line-height: 1; margin: 0 -1px; box-shadow: 0 0 0 2px #E3EDF9; }
.qg-side a.active .qg-step { background: var(--qg-acc); color: #3a2a00; box-shadow: 0 0 0 2px #fff; }
html.side-min .qg-side .qg-step { width: 26px; height: 26px; font-size: .9rem; }
.qg-has-step { position: relative; }
.qg-step-mini { position: absolute; top: -5px; right: -5px; width: 19px; height: 19px; border-radius: 50%; background: var(--qg-pri); color: #fff;
    font: 800 .7rem/19px "Segoe UI", Roboto, Arial, sans-serif; text-align: center; box-shadow: 0 0 0 2px #fff; }
.qg-side { transition: width .18s ease; }
/* Nut thu gon / mo rong menu: noi bat */
.qg-side-tg { display: flex; align-items: center; justify-content: center; margin: 0 0 6px auto; width: 34px; height: 34px; border: 0; border-radius: 50%;
    background: linear-gradient(135deg, var(--qg-pri-2), var(--qg-pri)); color: #fff; font-size: 1rem;
    box-shadow: 0 3px 10px rgba(14,77,146,.38), 0 0 0 3px #E3EDF9; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.qg-side-tg i { -webkit-text-stroke: 1px currentColor; transition: transform .18s ease; }
.qg-side-tg:hover { transform: scale(1.1); box-shadow: 0 5px 14px rgba(14,77,146,.48), 0 0 0 4px #CFE0F5; }
.qg-side-tg:active { transform: scale(.95); }
.qg-side-tg:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(242,169,0,.55); }
/* Khi da thu gon: mau vang nhan de de thay cho mo lai */
html.side-min .qg-side .qg-side-tg { background: linear-gradient(135deg, #FFC533, var(--qg-acc)); color: #3a2a00; box-shadow: 0 3px 10px rgba(242,169,0,.45), 0 0 0 3px #FFF3D6; }
html.side-min .qg-side .qg-side-tg:hover { box-shadow: 0 5px 14px rgba(242,169,0,.6), 0 0 0 4px #FFE7A8; }
/* Nhap nhay nhe cho den lan bam dau tien */
.qg-side-tg.hint { animation: qg-tg-pulse 1.8s ease-out infinite; }
@keyframes qg-tg-pulse {
    0% { box-shadow: 0 3px 10px rgba(14,77,146,.38), 0 0 0 0 rgba(21,101,192,.55); }
    70% { box-shadow: 0 3px 10px rgba(14,77,146,.38), 0 0 0 12px rgba(21,101,192,0); }
    100% { box-shadow: 0 3px 10px rgba(14,77,146,.38), 0 0 0 0 rgba(21,101,192,0); }
}
@media (prefers-reduced-motion: reduce) { .qg-side-tg.hint { animation: none; } }
.qg-grp-ic { display: none; }
/* ---- Desktop: menu nam ngang ngay tren header (moi nhom = menu xo xuong; nhom 1 muc / "Hồ sơ" hien thang) ---- */
@media (min-width: 992px) {
    .qg-top .qg-side { position: static; width: auto; height: 100%; flex: 1 1 auto; min-width: 0; overflow: visible; display: flex; align-items: stretch; gap: 2px;
        padding: 0 0 0 14px; margin-left: 6px; background: none; border: 0; border-left: 1px solid rgba(255,255,255,.18); box-shadow: none; transition: none; }
    .qg-side-sec { position: relative; display: flex; align-items: center; gap: 2px; background: none; border: 0; border-radius: 0; padding: 0; margin: 0; }
    .qg-side-sec.ve-phai { margin-left: auto; }
    .qg-side-sec .qg-side-grp::before { display: none; }
    .qg-side a { white-space: nowrap; padding: 7px 11px; }
    /* Muc nam tren header (nen xanh dam) */
    .qg-side-sec.mo-thang > .qg-side-grp { display: none; }
    .qg-side-sec.mo-thang > .qg-side-dd { display: flex; gap: 2px; }
    .qg-side-sec.mo-thang > .qg-side-dd > a, .qg-side-sec:not(.mo-thang) > .qg-side-grp { color: rgba(255,255,255,.9); }
    .qg-side-sec.mo-thang > .qg-side-dd > a i, .qg-side-grp .qg-grp-ic { color: rgba(255,255,255,.72); }
    .qg-side-sec.mo-thang > .qg-side-dd > a:hover, .qg-side-sec:not(.mo-thang):hover > .qg-side-grp, .qg-side-sec.open > .qg-side-grp { background: rgba(255,255,255,.13); color: #fff; }
    .qg-side-sec.mo-thang > .qg-side-dd > a.active, .qg-side-sec.co-active > .qg-side-grp { background: rgba(255,255,255,.18); color: #fff; font-weight: 650;
        box-shadow: inset 0 -3px 0 var(--qg-acc); border-radius: 9px 9px 0 0; }
    .qg-side-sec.mo-thang > .qg-side-dd > a.active i, .qg-side-sec.co-active > .qg-side-grp .qg-grp-ic { color: var(--qg-acc); }
    /* Nut nhom */
    .qg-side-sec:not(.mo-thang) > .qg-side-grp { display: flex; align-items: center; gap: 8px; padding: 7px 11px; border-radius: 9px; cursor: pointer; user-select: none;
        font-size: inherit; text-transform: none; letter-spacing: 0; font-weight: 500; white-space: nowrap; }
    .qg-side-grp .qg-grp-ic { display: inline-block; font-size: 1.05rem; }
    .qg-side-sec:not(.mo-thang) > .qg-side-grp::after { content: "\F282"; font-family: "bootstrap-icons"; font-size: .7rem; opacity: .7; transition: transform .15s ease; }
    .qg-side-sec.open > .qg-side-grp::after { transform: rotate(180deg); }
    .qg-side-grp:focus-visible { outline: 2px solid var(--qg-acc); outline-offset: 1px; }
    /* Bang xo xuong (nen trang, ngay duoi header) */
    .qg-side-sec:not(.mo-thang) > .qg-side-dd { display: none; position: absolute; top: 100%; left: 0; min-width: 250px; padding: 6px; z-index: 5;
        background: #fff; border: 1px solid var(--qg-line); border-top: 3px solid var(--sec-ink); border-radius: 4px 4px 12px 12px; box-shadow: 0 12px 28px rgba(15,23,42,.18); }
    .qg-side-sec.ve-phai > .qg-side-dd { left: auto; right: 0; }
    .qg-side-sec:not(.mo-thang):hover > .qg-side-dd, .qg-side-sec.open > .qg-side-dd { display: block; }
    .qg-side-dd a:hover { background: var(--sec-bg); }
    .qg-side-dd a.active { background: var(--sec-bg); box-shadow: inset 3px 0 0 var(--sec-ink); color: var(--sec-ink); }
    .qg-side-dd a.active i { color: var(--sec-ink); }
    .qg-top .qg-brand { flex: none; }
    .qg-top-r { margin-left: 0; flex: none; }
}
/* Man desktop hep: rut gon ten tren header de du cho menu */
@media (min-width: 992px) and (max-width: 1399.98px) {
    .qg-top .qg-brand-t small, .qg-top .qg-brand-tr { display: none; }
}
@media (min-width: 992px) and (max-width: 1199.98px) {
    .qg-side-grp .qg-grp-ic, .qg-side-sec.mo-thang > .qg-side-dd > a i { display: none; }
    .qg-side a, .qg-side-sec:not(.mo-thang) > .qg-side-grp { padding: 7px 8px; }
    .qg-top .qg-user span { display: none !important; }
}
@media (max-width: 991.98px) { body.side-open .qg-top { z-index: 1060; } }.qg-main { flex: 1; min-width: 0; padding: 18px 22px 40px; }
.qg-pagehead { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.qg-pagehead h1 { font-size: 1.35rem; font-weight: 700; margin: 0; color: var(--qg-pri); }
.qg-pagehead > :not(h1) { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---- Cards ---- */
.qg-card { background: var(--qg-card); border: 1px solid var(--qg-line); border-radius: 14px; padding: 16px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.qg-card + .qg-card { margin-top: 14px; }
.qg-card h2 { font-size: 1.02rem; font-weight: 700; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.qg-card h2 small { font-weight: 400; color: var(--qg-muted); font-size: .82rem; }
.qg-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; }
.qg-kpi { --k: #0E4D92; --k-bg: #EAF2FC; position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 6px;
    background: #fff; border: 1px solid var(--qg-line); border-radius: 16px; padding: 14px 16px 13px;
    container-type: inline-size; box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 4px 14px rgba(15,23,42,.05); transition: transform .15s ease, box-shadow .15s ease; }
.qg-kpi::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--k); opacity: .9; }
.qg-kpi:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(15,23,42,.05), 0 10px 24px rgba(15,23,42,.09); }
.qg-kpi .k-h { display: flex; align-items: center; gap: 9px; }
.qg-kpi .k-ic { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--k-bg); color: var(--k); font-size: 1rem; }
.qg-kpi .l { color: var(--qg-muted); font-size: .76rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; line-height: 1.25; }
.qg-kpi .v { font-size: 1.5rem; font-size: clamp(1.05rem, 10.5cqi, 1.5rem); white-space: nowrap; font-weight: 750; line-height: 1.15; color: var(--qg-text); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.qg-kpi .v .u { font-size: .72rem; font-weight: 600; color: var(--qg-muted); margin-left: 2px; letter-spacing: 0; }
.qg-kpi .s { color: var(--qg-muted); font-size: .8rem; line-height: 1.45; margin-top: auto; }
.qg-kpi .k-bar { height: 6px; border-radius: 99px; background: #EEF2F7; overflow: hidden; }
.qg-kpi .k-bar span { display: block; height: 100%; border-radius: 99px; transition: width .6s ease; }
.qg-kpi .k-pct { font-weight: 750; color: var(--c); }
.qg-kpi .k-chip { display: inline-block; padding: 1px 8px; margin: 0 4px 2px 0; border-radius: 99px; background: #F1F4F8; color: #475467; font-size: .76rem; font-weight: 600; }
.qg-kpi .k-tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 99px; font-size: .76rem; font-weight: 650; }
.qg-kpi .k-tag.ok { background: #E7F6EC; color: #1D6B34; }
.qg-kpi .k-tag.bad { background: #FDECEA; color: #B42318; }
.qg-kpi .k-sub { display: block; margin-top: 3px; }
a.qg-kpi.k-link { color: inherit; text-decoration: none; cursor: pointer; }
a.qg-kpi.k-link:hover { border-color: var(--k); }
a.qg-kpi.k-link:focus-visible { outline: 2px solid var(--k); outline-offset: 2px; }
.qg-kpi .k-go { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; color: var(--k); font-weight: 650; font-size: .78rem; }
a.qg-kpi.k-link:hover .k-go i { transform: translateX(3px); }
.qg-kpi .k-go i { transition: transform .15s ease; }
/* Khi cuon toi mot khoi (#pbCard...), chua cho thanh tren dinh */
.qg-card[id] { scroll-margin-top: calc(var(--qg-stick) + 14px); }
/* Nhay nhe khi mo tu lien ket */
.qg-flash { animation: qgFlash 2s ease; }
@keyframes qgFlash { 0%, 40% { box-shadow: 0 0 0 3px rgba(21,101,192,.45); } 100% { box-shadow: 0 0 0 0 rgba(21,101,192,0); } }
.qg-kpi.k-gn { --k: #1565C0; --k-bg: #E8F1FC; }
.qg-kpi.k-con { --k: #B26A00; --k-bg: #FFF4DE; }
.qg-kpi.k-ct { --k: #5B3B99; --k-bg: #F1ECFA; }
.qg-kpi.k-pb.k-ok { --k: #1D6B34; --k-bg: #E7F6EC; }
.qg-kpi.k-pb.k-bad { --k: #B42318; --k-bg: #FDECEA; }
.qg-kpi.pri { background: radial-gradient(120% 140% at 100% 0%, #2A7BD6 0%, var(--qg-pri-2) 38%, var(--qg-pri) 100%); color: #fff; border: 0;
    box-shadow: 0 6px 18px rgba(14,77,146,.28); }
.qg-kpi.pri::before { background: var(--qg-acc); }
.qg-kpi.pri .k-ic { background: rgba(255,255,255,.16); color: #fff; }
.qg-kpi.pri .l, .qg-kpi.pri .s { color: rgba(255,255,255,.85); }
.qg-kpi.pri .v, .qg-kpi.pri .v .u { color: #fff; }
.qg-kpi.pri .k-warn { color: #FFD873; font-weight: 600; }

/* ---- Gauge ---- */
.qg-gauges { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.qg-gauge { text-align: center; background: #fff; border: 1px solid var(--qg-line); border-radius: 14px; padding: 12px 10px 10px; cursor: default; }
.qg-gauge svg { width: 100%; max-width: 220px; height: auto; display: block; margin: 0 auto; }
.qg-gauge .t { font-weight: 650; font-size: .9rem; margin-top: 4px; line-height: 1.25; min-height: 2.5em; display: flex; align-items: center; justify-content: center; }
.qg-gauge .s { color: var(--qg-muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.qg-gauge.big svg { max-width: 300px; }
.qg-gauge.big .t { font-size: 1rem; }

/* ---- Toolbar & table ---- */
.qg-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.qg-toolbar .qg-search { max-width: 280px; }
.qg-toolbar .form-select, .qg-toolbar .form-control { width: auto; min-width: 120px; }
.qg-toolbar .sp { flex: 1; }
.qg-tablewrap { overflow: auto; max-height: calc(100vh - 250px); border: 1px solid var(--qg-line); border-radius: 12px; background: #fff; }
table.qg-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .88rem; }
table.qg-table th { position: sticky; top: 0; z-index: 2; background: #EEF2F7; color: #334155; font-weight: 650; padding: 8px 10px; border-bottom: 1px solid var(--qg-line); white-space: nowrap; cursor: pointer; user-select: none; }
table.qg-table th.nosort { cursor: default; }
table.qg-table th .srt { opacity: .5; font-size: .7rem; margin-left: 3px; }
table.qg-table td { padding: 7px 10px; border-bottom: 1px solid #F0F2F5; vertical-align: top; }
/* Dong chan le + hover cho moi bang trong site (qg-table, bootstrap .table, bang xem truoc nhap, bang khac) */
:root { --qg-zebra: #EBF1F9; --qg-row-hover: #D9E8FB; }
table tbody tr:nth-child(even) > td { background-color: var(--qg-zebra); }
table tbody tr:hover > td { background-color: var(--qg-row-hover); }
table.qg-table tbody tr:hover > td:first-child { box-shadow: inset 3px 0 0 var(--qg-pri-2); }
table.table > tbody > tr:nth-child(even) > * { --bs-table-bg-type: var(--qg-zebra); }
table.table > tbody > tr:hover > * { --bs-table-bg-type: var(--qg-row-hover); }
table tbody tr.err > td, table tbody tr.err:nth-child(even) > td { background-color: #FFE4E1; }
table.qg-table td.num, table.qg-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.qg-table td.act { white-space: nowrap; width: 1%; }
table.qg-table tfoot td { position: sticky; bottom: 0; background: #F6F8FB; font-weight: 700; border-top: 1px solid var(--qg-line); }
table.qg-table td.wrap { min-width: 260px; max-width: 520px; }
.qg-pager { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; color: var(--qg-muted); font-size: .85rem; }
.qg-pager .sp { flex: 1; }
.qg-empty { padding: 30px; text-align: center; color: var(--qg-muted); }
.btn-ic { padding: 2px 7px; line-height: 1.2; }
/* Nut thao tac trong cot dau cua bang */
table.qg-table td.has-act { white-space: nowrap; }
table.qg-table td.has-act .cell-v { white-space: normal; }
/* Gia tri va nut thao tac nam cung hang (chu dai thi gia tri xuong dong, nut giu ben phai) */
table.qg-table td.has-act .cell-in { display: flex; align-items: center; gap: 8px; }
table.qg-table td.has-act .cell-v { min-width: 0; }
table.qg-table td.has-act.wrap .cell-v { flex: 1 1 auto; }
table.qg-table td.has-act.num .cell-in { justify-content: flex-end; }
table.qg-table td.has-act.act-below .cell-in { flex-direction: column; align-items: flex-start; gap: 5px; }
table.qg-table td.has-act.act-below.num .cell-in { align-items: flex-end; }
.row-act { display: flex; flex: none; flex-wrap: nowrap; gap: 4px; }
.row-act:empty { display: none; }
@media (max-width: 991.98px) {
    table.qg-table.cards td.has-act .cell-in { flex: 1; flex-wrap: wrap; gap: 4px 8px; }
    table.qg-table.cards td.has-act.act-below .cell-in { flex-direction: row; align-items: center; }
    table.qg-table.cards td.has-act { flex-wrap: wrap; white-space: normal; }
    table.qg-table.cards td.has-act .cell-v { flex: 1; text-align: right; }
    table.qg-table.cards td.has-act.wrap .cell-v { text-align: left; }
    table.qg-table.cards td.has-act .row-act { flex-basis: 100%; justify-content: flex-end; }
}
.pct { display: inline-flex; align-items: center; gap: 6px; min-width: 110px; }
.pct .bar { flex: 1; height: 7px; background: #E8ECF1; border-radius: 4px; overflow: hidden; min-width: 50px; }
.pct .bar i { display: block; height: 100%; border-radius: 4px; }
.tag { display: inline-block; font-size: .74rem; padding: 1px 7px; border-radius: 10px; font-weight: 600; white-space: nowrap; }
.tag-ct { background: #FFF3D6; color: #8A5A00; } .tag-lm { background: #E3F2E8; color: #1D6B34; } .tag-th { background: #EDE7F6; color: #5B3B99; }
.tag-khan { background: #FDE2E1; color: #A50E0E; } .tag-qt { background: #FFF0D9; color: #9A5B00; } .tag-tt { background: #E6F0FB; color: #0E4D92; }

/* ---- Modal form ---- */
.qg-form .row > div { margin-bottom: 10px; }
.qg-form label { font-size: .82rem; font-weight: 600; color: #475467; margin-bottom: 3px; }
.qg-form .req::after { content: " *"; color: var(--qg-bad); }
.qg-help { font-size: .78rem; color: var(--qg-muted); }
.qg-form .qg-fsec { margin: 14px 0 2px; padding-top: 10px; border-top: 1px dashed var(--qg-line); font-weight: 700; font-size: .85rem; color: var(--qg-pri); }
.qg-form .qg-fsec span { display: block; font-weight: 400; font-size: .78rem; color: var(--qg-muted); margin-top: 2px; }

/* ---- O chon nhieu (type: 'multi') ---- */
.qg-multi { border: 1px solid #DEE2E6; border-radius: 8px; padding: 6px 8px; background: #fff; }
.qg-multi-l { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px 12px; max-height: 220px; overflow-y: auto; }
.qg-multi-o { display: flex; align-items: center; gap: 6px; padding: 4px 2px; cursor: pointer; font-size: .9rem; margin: 0; }
.qg-multi-o input { margin: 0; flex: none; }
.qg-multi-n { margin-top: 2px; }

/* ---- Import preview ---- */
.qg-imp-table { max-height: 50vh; overflow: auto; font-size: .8rem; }
.qg-imp-table table td, .qg-imp-table table th { padding: 3px 6px; border: 1px solid #eee; white-space: nowrap; }
.qg-imp-table tr.err td { background: #FFF1F0; }

/* ---- Cay chuyen tiep ---- */
.ct-tree { list-style: none; padding: 0; margin: 0; }
.ct-root { border: 1px solid var(--qg-line); border-radius: 12px; margin-bottom: 10px; background: #fff; overflow: hidden; }
.ct-root > .ct-hd { display: flex; gap: 10px; align-items: center; padding: 10px 12px; cursor: pointer; background: #F8FAFD; }
.ct-root > .ct-hd .nm { font-weight: 600; flex: 1; min-width: 0; }
.ct-chain { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0; padding: 12px; }
.ct-node { border: 1px solid var(--qg-line); border-radius: 12px; padding: 10px 12px; min-width: 210px; background: #fff; position: relative; }
.ct-node .y { font-weight: 800; color: var(--qg-pri); font-size: 1.05rem; }
.ct-node .r { display: flex; justify-content: space-between; gap: 12px; font-size: .82rem; font-variant-numeric: tabular-nums; }
.ct-node .r b { font-weight: 650; }
.ct-node.root { border-color: #9CC3EC; }
.ct-arrow { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 0 8px; color: var(--qg-warn); font-size: .78rem; font-weight: 700; min-width: 92px; text-align: center; }
.ct-arrow i { font-size: 1.5rem; }
.ct-end { display: flex; align-items: center; padding: 0 10px; color: var(--qg-muted); font-size: .8rem; }

/* ---- Tai lieu ---- */
.fb-list .fb-item { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-bottom: 1px solid #F0F2F5; }
.fb-list .fb-item i { font-size: 1.3rem; color: var(--qg-muted); }
.fb-list .fb-item .nm { flex: 1; min-width: 0; word-break: break-word; }
.fb-list .fb-item.dir i { color: #E0A100; }

/* ---- Thong bao ---- */
.tb-item { padding: 12px 16px; border-bottom: 1px solid var(--qg-line); cursor: pointer; }
.tb-item.unread { background: #F2F7FE; }
.tb-item .h { font-weight: 650; }
.tb-item .m { font-size: .8rem; color: var(--qg-muted); }
.tb-item .c { font-size: .88rem; margin-top: 4px; white-space: pre-line; display: none; }
.tb-item.open .c { display: block; }

/* ---- Tabbar mobile (kieu app) ---- */
.qg-tabbar { display: none; }
.qg-sheet[hidden] { display: none !important; }
@media (max-width: 991.98px) {
    :root { --qg-top-h: 54px; }
    body.qg-app { padding-bottom: calc(var(--qg-tab-h) + env(safe-area-inset-bottom, 0px)); }
    .qg-side { position: fixed; left: 0; top: 0; bottom: 0; height: 100vh; z-index: 1050; transform: translateX(-105%); transition: transform .22s ease; box-shadow: 6px 0 24px rgba(0,0,0,.18); width: 280px; }
    body.side-open .qg-side { transform: none; }
    body.side-open .qg-side-bg { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.42); z-index: 1040; }
    .qg-main { padding: 12px 12px 30px; }
    .qg-selso { width: 150px; }
    .qg-card h2 { flex-wrap: wrap; }
    .qg-tablewrap { max-height: none; }
    .qg-tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1035; height: calc(var(--qg-tab-h) + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px); background: #fff; border-top: 1px solid var(--qg-line); box-shadow: 0 -2px 12px rgba(15,27,42,.07); }
    .qg-tabbar > a, .qg-tabbar > button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0;
        border: 0; background: transparent; font: inherit; font-size: 11px; font-weight: 600; color: #5F6B77; text-decoration: none; position: relative; }
    .qg-tabbar i { font-size: 1.3rem; line-height: 1; }
    .qg-tabbar span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; padding: 0 2px; }
    .qg-tabbar > .is-active, .qg-tabbar > [aria-expanded="true"] { color: var(--qg-pri); }
    .qg-tabbar > .is-active::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--qg-pri); }
    .qg-tabbar > .is-loading i { animation: qg-spin .7s linear infinite; }
    html[data-tabbar="brand"] .qg-tabbar { background: var(--qg-pri); border-color: var(--qg-pri); }
    html[data-tabbar="brand"] .qg-tabbar > * { color: rgba(255,255,255,.78); }
    html[data-tabbar="brand"] .qg-tabbar > .is-active { color: #fff; }
    html[data-tabbar="brand"] .qg-tabbar > .is-active::before { background: var(--qg-acc); }
    html[data-tabbar="minimal"] .qg-tabbar span { display: none; }
    html[data-tabbar="minimal"] .qg-tabbar i { font-size: 1.45rem; }
    body.kb-open .qg-tabbar { display: none; }
    .qg-sheet { position: fixed; inset: 0; z-index: 1060; }
    .qg-sheet-bd { position: absolute; inset: 0; background: rgba(15,23,42,.45); }
    .qg-sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; background: #fff; border-radius: 18px 18px 0 0; padding: 8px 14px calc(18px + env(safe-area-inset-bottom, 0px)); max-height: 80vh; overflow-y: auto; animation: qg-up .2s ease; }
    .qg-sheet-grip { width: 42px; height: 5px; background: #D0D5DD; border-radius: 3px; margin: 4px auto 12px; }
    .qg-sheet-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
    .qg-sheet-grid a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 12px; text-decoration: none; color: var(--qg-text); font-size: .74rem; text-align: center; line-height: 1.2; }
    .qg-sheet-grid a i { font-size: 1.35rem; width: 46px; height: 46px; border-radius: 14px; background: #EEF3FA; color: var(--qg-pri); display: grid; place-items: center; }
    .qg-sheet-grid a:active { background: #F2F4F7; }
    .qg-sheet-style { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: .78rem; color: var(--qg-muted); border-top: 1px solid var(--qg-line); margin-top: 10px; padding-top: 10px; }
    .qg-sheet-style button { border: 1px solid var(--qg-line); background: #fff; border-radius: 14px; padding: 3px 10px; font-size: .76rem; }
    /* Bang -> the tren mobile */
    table.qg-table.cards thead { display: none; }
    table.qg-table.cards, table.qg-table.cards tbody, table.qg-table.cards tr, table.qg-table.cards td { display: block; width: 100%; }
    table.qg-table.cards tr { border-bottom: 8px solid var(--qg-bg); padding: 6px 0; }
    table.qg-table.cards td { border: 0; padding: 3px 12px; display: flex; gap: 10px; justify-content: space-between; text-align: right; max-width: none; min-width: 0; }
    table.qg-table.cards td::before { content: attr(data-l); color: var(--qg-muted); font-size: .78rem; text-align: left; flex: none; max-width: 45%; }
    table.qg-table.cards td.wrap { text-align: left; display: block; font-weight: 600; }
    table.qg-table.cards td.wrap::before { display: block; }
    table.qg-table.cards td.act { width: auto; justify-content: flex-end; }
    table.qg-table.cards td.act::before { content: none; }
    table.qg-table.cards tfoot { display: block; }
    table.qg-table.cards tfoot tr { display: block; }
}
@media (max-width: 575.98px) {
    /* Mobile: luon hien ten he thong, co ngan bang dau ... khi chat */
    .qg-top { gap: 4px; padding: 0 6px; }
    .qg-brand { flex: 1 1 auto; min-width: 0; gap: 8px; }
    .qg-logo { width: 30px; height: 30px; font-size: 1rem; }
    .qg-brand-t { min-width: 0; }
    .qg-brand-t b { font-size: .86rem; overflow: hidden; text-overflow: ellipsis; }
    .qg-brand-t small { font-size: .72rem; max-width: none; }
    .qg-top-r { flex: none; gap: 2px; }
    .qg-selso { width: 104px; padding-right: 1.6rem; font-size: .78rem; }
    .qg-ico, .qg-user, .qg-burger { min-width: 34px; padding: 0 5px; }
}
/* ---- Tro giup ngu canh (js/help.js) ---- */
.qg-hi { display: inline-flex; align-items: center; justify-content: center; margin-left: 4px; color: #1565C0; opacity: .75; cursor: help; font-size: .92em; line-height: 1; vertical-align: middle; border-radius: 50%; font-weight: 400; text-transform: none; letter-spacing: 0; }
.qg-hi:hover, .qg-hi:focus { opacity: 1; outline: none; color: #0E4D92; }
.qg-hi:focus-visible { box-shadow: 0 0 0 3px rgba(21,101,192,.3); }
.qg-pagehead h1 .qg-hi { font-size: .7em; margin-left: 8px; }
table.qg-table th .qg-hi { font-size: .85em; }
.qg-kpi .qg-hi, .qg-kpi.pri .qg-hi { color: inherit; }
.qg-hpop { position: fixed; z-index: 2200; background: #fff; color: var(--qg-text); border: 1px solid #C9D2DE; border-radius: 12px; box-shadow: 0 14px 36px rgba(15,23,42,.22); font-size: .86rem; line-height: 1.5; animation: qg-fade .12s ease; }
.qg-hpop::before { content: ""; position: absolute; left: calc(var(--ax, 50%) - 7px); width: 12px; height: 12px; background: #fff; border: 1px solid #C9D2DE; transform: rotate(45deg); }
.qg-hpop.down::before { top: -7px; border-right: 0; border-bottom: 0; }
.qg-hpop.up::before { bottom: -7px; border-left: 0; border-top: 0; }
.qg-hpop-t { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--qg-pri); padding: 9px 12px 4px; position: relative; }
.qg-hpop-t i { color: #E0A100; }
.qg-hpop-x { margin-left: auto; border: 0; background: transparent; font-size: 1.25rem; line-height: 1; color: var(--qg-muted); padding: 0 2px; }
.qg-hpop-b { padding: 0 12px 10px; }
.qg-hpop-b code { font-size: .82em; }
.qg-hpop-more { display: block; padding: 7px 12px; border-top: 1px solid var(--qg-line); font-size: .8rem; font-weight: 600; text-decoration: none; background: #F8FAFD; border-radius: 0 0 12px 12px; }
@keyframes qg-fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* ---- Trang huong dan ---- */
.hd-wrap { display: grid; grid-template-columns: 250px 1fr; gap: 16px; align-items: start; }
.hd-toc { position: sticky; top: calc(var(--qg-stick) + 12px); max-height: calc(100vh - 100px); overflow-y: auto; }
.hd-toc a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--qg-text); text-decoration: none; font-size: .88rem; }
.hd-toc a:hover { background: #EEF3FA; }
.hd-toc .g { font-size: .72rem; text-transform: uppercase; color: var(--qg-muted); font-weight: 700; padding: 10px 10px 4px; letter-spacing: .04em; }
.hd-sec { scroll-margin-top: calc(var(--qg-stick) + 12px); }
.hd-sec h2 { color: var(--qg-pri); }
.hd-sec h3 { font-size: .98rem; font-weight: 700; margin: 16px 0 6px; }
.hd-sec p, .hd-sec li { line-height: 1.6; }
.hd-role { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 20px; background: #E3EDF9; color: var(--qg-pri); font-weight: 650; }
.hd-steps { counter-reset: st; list-style: none; padding-left: 0; }
.hd-steps > li { counter-increment: st; position: relative; padding: 8px 0 8px 42px; border-bottom: 1px dashed var(--qg-line); }
.hd-steps > li::before { content: counter(st); position: absolute; left: 0; top: 7px; width: 28px; height: 28px; border-radius: 50%; background: var(--qg-pri); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: .85rem; }
.hd-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 12px; }
.hd-flow span { background: #fff; border: 1px solid #C9D2DE; border-radius: 10px; padding: 6px 10px; font-size: .84rem; font-weight: 600; }
.hd-flow i { color: var(--qg-muted); }
.hd-note { background: #FFF8E6; border-left: 4px solid #F2A900; padding: 8px 12px; border-radius: 6px; font-size: .88rem; margin: 10px 0; }
.hd-ex { background: #F2F7FE; border-left: 4px solid #1565C0; padding: 8px 12px; border-radius: 6px; font-size: .88rem; margin: 10px 0; }
@media (max-width: 991.98px) { .hd-wrap { grid-template-columns: 1fr; } .hd-toc { position: static; max-height: none; } }

/* ---- Khung co the thu gon (Tong quan: Chuyen tieu von) - cung kieu nut voi menu trai ---- */
.qg-pane-h { display: flex; align-items: center; gap: 8px; }
.qg-pane-t { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.qg-pane-tg { margin: 0; flex: none; }
.qg-panes .qg-pane-side, .qg-panes .qg-pane-main { transition: width .2s ease, flex-basis .2s ease; }
.qg-panes.pane-min .qg-pane-tg { background: linear-gradient(135deg, #FFC533, var(--qg-acc)); color: #3a2a00; box-shadow: 0 3px 10px rgba(242,169,0,.45), 0 0 0 3px #FFF3D6; }
.qg-panes.pane-min .qg-pane-tg i { transform: rotate(180deg); }
.qg-panes.pane-min .qg-pane-side #ctBox { display: none; }
@media (min-width: 992px) {
    /* Thu gon: khung phai con dai hep 72px, chu doc; bang trai gian het phan con lai */
    .qg-panes.pane-min .qg-pane-main { flex: 1 1 0; width: auto; max-width: none; }
    .qg-panes.pane-min .qg-pane-side { flex: 0 0 auto; width: 72px; }
    .qg-panes.pane-min .qg-pane-side .qg-card { height: 100%; padding: 12px 6px; }
    .qg-panes.pane-min .qg-pane-h { flex-direction: column; gap: 12px; margin: 0; }
    .qg-panes.pane-min .qg-pane-tg { order: -1; }
    .qg-panes.pane-min .qg-pane-t { writing-mode: vertical-rl; white-space: nowrap; flex: none; font-size: .95rem; }
    .qg-panes.pane-min .qg-pane-t .bi-diagram-3 { transform: rotate(90deg); }
    .qg-panes.pane-min .qg-pane-t .qg-hi { display: none; }
}

/* ---- So do cong viec (HuongDan "Viec cua ban") ---- */
.hd-diagram { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 14px; padding: 12px; border-radius: 14px; background: #F6F9FD; border: 1px dashed #C9D7EA; }
.hd-lane-t { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--qg-muted); margin-bottom: 6px; }
.hd-lane-c { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hd-lane-a { color: #9AA8BA; font-size: 1.1rem; }
.hd-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 7px; border-radius: 22px; background: #fff; border: 1.5px solid #C9D7EA;
    color: var(--qg-text); text-decoration: none; font-weight: 600; font-size: .86rem; box-shadow: 0 1px 2px rgba(16,24,40,.05); transition: transform .12s, border-color .12s, box-shadow .12s; }
.hd-chip:hover { transform: translateY(-1px); border-color: var(--qg-pri-2); box-shadow: 0 4px 10px rgba(21,101,192,.18); color: var(--qg-pri); }
.hd-chip.k-num { border-color: #9CC3EC; background: #EEF5FD; }
.hd-letter { flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .76rem; font-weight: 800; line-height: 1; }
.hd-letter.k-prep { background: #E7ECF3; color: #475467; box-shadow: 0 0 0 2px #fff; }
.hd-letter.k-view { background: #E3F2E8; color: #1D6B34; box-shadow: 0 0 0 2px #fff; }
.hd-steps2 { display: flex; flex-direction: column; gap: 0; }
.hd-sub { font-weight: 700; color: var(--qg-pri); margin: 14px 0 6px; font-size: .92rem; }
.hd-step { display: flex; gap: 14px; position: relative; padding: 0 0 16px; }
.hd-step::before { content: ""; position: absolute; left: 19px; top: 40px; bottom: 0; width: 2px; background: #D6E2F1; }
.hd-step:last-child::before { display: none; }
.hd-step-n { flex: none; width: 40px; display: flex; justify-content: center; }
.hd-step-n .qg-step.hd-big, .hd-step-n .hd-letter { width: 38px; height: 38px; font-size: 1.05rem; }
.hd-step-b { flex: 1; min-width: 0; background: #fff; border: 1px solid var(--qg-line); border-radius: 12px; padding: 10px 14px; transition: border-color .15s, box-shadow .15s; }
.hd-step:hover .hd-step-b { border-color: #9CC3EC; box-shadow: 0 4px 14px rgba(21,101,192,.12); }
.hd-step.k-num .hd-step-b { border-left: 4px solid var(--qg-pri); }
.hd-step-t { font-weight: 700; font-size: 1rem; }
.hd-step-w { font-size: .8rem; color: var(--qg-muted); margin: 3px 0 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.hd-step-w .bi-chevron-right { font-size: .7rem; }
.hd-where-l { font-weight: 600; color: #475467; }
.hd-mi { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 4px; border-radius: 8px; background: #E3EDF9; color: var(--qg-pri); font-weight: 650; }
.hd-mi .qg-step { width: 18px; height: 18px; font-size: .68rem; box-shadow: none; }
.hd-mi .bi { padding-left: 3px; }
.hd-step-b ul { margin: 0 0 6px; padding-left: 18px; font-size: .9rem; }
.hd-step-b ul li { margin: 2px 0; }
.hd-go { font-size: .78rem; padding: 2px 10px; }
.hd-step.hd-flash .hd-step-b { animation: hd-flash 1.2s ease; }
@keyframes hd-flash { 0%, 60% { box-shadow: 0 0 0 4px rgba(242,169,0,.55); border-color: var(--qg-acc); } 100% { box-shadow: none; } }
/* Muc menu trai tuong ung khi re chuot vao buoc */
.qg-side a.hd-glow { background: #FFF3D6 !important; color: #7A4F00 !important; box-shadow: inset 4px 0 0 var(--qg-acc), 0 0 0 2px rgba(242,169,0,.45); }
.qg-side a.hd-glow .qg-step { background: var(--qg-acc); color: #3a2a00; }
@media (max-width: 575.98px) { .hd-lane-a { transform: rotate(90deg); } .hd-lane-c { flex-direction: column; align-items: flex-start; } }

/* Tieu de + nut dong cua bang "Them" */
.qg-sheet-head { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 10px; }
.qg-sheet-head b { font-size: 1rem; }
.qg-sheet-x { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #F2F4F7; color: #344054; display: grid; place-items: center; font-size: 1.1rem; }
.qg-sheet-x:active { background: #E4E7EC; }
.pct { white-space: nowrap; }

/* ---- O chon co tim kiem (js/app.js: App.bodau, ssOpen) ---- */
select.form-select { cursor: pointer; }
.qg-ss { position: fixed; z-index: 2100; background: #fff; border: 1px solid #C9D2DE; border-radius: 10px; box-shadow: 0 12px 32px rgba(15,23,42,.18); overflow: hidden; font-size: .9rem; }
.qg-ss-s { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid var(--qg-line); color: var(--qg-muted); }
.qg-ss-s input { flex: 1; border: 0; outline: 0; padding: 4px 2px; font-size: .9rem; min-width: 0; background: transparent; }
.qg-ss-l { overflow-y: auto; max-height: 300px; padding: 4px 0; overscroll-behavior: contain; }
.qg-ss-o { padding: 6px 12px; cursor: pointer; line-height: 1.3; }
.qg-ss-o:hover, .qg-ss-o.act { background: #EEF3FA; }
.qg-ss-o.cur { color: var(--qg-pri); font-weight: 650; background: #E3EDF9; }
.qg-ss-o.cur::after { content: " ✓"; }
.qg-ss-o.emp { color: var(--qg-muted); }
.qg-ss-o.dis { opacity: .45; pointer-events: none; }
.qg-ss-none { padding: 14px; text-align: center; color: var(--qg-muted); }
.qg-ss-f { padding: 4px 12px; font-size: .74rem; color: var(--qg-muted); border-top: 1px solid var(--qg-line); background: #FAFBFC; }
.qg-ss.sheet { left: 0 !important; right: 0; bottom: 0 !important; top: auto !important; width: auto !important; border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); animation: qg-up .18s ease; }
.qg-ss.sheet .qg-ss-l { max-height: 55vh !important; }
.qg-ss.sheet .qg-ss-o { padding: 11px 16px; border-bottom: 1px solid #F2F4F7; }
.qg-ss.sheet .qg-ss-s input { font-size: 16px; }
@keyframes qg-up { from { transform: translateY(30%); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes qg-spin { to { transform: rotate(360deg); } }

/* ---- Dang nhap ---- */
.qg-login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(1200px 600px at 10% -10%, #2a6fc0 0%, transparent 60%), linear-gradient(160deg, #0B3B70, #0E4D92 55%, #13355e); }
.qg-login .box { width: 100%; max-width: 420px; background: #fff; border-radius: 18px; padding: 28px 26px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.qg-login h1 { font-size: 1.25rem; font-weight: 750; color: var(--qg-pri); margin: 12px 0 2px; }

@media print {
    .qg-top, .qg-side, .qg-tabbar, .qg-toolbar, .qg-pager, .no-print, .qg-pagehead > :not(h1) { display: none !important; }
    .qg-main { padding: 0; } .qg-tablewrap { max-height: none; overflow: visible; border: 0; }
    table.qg-table th { position: static; }
    body { background: #fff; }
}

/* Lich chon ngay tieng Viet (App.lich) */
.qg-cal { position: fixed; z-index: 1090; width: 272px; background: var(--qg-card); border: 1px solid var(--qg-line); border-radius: 12px; padding: 8px; font-size: 14px; }
.qg-cal-h { display: flex; gap: 4px; align-items: center; margin-bottom: 6px; }
.qg-cal-h select[data-m] { flex: 1.3; } .qg-cal-h select[data-y] { flex: 1; }
.qg-cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.qg-cal-w { font-size: 12px; font-weight: 600; color: var(--qg-muted); padding: 4px 0; }
.qg-cal-g .cn { color: #C0392B; }
.qg-cal-g button { border: 0; background: none; border-radius: 8px; height: 32px; color: var(--qg-text); }
.qg-cal-g button:hover { background: #EEF2F7; }
.qg-cal-g button.td { box-shadow: inset 0 0 0 1px #0E4D92; font-weight: 600; }
.qg-cal-g button.sel { background: #0E4D92; color: #fff; }
.qg-cal-f { display: flex; justify-content: space-between; margin-top: 4px; border-top: 1px solid var(--qg-line); padding-top: 4px; }

/* Bao cao theo mau 01 (BaoCaoMau01.aspx): tieu de 4 dong, co dinh 2 cot dau */
.bm-tool .bm-lb { font-size: .82rem; color: var(--qg-muted); margin: 0 -2px 0 4px; }
.bm-tool .bm-date { width: 150px; flex: none; flex-wrap: nowrap; }
.bm-tool .bm-date .form-control { width: auto; min-width: 0; flex: 1 1 auto; }
.bm-wrap { overflow: auto; max-height: calc(100vh - 200px); border: 1px solid #C9CFD8; border-radius: 8px; }
.bm-table { border-collapse: separate; border-spacing: 0; font-size: .82rem; min-width: 1500px; width: 100%; }
.bm-table th, .bm-table td { border-right: 1px solid #D5DAE1; border-bottom: 1px solid #D5DAE1; padding: 5px 6px; }
.bm-table thead { position: sticky; top: 0; z-index: 3; }
.bm-table thead th { background: #FFF5D6; color: #3D3A2E; text-align: center; vertical-align: middle; font-weight: 600; line-height: 1.25; }
.bm-table thead tr.bm-so th { font-size: .75rem; font-weight: 700; padding: 3px; }
.bm-table .bm-f1 { position: sticky; left: 0; z-index: 1; width: 44px; min-width: 44px; text-align: center; }
.bm-table .bm-f2 { position: sticky; left: 44px; z-index: 1; min-width: 300px; max-width: 420px; box-shadow: 2px 0 0 #C9CFD8; }
.bm-table thead .bm-f1, .bm-table thead .bm-f2 { z-index: 4; }
.bm-table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 92px; }
.bm-table tbody td { background-color: #fff; vertical-align: top; }
.bm-table tbody tr:nth-child(even) > td { background-color: var(--qg-zebra); }
.bm-table tbody tr:hover > td { background-color: var(--qg-row-hover); }
.bm-table tr.bm-dam td { font-weight: 700; }
.bm-table tr.bm-tieude td, .bm-table tr.bm-tong td { font-weight: 700; color: #1D6B34; }
.bm-table tr.bm-tieude td.bm-f2, .bm-table tr.bm-tong td.bm-f2 { text-align: center; }
.bm-table tr.bm-tong > td { background-color: #E7F6EC; }
.bm-table tr.bm-ct td.bm-f2 a { color: inherit; text-decoration: none; }
.bm-table tr.bm-ct td.bm-f2 a:hover { color: var(--qg-pri); text-decoration: underline; }
.bm-table .bm-qd { color: #B42318; font-size: .76rem; margin-top: 2px; }
.bm-table .bm-qd a { color: var(--qg-pri) !important; }
@media (max-width: 575.98px) { .bm-table .bm-f2 { min-width: 170px; max-width: 190px; } .bm-table .bm-f1 { width: 34px; min-width: 34px; } .bm-table .bm-f2 { left: 34px; } }
.bm-sum { margin-top: 14px; }
.bm-sumt { border-collapse: collapse; font-size: .85rem; }
.bm-sumt td { border: 1px solid #D5DAE1; padding: 5px 12px; min-width: 260px; }
@media print {
    .bm-wrap { max-height: none; overflow: visible; border: 0; }
    .bm-table { min-width: 0; font-size: 7.5pt; }
    .bm-table thead, .bm-table .bm-f1, .bm-table .bm-f2 { position: static; }
}
