/* Phần mềm quản lý trung tâm — giao diện chung (.qa-*) */
:root {
  --qa-bg: #f3f5f9;
  --qa-surface: #ffffff;
  --qa-surface-2: #f8fafc;
  --qa-border: #e3e8ef;
  --qa-border-strong: #cfd7e3;
  --qa-text: #142033;
  --qa-text-2: #4a5a72;
  --qa-muted: #7a879b;
  --qa-primary: #1f5eff;
  --qa-primary-600: #1a4fd6;
  --qa-primary-50: #ebf1ff;
  --qa-side: #0e1a33;
  --qa-side-2: #16264a;
  --qa-side-text: #b7c3db;
  --qa-green: #12a150;
  --qa-green-50: #e6f6ed;
  --qa-amber: #c77700;
  --qa-amber-50: #fff4e0;
  --qa-red: #d93636;
  --qa-red-50: #fdecec;
  --qa-purple: #7b4ddb;
  --qa-purple-50: #f1ebfd;
  --qa-teal: #0e8f8f;
  --qa-teal-50: #e2f5f5;
  --qa-radius: 10px;
  --qa-radius-sm: 7px;
  --qa-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --qa-shadow-lg: 0 12px 32px rgba(16, 24, 40, .16);
  --qa-side-w: 248px;
  --qa-font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.qa-body { background: var(--qa-bg); color: var(--qa-text); font: 14px/1.5 var(--qa-font); -webkit-font-smoothing: antialiased; }
a { color: var(--qa-primary); text-decoration: none; }
a:hover { color: var(--qa-primary-600); }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 600; }
.qa-icon { width: 18px; height: 18px; flex: none; vertical-align: middle; }
[hidden] { display: none !important; }

/* ---------- Khung ---------- */
.qa-shell { display: flex; min-height: 100vh; }
.qa-side { position: fixed; inset: 0 auto 0 0; width: var(--qa-side-w); background: var(--qa-side); color: var(--qa-side-text); display: flex; flex-direction: column; z-index: 40; transition: width .18s ease, transform .2s ease; }
.qa-brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 14px; color: #fff; border-bottom: 1px solid rgba(255,255,255,.06); min-height: 64px; }
.qa-brand:hover { color: #fff; }
.qa-brand img { width: 36px; height: 36px; object-fit: contain; border-radius: 8px; background: #fff; }
.qa-brand-mark { width: 36px; height: 36px; border-radius: 9px; background: linear-gradient(135deg, #2f6bff, #6a8cff); display: grid; place-items: center; flex: none; }
.qa-brand-mark .qa-icon { width: 22px; height: 22px; color: #fff; }
.qa-brand-text { display: flex; flex-direction: column; min-width: 0; }
.qa-brand-text b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qa-brand-text small { font-size: 11px; color: var(--qa-side-text); white-space: nowrap; }
.qa-nav { flex: 1; overflow-y: auto; padding: 8px 10px 12px; scrollbar-width: thin; scrollbar-color: #2a3b60 transparent; }
.qa-nav-group { margin-top: 6px; }
.qa-nav-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #6f7ea0; padding: 12px 10px 6px; font-weight: 600; white-space: nowrap; }
.qa-nav-item { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--qa-side-text); font-weight: 500; white-space: nowrap; }
.qa-nav-item:hover { background: var(--qa-side-2); color: #fff; }
.qa-nav-item.is-active { background: var(--qa-primary); color: #fff; }
.qa-nav-item span { overflow: hidden; text-overflow: ellipsis; }
.qa-side-toggle { display: flex; align-items: center; gap: 10px; margin: 8px 10px 12px; padding: 8px 10px; background: transparent; border: 1px solid rgba(255,255,255,.08); color: var(--qa-side-text); border-radius: 8px; cursor: pointer; font: inherit; }
.qa-side-toggle:hover { color: #fff; background: var(--qa-side-2); }
.qa-main { flex: 1; min-width: 0; margin-left: var(--qa-side-w); display: flex; flex-direction: column; transition: margin-left .18s ease; }
.qa-top { position: sticky; top: 0; z-index: 30; height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 24px; background: #fff; border-bottom: 1px solid var(--qa-border); }
.qa-top-title { font-weight: 600; font-size: 15px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qa-top-menu { display: none; background: none; border: 0; padding: 6px; cursor: pointer; color: var(--qa-text); }
.qa-top-right { display: flex; align-items: center; gap: 8px; }
.qa-top-link { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; color: var(--qa-text-2); }
.qa-top-link:hover { background: var(--qa-surface-2); }
.qa-user { position: relative; }
.qa-user-btn { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px 8px; border-radius: 8px; cursor: pointer; font: inherit; color: inherit; text-align: left; }
.qa-user-btn:hover { background: var(--qa-surface-2); }
.qa-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--qa-primary-50); color: var(--qa-primary); font-weight: 700; display: grid; place-items: center; }
.qa-user-text { display: flex; flex-direction: column; line-height: 1.25; }
.qa-user-text b { font-size: 13px; }
.qa-user-text small { font-size: 11.5px; color: var(--qa-muted); }
.qa-dropdown { display: none; position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; background: #fff; border: 1px solid var(--qa-border); border-radius: var(--qa-radius); box-shadow: var(--qa-shadow-lg); padding: 6px; z-index: 50; }
.qa-dropdown a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; color: var(--qa-text); }
.qa-dropdown a:hover { background: var(--qa-surface-2); }
[data-qa-dropdown].is-open .qa-dropdown { display: block; }
.qa-content { padding: 22px 24px 40px; max-width: 1480px; width: 100%; }
.qa-backdrop { display: none; }

body.qa-side-mini .qa-side { width: 72px; }
body.qa-side-mini .qa-main { margin-left: 72px; }
body.qa-side-mini .qa-brand-text, body.qa-side-mini .qa-nav-title, body.qa-side-mini .qa-nav-item span, body.qa-side-mini .qa-side-toggle span { display: none; }
body.qa-side-mini .qa-nav-item, body.qa-side-mini .qa-side-toggle { justify-content: center; }
body.qa-side-mini .qa-brand { justify-content: center; padding: 14px 0; }

@media (max-width: 960px) {
  .qa-side { transform: translateX(-100%); width: 264px; }
  .qa-main, body.qa-side-mini .qa-main { margin-left: 0; }
  .qa-top-menu { display: block; }
  .qa-top { padding: 0 14px; }
  .qa-content { padding: 16px 14px 32px; }
  .qa-user-text { display: none; }
  body.qa-side-open .qa-side { transform: none; }
  body.qa-side-open .qa-backdrop { display: block; position: fixed; inset: 0; background: rgba(10,18,35,.45); z-index: 35; }
  .qa-side-toggle { display: none; }
}

/* ---------- Tiêu đề trang ---------- */
.qa-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.qa-page-head h1 { font-size: 22px; }
.qa-page-head p { margin: 4px 0 0; color: var(--qa-muted); }
.qa-page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.qa-hello { margin-bottom: 18px; }
.qa-hello h1 { font-size: 22px; }
.qa-hello p { margin: 4px 0 0; color: var(--qa-muted); }

/* ---------- Nút ---------- */
.qa-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--qa-border-strong); background: #fff; color: var(--qa-text); font: 500 13.5px/1 var(--qa-font); cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s; }
.qa-btn:hover { background: var(--qa-surface-2); color: var(--qa-text); }
.qa-btn:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(31,94,255,.25); }
.qa-btn .qa-icon { width: 16px; height: 16px; }
.qa-btn-primary { background: var(--qa-primary); border-color: var(--qa-primary); color: #fff; }
.qa-btn-primary:hover { background: var(--qa-primary-600); border-color: var(--qa-primary-600); color: #fff; }
.qa-btn-success { background: var(--qa-green); border-color: var(--qa-green); color: #fff; }
.qa-btn-success:hover { filter: brightness(.95); color: #fff; background: var(--qa-green); }
.qa-btn-danger { background: #fff; border-color: #f2b8b8; color: var(--qa-red); }
.qa-btn-danger:hover { background: var(--qa-red-50); color: var(--qa-red); }
.qa-btn-ghost { background: transparent; border-color: transparent; color: var(--qa-text-2); }
.qa-btn-ghost:hover { background: var(--qa-surface-2); }
.qa-btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.qa-btn-icon { width: 32px; padding: 0; }
.qa-btn[disabled], .qa-btn.is-loading { opacity: .6; pointer-events: none; }

/* ---------- Thẻ, KPI ---------- */
.qa-card { background: var(--qa-surface); border: 1px solid var(--qa-border); border-radius: var(--qa-radius); box-shadow: var(--qa-shadow); margin-bottom: 18px; min-width: 0; }
.qa-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--qa-border); }
.qa-card-head h3 { font-size: 15px; }
.qa-card-body { padding: 16px 18px; }
.qa-card-body.p0, .qa-card-flush .qa-card-body { padding: 0; }
.qa-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.qa-kpi { display: flex; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--qa-border); border-radius: var(--qa-radius); padding: 16px; box-shadow: var(--qa-shadow); color: inherit; }
a.qa-kpi:hover { border-color: var(--qa-primary); color: inherit; }
.qa-kpi-icon { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--qa-primary-50); color: var(--qa-primary); flex: none; }
.qa-kpi-icon .qa-icon { width: 22px; height: 22px; }
.qa-kpi-label { color: var(--qa-muted); font-size: 12.5px; }
.qa-kpi-value { font-size: 22px; font-weight: 700; line-height: 1.2; margin-top: 2px; }
.qa-kpi-sub { font-size: 12px; color: var(--qa-text-2); margin-top: 2px; }
.qa-kpi-green .qa-kpi-icon { background: var(--qa-green-50); color: var(--qa-green); }
.qa-kpi-amber .qa-kpi-icon { background: var(--qa-amber-50); color: var(--qa-amber); }
.qa-kpi-red .qa-kpi-icon { background: var(--qa-red-50); color: var(--qa-red); }
.qa-kpi-purple .qa-kpi-icon { background: var(--qa-purple-50); color: var(--qa-purple); }
.qa-kpi-teal .qa-kpi-icon { background: var(--qa-teal-50); color: var(--qa-teal); }
.qa-dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.qa-dash-full { grid-column: 1 / -1; }
@media (max-width: 1100px) { .qa-dash-grid { grid-template-columns: 1fr; } }

/* ---------- Nhãn ---------- */
.qa-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; background: #eef1f6; color: var(--qa-text-2); }
.qa-badge-blue { background: var(--qa-primary-50); color: var(--qa-primary-600); }
.qa-badge-green { background: var(--qa-green-50); color: var(--qa-green); }
.qa-badge-amber { background: var(--qa-amber-50); color: var(--qa-amber); }
.qa-badge-red { background: var(--qa-red-50); color: var(--qa-red); }
.qa-badge-purple { background: var(--qa-purple-50); color: var(--qa-purple); }
.qa-badge-teal { background: var(--qa-teal-50); color: var(--qa-teal); }

/* ---------- Bảng ---------- */
.qa-table-wrap { overflow-x: auto; }
.qa-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.qa-table th { text-align: left; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--qa-muted); background: var(--qa-surface-2); padding: 10px 14px; border-bottom: 1px solid var(--qa-border); white-space: nowrap; }
.qa-table td { padding: 11px 14px; border-bottom: 1px solid var(--qa-border); vertical-align: middle; }
.qa-table tbody tr:hover td { background: #fafbfe; }
.qa-table tbody tr:last-child td { border-bottom: 0; }
.qa-table .num, .qa-table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.qa-table .nowrap { white-space: nowrap; }
.qa-table .actions { text-align: right; white-space: nowrap; }
.qa-table tr[data-href] { cursor: pointer; }
.qa-table-empty td { text-align: center; color: var(--qa-muted); padding: 34px 14px; }
.qa-cell-main { font-weight: 600; color: var(--qa-text); }
.qa-cell-sub { font-size: 12px; color: var(--qa-muted); }

/* ---------- Lọc, tab, phân trang ---------- */
.qa-filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.qa-filter .qa-field { margin: 0; min-width: 160px; }
.qa-filter .qa-field.qa-grow { flex: 1; min-width: 220px; }
.qa-filter-actions { display: flex; gap: 6px; }
.qa-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--qa-border); margin-bottom: 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.qa-tabs::-webkit-scrollbar { display: none; }
.qa-tabs a { padding: 10px 14px; color: var(--qa-text-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.qa-tabs a:hover { color: var(--qa-text); }
.qa-tabs a.is-active { color: var(--qa-primary); border-color: var(--qa-primary); }
.qa-tabs a b { font-size: 11.5px; background: #eef1f6; color: var(--qa-text-2); border-radius: 999px; padding: 1px 7px; margin-left: 4px; }
.qa-tabs a.is-active b { background: var(--qa-primary-50); color: var(--qa-primary); }
.qa-pagination { display: flex; align-items: center; gap: 4px; padding: 12px 14px; flex-wrap: wrap; }
.qa-pagination a, .qa-pagination span { min-width: 32px; height: 32px; padding: 0 8px; display: grid; place-items: center; border-radius: 7px; border: 1px solid var(--qa-border); color: var(--qa-text-2); background: #fff; }
.qa-pagination span.is-active { background: var(--qa-primary); border-color: var(--qa-primary); color: #fff; }
.qa-pagination em { margin-left: auto; font-style: normal; color: var(--qa-muted); font-size: 12.5px; }

/* ---------- Form ---------- */
.qa-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 16px; }
.qa-form.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.qa-form.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.qa-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.qa-field > label { font-size: 12.5px; font-weight: 500; color: var(--qa-text-2); }
.qa-span-2 { grid-column: span 2; }
.qa-span-3 { grid-column: span 3; }
.qa-span-4 { grid-column: 1 / -1; }
.qa-req { color: var(--qa-red); font-style: normal; }
.qa-hint { color: var(--qa-muted); font-size: 12px; }
.qa-input { width: 100%; height: 36px; padding: 0 11px; border: 1px solid var(--qa-border-strong); border-radius: 8px; background: #fff; color: var(--qa-text); font: 13.5px var(--qa-font); transition: border-color .12s, box-shadow .12s; }
textarea.qa-input { height: auto; padding: 8px 11px; resize: vertical; min-height: 72px; }
select.qa-input { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a879b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; background-size: 16px; }
select.qa-input[multiple] { height: auto; min-height: 90px; padding: 6px; background-image: none; }
.qa-input:focus { outline: 0; border-color: var(--qa-primary); box-shadow: 0 0 0 3px rgba(31,94,255,.15); }
.qa-input[readonly], .qa-input:disabled { background: var(--qa-surface-2); color: var(--qa-text-2); }
.qa-field.has-error .qa-input { border-color: var(--qa-red); }
.qa-field-error { color: var(--qa-red); font-size: 12px; }
.qa-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; }
.qa-check input { width: 16px; height: 16px; accent-color: var(--qa-primary); }
.qa-form-actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; padding-top: 4px; }
.qa-form-section { grid-column: 1 / -1; font-weight: 600; font-size: 13px; color: var(--qa-text); padding-top: 8px; border-top: 1px dashed var(--qa-border); margin-top: 4px; }
.qa-form-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
@media (max-width: 760px) { .qa-form, .qa-form.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .qa-span-3 { grid-column: 1 / -1; } }
@media (max-width: 520px) { .qa-form, .qa-form.cols-2, .qa-form.cols-3 { grid-template-columns: 1fr; } .qa-span-2, .qa-span-3 { grid-column: auto; } }

/* ---------- Trống, thông báo ---------- */
.qa-empty { text-align: center; padding: 44px 16px; color: var(--qa-muted); }
.qa-empty .qa-icon { width: 40px; height: 40px; color: #b5bfcf; }
.qa-empty h2 { font-size: 17px; color: var(--qa-text); margin: 10px 0; }
.qa-empty-error .qa-icon { color: var(--qa-amber); }
.qa-alert { padding: 11px 14px; border-radius: 8px; background: var(--qa-primary-50); color: #1c3d8f; margin-bottom: 14px; display: flex; gap: 10px; align-items: flex-start; }
.qa-alert-amber { background: var(--qa-amber-50); color: #7a4a00; }
.qa-alert-red { background: var(--qa-red-50); color: #8f1f1f; }
.qa-alert-green { background: var(--qa-green-50); color: #0c5f30; }
.qa-toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.qa-toast { min-width: 260px; max-width: 420px; padding: 11px 14px; border-radius: 9px; background: #142033; color: #fff; box-shadow: var(--qa-shadow-lg); font-size: 13.5px; animation: qa-in .18s ease-out; }
.qa-toast-success { background: #0f7a3e; }
.qa-toast-error { background: #b42626; }
@keyframes qa-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Hộp thoại ---------- */
.qa-modal-wrap { position: fixed; inset: 0; background: rgba(10, 18, 35, .5); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; z-index: 90; overflow-y: auto; }
.qa-modal { background: #fff; border-radius: 12px; box-shadow: var(--qa-shadow-lg); width: 100%; max-width: 640px; animation: qa-in .16s ease-out; }
.qa-modal.size-lg { max-width: 920px; }
.qa-modal.size-sm { max-width: 440px; }
.qa-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--qa-border); }
.qa-modal-head h3 { font-size: 16px; }
.qa-modal-close { background: none; border: 0; cursor: pointer; color: var(--qa-muted); padding: 4px; border-radius: 6px; }
.qa-modal-close:hover { background: var(--qa-surface-2); color: var(--qa-text); }
.qa-modal-body { padding: 18px 20px; }
.qa-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--qa-border); background: var(--qa-surface-2); border-radius: 0 0 12px 12px; }

/* ---------- Chi tiết dạng danh sách ---------- */
.qa-dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 20px; margin: 0; }
.qa-dl div { min-width: 0; }
.qa-dl dt { font-size: 12px; color: var(--qa-muted); }
.qa-dl dd { margin: 2px 0 0; font-weight: 500; overflow-wrap: anywhere; }
.qa-muted { color: var(--qa-muted); }
.qa-money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.qa-text-green { color: var(--qa-green); }
.qa-text-red { color: var(--qa-red); }
.qa-text-amber { color: var(--qa-amber); }
.qa-row { display: flex; gap: 18px; flex-wrap: wrap; }
.qa-col { flex: 1; min-width: 280px; }
.qa-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.qa-toolbar .qa-spacer { flex: 1; }

/* ---------- Thông báo (chuông) ---------- */
.qa-notify { position: relative; }
.qa-notify .qa-top-link { position: relative; border: 0; background: none; cursor: pointer; color: var(--qa-text-2); }
.qa-notify-count { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--qa-red); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; }
.qa-notify-panel { width: 360px; max-width: calc(100vw - 24px); padding: 0; right: -6px; }
.qa-notify-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--qa-border); }
.qa-notify-list { max-height: 420px; overflow-y: auto; }
.qa-dropdown .qa-notify-item { display: block; border-radius: 0; padding: 10px 14px; border-bottom: 1px solid var(--qa-border); color: var(--qa-text); }
.qa-dropdown .qa-notify-item:hover { background: var(--qa-surface-2); color: var(--qa-text); }
.qa-dropdown .qa-notify-item.is-unread { background: #f4f7ff; }
.qa-notify-item b { display: block; font-size: 13.5px; font-weight: 600; }
.qa-notify-item span { display: block; font-size: 12.5px; color: var(--qa-text-2); }
.qa-notify-item time { display: block; font-size: 11.5px; color: var(--qa-muted); margin-top: 2px; }
.qa-notify-empty { padding: 24px 14px; text-align: center; color: var(--qa-muted); }
.qa-dropdown .qa-notify-all { display: block; border-radius: 0; text-align: center; padding: 10px; font-weight: 500; }
.qa-dropdown .qa-dropdown-item { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; color: var(--qa-text); background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.qa-dropdown .qa-dropdown-item:hover { background: var(--qa-surface-2); }
.qa-dropdown [hidden] { display: none !important; }
@media (max-width: 560px) { .qa-notify-panel { position: fixed; left: 8px; right: 8px; width: auto; max-width: none; top: calc(58px + env(safe-area-inset-top)); } }

/* ---------- Điện thoại ---------- */
.qa-bottom-nav { display: none; }
@media (max-width: 960px) {
  .qa-top { padding-top: env(safe-area-inset-top); height: calc(56px + env(safe-area-inset-top)); }
  .qa-content { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .qa-bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--qa-border); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 16px rgba(16,24,40,.06); }
  .qa-bottom-nav a, .qa-bottom-nav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; color: var(--qa-muted); font: 500 11px/1.2 var(--qa-font); background: none; border: 0; border-radius: 8px; min-width: 0; }
  .qa-bottom-nav span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .qa-bottom-nav .qa-icon { width: 22px; height: 22px; }
  .qa-bottom-nav .is-active { color: var(--qa-primary); }
  .qa-toasts { bottom: calc(80px + env(safe-area-inset-bottom)); left: 12px; right: 12px; }
  .qa-toast { max-width: none; }
  .qa-page-head h1, .qa-hello h1 { font-size: 19px; }
  .qa-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .qa-kpi { padding: 12px; gap: 10px; }
  .qa-kpi-icon { width: 36px; height: 36px; }
  .qa-kpi-value { font-size: 18px; }
  .qa-modal-wrap { padding: 0; align-items: flex-end; }
  .qa-modal, .qa-modal.size-lg, .qa-modal.size-sm { max-width: none; border-radius: 14px 14px 0 0; max-height: 92vh; display: flex; flex-direction: column; }
  .qa-modal-body { overflow-y: auto; }
  .qa-modal-foot { border-radius: 0; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .qa-filter .qa-field, .qa-filter .qa-field.qa-grow { min-width: calc(50% - 5px); flex: 1; }
  .qa-input, .qa-btn { height: 40px; font-size: 15px; } /* tránh iOS tự phóng to khi gõ */
  .qa-btn-sm { height: 32px; font-size: 13px; }
  /* Bảng → thẻ: <table class="qa-table qa-table-cards"> + <td data-label="Tên cột"> */
  .qa-table-cards thead { display: none; }
  .qa-table-cards, .qa-table-cards tbody, .qa-table-cards tr, .qa-table-cards td { display: block; width: 100%; }
  .qa-table-cards tr { border-bottom: 1px solid var(--qa-border); padding: 10px 14px; }
  .qa-table-cards td { border: 0; padding: 3px 0; display: flex; gap: 10px; justify-content: space-between; text-align: right; }
  .qa-table-cards td[data-label]::before { content: attr(data-label); color: var(--qa-muted); font-size: 12px; text-align: left; flex: none; max-width: 45%; }
  .qa-table-cards td.qa-td-main { display: block; text-align: left; font-size: 15px; }
  .qa-table-cards td.qa-td-main::before { display: none; }
  .qa-table-cards td.actions { justify-content: flex-end; padding-top: 6px; }
  .qa-table-cards .qa-table-empty td { display: block; text-align: center; }
}
@media (display-mode: standalone) { .qa-top-link[title="Về trang web"] { display: none; } }

/* ---------- In ấn ---------- */
@media print {
  .qa-side, .qa-top, .qa-page-actions, .qa-filter, .qa-toasts, .qa-no-print, .qa-bottom-nav, .qa-backdrop { display: none !important; }
  .qa-content { padding-bottom: 0 !important; }
  .qa-main { margin: 0 !important; }
  .qa-content { padding: 0; max-width: none; }
  body.qa-body { background: #fff; }
  .qa-card { box-shadow: none; border: 0; }
}

/* ---------- Tổng quan: nhóm chỉ số ---------- */
.qa-dash-group { margin-bottom: 6px; }
.qa-dash-group-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--qa-muted); margin: 0 0 8px; }
.qa-dash-group .qa-kpis { margin-bottom: 14px; }

/* In A4: giữ dạng bảng (không đổi thành thẻ như trên điện thoại) */
@media print {
  .qa-table-cards { display: table !important; }
  .qa-table-cards thead { display: table-header-group !important; }
  .qa-table-cards tbody { display: table-row-group !important; }
  .qa-table-cards tr { display: table-row !important; padding: 0 !important; }
  .qa-table-cards td { display: table-cell !important; text-align: left; padding: 6px 8px !important; border-bottom: 1px solid #ccc !important; }
  .qa-table-cards td.num { text-align: right; }
  .qa-table-cards td[data-label]::before { display: none !important; }
}
