/* Quản trị (package 1, design kiem/goi-1/THIET-KE.md §5.10; package 2 in the block at the end): Thành viên (js/view-thanh-vien.js), its dialogs
   (js/quan-tri-hop-thoai.js), the member drawer (js/quan-tri-chi-tiet.js), Nhật ký (js/view-nhat-ky.js) and the ⋮ menu
   (js/quan-tri-chung.js rowMenu), in the app's Xám ấm – Bóng 70% look (styles.css --xa-* tokens). Every class starts
   with .qt-; no body state class (has-shell, nav-rail, tts-sheet-open, sync-line-on, modal-open) is used as an element
   class. Raw figures (dates, counts) keep plain ink: the money colours are not used here.
   Breakpoints: < 992px (no sidebar: STT hidden), 768–991px (Ghi chú column hidden, its icon next to the name),
   < 768px (lists become cards, 16px boxes, 40px taps, the drawer full screen), < 576px (the ⋮ menu is a bottom sheet). */
:root {
  --qt-ok-bg: #e3f6ea; --qt-ok-line: #b7e2c6; --qt-ok-ink: #146c43;
  --qt-warn-bg: #fff4d1; --qt-warn-line: #ecd48c; --qt-warn-ink: #7a4f00;
  --qt-bad-bg: #fde8e6; --qt-bad-line: #f1b9b2; --qt-bad-ink: #a3201a;
  --qt-end-bg: #ece9e4; --qt-end-line: #d6d1c8; --qt-end-ink: #8c2b22;
  --qt-admin-bg: var(--xa-rose); --qt-admin-ink: var(--tts-red-text);
  --qt-trial-bg: #e8eefc; --qt-trial-ink: #2e4fa8;
  --qt-chip-n-bg: rgba(60, 46, 32, .1);
  --qt-chip-n-on: rgba(255, 255, 255, .28);
  --qt-dim: rgba(21, 33, 55, .45);
  --qt-note-on: var(--tts-blue);
  --qt-hit-bg: #fff2bf;
}

/* ------------------------------------------------------------------ page head, filters, chips */
.qt-page { font-family: var(--font-sans); }
.qt-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.qt-head-text { flex: 1 1 320px; min-width: 0; }
.qt-head-text .tts-page-sub { margin-bottom: 0; max-width: 84ch; }
.qt-head-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.qt-head-acts .btn { min-height: 36px; font-size: 13px; }
.qt-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; }
.qt-search { position: relative; display: block; flex: 1 1 260px; min-width: 0; max-width: 420px; margin: 0; }
.qt-search .qt-search-ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--xa-icon); pointer-events: none; }
.qt-search .form-control { padding-left: 34px; }
/* 6px above and below: the 16px text of a phone keeps its marks under the letters (Mọi hạn dùng) inside the 40px box */
.qt-sel { flex: 0 1 220px; width: auto; min-width: 0; height: 40px; padding-top: 6px; padding-bottom: 6px; }
.qt-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 12px; }
.qt-chip { gap: 6px; min-height: 34px; }
.qt-chip.is-on, .qt-chip.is-on:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.qt-chip-n { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--qt-chip-n-bg); font-size: 11px; font-weight: 700; line-height: 16px; text-align: center; }
.qt-chip.is-on .qt-chip-n { background: var(--qt-chip-n-on); color: #fff; }
.qt-ranges .btn { min-height: 34px; }
.qt-range { display: flex; align-items: center; gap: 6px; }
.qt-range .tts-date { width: 150px; }
.qt-nw { white-space: nowrap; }

/* ------------------------------------------------------------------ badges and small lines */
.qt-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border: .8px solid transparent; border-radius: 10px;
  font-size: 12px; font-weight: 600; line-height: 16px; white-space: nowrap; vertical-align: middle;
}
.qt-badge .ic { font-size: 10px; }
.qt-badge.is-ok { background: var(--qt-ok-bg); border-color: var(--qt-ok-line); color: var(--qt-ok-ink); }
.qt-badge.is-warn { background: var(--qt-warn-bg); border-color: var(--qt-warn-line); color: var(--qt-warn-ink); }
.qt-badge.is-bad { background: var(--qt-bad-bg); border-color: var(--qt-bad-line); color: var(--qt-bad-ink); }
.qt-badge.is-muted { background: var(--qt-end-bg); border-color: var(--qt-end-line); color: var(--qt-end-ink); }
.qt-badge.is-admin { background: var(--qt-admin-bg); color: var(--qt-admin-ink); font-weight: 700; }
.qt-badge.is-trial { background: var(--qt-trial-bg); color: var(--qt-trial-ink); font-weight: 700; }
.qt-sub { display: block; margin-top: 2px; font-size: 11.5px; line-height: 1.35; color: var(--xa-grey); }
.qt-sub .ic { font-size: 10px; }
.qt-days.is-warn { color: var(--qt-warn-ink); font-weight: 600; }
.qt-days.is-bad { color: var(--danger-ink); font-weight: 600; }
.qt-kgh { font-weight: 600; color: var(--tts-navy); white-space: nowrap; }
.qt-direct { color: var(--xa-grey); }
.qt-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.qt-tags .adm-badge { margin: 0; }
.qt-contact.qt-hit { display: inline-block; padding: 0 4px; border-radius: 4px; background: var(--qt-hit-bg); color: var(--tts-ink); font-weight: 600; }

/* ------------------------------------------------------------------ member table (desktop) */
.qt-tablewrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.qt-table { margin-bottom: 6px; }
.qt-table th, .qt-table td { padding: 8px 10px; }
.qt-table thead th { white-space: nowrap; }
.qt-table tbody tr:hover > td { background: var(--xa-hover); }
.qt-mem tbody tr[data-id] { cursor: pointer; }
.qt-mem .c-stt { width: 44px; }
.qt-mem .c-note { width: 62px; text-align: center; }
.qt-mem .col-actions { width: 70px; text-align: center; }
.qt-mem .c-mgr { max-width: 170px; }
.qt-name { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; color: var(--tts-ink); font-size: 13px; text-decoration: none; }
.qt-name:hover { text-decoration: none; }
.qt-name:hover strong { text-decoration: underline; }
.qt-name strong, .qt-name-plain { overflow-wrap: anywhere; }
.qt-name-plain { font-size: 13px; color: var(--tts-ink); }
.qt-notebtn { width: 30px; height: 30px; color: var(--xa-icon); font-size: 14px; }
.qt-notebtn.has-note { color: var(--qt-note-on); }
.qt-note-inline { display: none; margin-left: 2px; vertical-align: middle; }
.qt-more { width: 32px; height: 32px; font-size: 15px; }
.qt-mem tr.qt-special > td { background: var(--xa-sunk); color: var(--xa-muted); }
.qt-mem tr.qt-special { cursor: default; }
.qt-lockline { color: var(--qt-bad-ink); }
.qt-empty { margin: 6px 0 10px; padding: 16px; border: .8px dashed var(--xa-line); border-radius: 8px; color: var(--xa-muted); text-align: center; }
.qt-more-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.qt-count { font-size: 12px; color: var(--xa-grey); }
/* Quản trị gói 1 (kiểm lại 28/10): names stay on one line only from 1280px (measured: with the widest name, 32 × "W", the
   table needs a 1230px window); below it a long name, its SĐT line and its nhãn wrap where they must, else the table
   outgrows its card and a column (Trạng thái on a tablet) slides under the sticky Thao tác column (styles.css
   .table .col-actions). A name that fits still shows on one line: the table gives every column its full width first. */
@media (min-width: 1280px) {
  .qt-table .qt-name strong { white-space: nowrap; overflow-wrap: normal; }
}
@media (min-width: 768px) and (max-width: 1279.98px) {
  .qt-mem td.c-name { overflow-wrap: anywhere; }
}
@media (max-width: 991.98px) {
  .qt-mem th.c-stt, .qt-mem td.c-stt { display: none; }
}
/* a tablet (768–991px): no Ghi chú column, the note icon next to the name */
@media (min-width: 768px) and (max-width: 991.98px) {
  .qt-mem th.c-note, .qt-mem td.c-note { display: none; }
  .qt-mem .qt-note-inline { display: inline-flex; }
  .qt-mem .c-mgr { max-width: 120px; }
  .qt-mem thead th { white-space: normal; }
}

/* a narrow phone (320–399px): the two selects keep their words (Mọi hạn dùng) in half a row */
@media (max-width: 399.98px) {
  select.qt-sel { padding-left: 8px; padding-right: 20px; background-position: right 6px center; }
}

/* ------------------------------------------------------------------ phones: cards */
@media (max-width: 767.98px) {
  .qt-head-acts { width: 100%; }
  .qt-head-acts .btn { flex: 1 1 auto; min-height: 40px; }
  .qt-page .tts-page-sub { display: none; }
  .qt-search { flex: 1 1 100%; max-width: none; }
  /* the two selects (Hạn dùng, Sắp xếp) two per row down to 320px */
  .qt-sel { flex: 1 1 calc(50% - 4px); min-width: 0; }
  /* the chips row scrolls sideways inside itself only; the right edge fades so it shows more are there */
  .qt-chips, .qt-ranges {
    flex-wrap: nowrap; overflow-x: auto; margin-left: -12px; margin-right: -12px; padding: 0 12px 4px; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent 100%);
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent 100%);
  }
  .qt-chips::-webkit-scrollbar, .qt-ranges::-webkit-scrollbar { display: none; }
  .qt-chips .btn, .qt-ranges .btn { flex: none; min-height: 40px; }
  .qt-rangebar { flex-direction: column; align-items: stretch; }
  .qt-rangebar .qt-ranges { width: calc(100% + 24px); }
  .qt-range .tts-date { flex: 1 1 0; width: auto; min-width: 0; }
  .qt-tablewrap { overflow: visible; }
  .qt-more-row .btn { flex: 1 1 auto; min-height: 40px; }

  /* Thành viên: line 1 name + SĐT (+ nhãn) with ⋮ at the right, line 2 status + Hạn dùng, line 3 "<owner> trực tiếp" with
     the note icon at the right; a tap on the card opens the drawer */
  .qt-mem, .qt-mem tbody { display: block; width: 100%; border: 0; background: none; }
  .qt-mem thead { display: none; }
  .qt-mem tr {
    position: relative; display: flex; flex-wrap: wrap; align-items: center; column-gap: 8px; row-gap: 0;
    margin: 0 0 8px; padding: 9px 46px 10px 12px; border: .8px solid var(--td-line); border-radius: 10px; background: var(--table-bg);
    box-shadow: var(--xa-shadow-flat);
  }
  .qt-mem tr::after { content: ""; order: 5; flex: 0 0 100%; height: 0; }
  .qt-mem td { display: block; min-width: 0; padding: 0; border: 0 !important; background: none !important; }
  .qt-mem tbody tr:hover > td { background: none; }
  .qt-mem td.c-stt, .qt-mem td.c-created { display: none; }
  .qt-mem td.c-name { order: 1; flex: 1 1 100%; }
  .qt-mem .qt-name { min-height: 32px; font-size: 14px; }
  .qt-mem td.c-name .qt-contact { display: inline-flex; align-items: center; gap: 3px; margin: 0 0 0 8px; font-size: 12px; vertical-align: 1px; }
  .qt-mem .qt-note-inline { display: none; }
  .qt-mem td.c-st { display: contents; }
  .qt-mem td.c-st > .qt-badge { order: 2; flex: none; margin-top: 6px; }
  .qt-mem td.c-st > .qt-lockline { order: 4; flex: 1 1 100%; margin-top: 3px; font-size: 11.5px; }
  .qt-mem td.c-exp { order: 3; flex: 1 1 auto; margin-top: 6px; font-size: 12.5px; }
  .qt-mem td.c-exp::before { content: "Hạn dùng "; color: var(--xa-muted); }
  .qt-mem td.c-exp .qt-sub { display: inline; margin-left: 4px; font-size: 12px; }
  .qt-mem td.c-mgr { order: 6; flex: 1 1 auto; max-width: none; margin-top: 5px; font-size: 12px; }
  .qt-mem td.c-mgr:empty { display: none; }
  .qt-mem td.c-note { position: absolute; right: 3px; bottom: 3px; width: auto; }
  .qt-mem .qt-notebtn { width: 40px; height: 40px; font-size: 14px; }
  .qt-mem td.col-actions { position: absolute; top: 3px; right: 3px; width: auto; box-shadow: none; }
  .qt-mem .qt-more { width: 40px; height: 40px; }
  .qt-mem tr.qt-special { padding-right: 12px; background: var(--xa-sunk); }
  .qt-mem tr.qt-special td.c-name .qt-sub { display: block; margin: 2px 0 0; }

  /* Nhật ký: line 1 "time · who", line 2 "**Thao tác** · account", line 3 what */
  .qt-log, .qt-log tbody { display: block; width: 100%; border: 0; background: none; }
  .qt-log thead { display: none; }
  .qt-log tr.qt-log-card {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; margin: 0 0 6px; padding: 9px 12px;
    border: .8px solid var(--xa-line-2); border-radius: 9px; background: var(--table-bg);
  }
  .qt-log tr.qt-log-card::after { content: ""; order: 3; flex: 0 0 100%; height: 0; }
  .qt-log td { display: block; padding: 0 !important; border: 0 !important; background: none !important; }
  .qt-log .c-time { order: 1; font-size: 12px; color: var(--xa-grey); }
  .qt-log .c-who { order: 2; flex: 1 1 auto; min-width: 0; font-size: 12px; }
  .qt-log .c-who::before { content: "· "; color: var(--xa-grey); }
  .qt-log .c-type { order: 4; }
  .qt-log .c-target { order: 5; }
  .qt-log .c-target::before { content: "· "; color: var(--xa-grey); }
  .qt-log .c-target:empty { display: none; }
  .qt-log .c-detail { order: 6; flex: 1 1 100%; font-size: 12px; color: var(--xa-grey); overflow-wrap: anywhere; }
  .qt-log .c-target a { display: inline-block; padding: 10px 0; margin: -10px 0; }
}

/* Nhật ký table (desktop) */
@media (min-width: 768px) { .qt-log .c-time { width: 128px; white-space: nowrap; } }
.qt-log .c-who.is-system { color: var(--xa-grey); }
.qt-log .c-detail { overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ ⋮ menu: a panel on a computer, a sheet on a phone */
.qt-pop {
  position: fixed; z-index: 1060; min-width: 236px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); overflow-y: auto;
  padding: 6px; border: .8px solid var(--xa-line); border-radius: 14px; background: var(--xa-gloss); color: var(--tts-ink);
  box-shadow: var(--xa-shadow-raised); font-family: var(--font-sans); font-size: 13px;
}
.qt-pop-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 4px; padding: 6px 12px 9px; border-bottom: .8px solid var(--xa-line-2); font-size: 13px; color: var(--tts-ink); }
.qt-pop .dropdown-item, .qt-actsheet .dropdown-item { align-items: center; }
.qt-pop .dropdown-item { min-height: 38px; padding: 8px 12px; }
.qt-pop-t { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; }
.qt-pop-t small { font-size: 11px; line-height: 1.3; color: var(--xa-grey); }
.dropdown-item.is-danger, .dropdown-item.is-danger .ic { color: var(--tts-red); }
/* the phone sheet: a dialog of openModal (its own history entry: Back closes it only) restyled to sit at the bottom */
.qt-actsheet-modal .modal-backdrop { background: var(--qt-dim); }
.qt-actsheet-modal.show .modal-backdrop { opacity: 1; }
.qt-actsheet-modal .modal { display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; }
.qt-actsheet-modal .modal .modal-dialog {
  width: 100%; max-width: none; margin: 0; transform: translateY(40px); transition: transform .2s ease-out, opacity .15s;
}
.qt-actsheet-modal.show .modal .modal-dialog { transform: none; }
.qt-actsheet-modal .modal-content {
  max-height: 86vh; border-width: 0; border-radius: 16px 16px 0 0; background: var(--xa-gloss-long); color: var(--tts-ink);
  box-shadow: var(--xa-shadow-raised); font-family: var(--font-sans);
}
.qt-actsheet-modal .modal-header { flex: none; align-items: center; padding: 10px 6px 8px 18px; border-radius: 16px 16px 0 0; box-shadow: none; }
.qt-actsheet-modal .modal-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; font-size: 15px; color: var(--tts-ink); }
.qt-actsheet-modal .modal-header .close { margin: -10px -6px -10px auto; }
.qt-actsheet-modal .modal-body { min-height: 0; padding: 4px 12px calc(12px + var(--safe-bottom)); overflow-y: auto; overscroll-behavior: contain; }
.qt-actsheet { display: flex; flex-direction: column; }
.qt-actsheet .dropdown-item { min-height: 48px; font-size: 15px; }
.qt-actsheet .dropdown-item .ic { font-size: 15px; }
.qt-actsheet-close { margin-top: 8px; min-height: 44px; font-size: 14px; }

/* ------------------------------------------------------------------ dialogs */
.qt-modal .modal-body { font-size: 12.5px; }
/* Quản trị gói 1 (kiểm lại 28/10): a long name without a break point ("WWWW…", 32 characters) wraps in the title, the ×
   stays in the header (the header is a flex row and its title has no min-width: styles.css .modal-header) */
.qt-modal .modal-title, .qt-actsheet-modal .modal-title b, .qt-pop-head b { min-width: 0; overflow-wrap: anywhere; }
.qt-modal .modal-header .close, .qt-actsheet-modal .modal-header .close { flex: none; }
/* the dialog box itself takes focus when it has no field (openModal focusTrap): no ring around the whole box */
.qt-modal .modal-content:focus, .qt-drawer .modal-content:focus, .qt-actsheet-modal .modal-content:focus { outline: none; }
.qt-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.qt-opt { position: relative; margin: 0; cursor: pointer; }
.qt-opt input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.qt-opt span {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: .8px solid var(--xa-field-line); border-radius: 6px;
  background: var(--xa-field); color: var(--tts-ink); font-size: 13px; font-weight: 600; white-space: nowrap; user-select: none;
}
.qt-opt input:checked + span { border-color: var(--primary); background: var(--primary); color: #fff; }
.qt-opt input:focus-visible + span { outline: 2px solid var(--xa-focus-line); outline-offset: 1px; }
.qt-date { margin-top: 8px; max-width: 220px; }
.qt-preview {
  display: flex; align-items: flex-start; gap: 6px; margin: 0 0 14px; padding: 9px 12px; border: .8px solid var(--info-border); border-radius: 8px;
  background: var(--info-bg); color: var(--info-ink); font-size: 13px; line-height: 1.45;
}
.qt-preview .ic { flex: none; margin-top: 3px; }
.qt-preview.is-err { border-color: var(--err-border); background: var(--err-bg); color: var(--err-ink); }
.qt-cur { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 12px; font-size: 13px; line-height: 1.45; }
.qt-cur .ic { margin-top: 3px; color: var(--xa-icon); }
.qt-warnline { display: flex; align-items: flex-start; gap: 7px; margin: 0 0 12px; padding: 8px 10px; border-radius: 6px; background: var(--warn-bg); color: var(--warn-ink); font-size: 12.5px; line-height: 1.45; }
.qt-warnline .ic { flex: none; margin-top: 3px; }
.qt-devline { display: flex; align-items: flex-start; gap: 7px; margin: 0 0 6px; font-size: 12.5px; line-height: 1.45; color: var(--xa-muted); }
.qt-devline .ic { flex: none; margin-top: 3px; }
.qt-list { margin: 0 0 12px; padding-left: 18px; font-size: 13px; line-height: 1.5; }
.qt-list li + li { margin-top: 3px; }
.qt-lockinfo { font-size: 12.5px; }
.qt-reasons { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.qt-pwrow { display: flex; gap: 6px; }
.qt-pwrow .form-control { flex: 1 1 auto; min-width: 0; font-family: var(--mono); font-size: 14px; letter-spacing: .02em; }
.qt-pwrow .btn { flex: none; }
.qt-help { display: block; margin-top: 4px; font-size: 11.5px; }
.qt-copy-foot small, .qt-notebox small { font-size: 11.5px; }
.qt-kind3 { display: flex; margin: 0 0 12px; border: 1px solid var(--xa-field-line); border-radius: 6px; overflow: hidden; }
.qt-kind3-opt { position: relative; flex: 1 1 33%; min-width: 0; margin: 0; cursor: pointer; }
.qt-kind3-opt input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.qt-kind3-opt span {
  display: flex; align-items: center; justify-content: center; gap: 6px; height: 100%; min-height: 40px; padding: 4px 8px;
  background: var(--xa-field); color: var(--tts-ink); font-size: 13px; font-weight: 600; text-align: center;
}
.qt-kind3-opt + .qt-kind3-opt span { border-left: 1px solid var(--xa-field-line); }
.qt-kind3-opt span .ic { font-size: 11px; }
.qt-kind3-opt input:checked + span { background: var(--primary); color: #fff; }
.qt-kind3-opt input:focus-visible + span { outline: 2px solid var(--xa-focus-line); outline-offset: -3px; }
.qt-done { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; color: var(--qt-ok-ink); font-size: 15px; }
.qt-done .ic { font-size: 20px; }
.qt-copy { display: grid; gap: 8px; padding: 12px; border: .8px solid var(--xa-line); border-radius: 8px; background: var(--xa-field); }
.qt-copy-head { font-size: 13.5px; color: var(--tts-navy); }
.qt-copy-text.form-control { height: auto; min-height: 0; resize: none; font-family: var(--mono); font-size: 14px; line-height: 1.55; background: var(--xa-panel); color: var(--tts-ink); }
.qt-copy-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }

/* ------------------------------------------------------------------ the member drawer (openModal className qt-drawer) */
.qt-drawer .modal-backdrop { background: var(--qt-dim); }
.qt-drawer.show .modal-backdrop { opacity: 1; }
.qt-drawer .modal-dialog, .qt-drawer .modal-dialog.modal-lg {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); max-width: none; margin: 0;
  transform: translateX(28px); transition: transform .2s ease-out, opacity .2s;
}
.qt-drawer.show .modal-dialog, .qt-drawer.show .modal-dialog.modal-lg { transform: none; }
.qt-drawer .modal-content { height: 100%; border-width: 0 0 0 .8px; border-radius: 0; overflow: hidden; }
.qt-drawer .modal-header {
  flex: none; align-items: center; padding: 12px 10px 12px 16px; border-radius: 0; background: var(--xa-side-gloss);
  padding-top: calc(12px + var(--safe-top));
}
.qt-drawer .modal-header .close { margin: -12px -10px -12px auto; }
.qt-drawer .modal-title { display: flex; flex-direction: column; min-width: 0; gap: 3px; }
.qt-dr-name { font-size: 19px; font-weight: 800; line-height: 1.25; color: var(--tts-ink); overflow-wrap: anywhere; }
.qt-dr-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px; color: var(--xa-grey); }
.qt-drawer .modal-body { flex: 1 1 auto; min-height: 0; padding: 0 0 calc(20px + var(--safe-bottom)); overflow-y: auto; overscroll-behavior: contain; }
.qt-drawer .modal-footer { display: none !important; }
.qt-dr-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 16px; border-bottom: .8px solid var(--xa-line-2); }
.qt-dr-acts .btn { font-size: 12.5px; }
.qt-dr-acts .btn.is-danger, .qt-dr-acts .btn.is-danger .ic { color: var(--tts-red); }
.qt-dr-acts .qt-more { margin-left: auto; }
.qt-tabs { position: sticky; top: 0; z-index: 2; }
.qt-tabs .nav-link { font-size: 12px; }
.qt-tabpanel { padding: 14px 16px 0; }
.qt-dl { margin: 0; }
.qt-dl-row { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-top: .8px solid var(--xa-line-2); }
.qt-dl-row:first-child { border-top: 0; }
.qt-dl dt { font-weight: 600; color: var(--xa-muted); }
.qt-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.qt-dl dd .qt-copybtn { width: 26px; height: 26px; margin-left: 4px; vertical-align: middle; }
.qt-notebox { margin-top: 12px; padding: 10px 12px; border: .8px solid var(--xa-line-2); border-radius: 8px; background: var(--xa-field); }
.qt-notebox-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.qt-notebox p { margin: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.qt-notebox small { color: var(--xa-grey); }
.qt-hist { margin: 0; padding: 0; list-style: none; }
.qt-hist li { padding: 9px 0; border-top: .8px solid var(--xa-line-2); }
.qt-hist li:first-child { border-top: 0; padding-top: 0; }
.qt-hist-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px; color: var(--xa-grey); }
.qt-hist-top .adm-badge { margin: 0; }
.qt-hist-main { margin-top: 3px; font-size: 13px; }
.qt-hist-main .ic { font-size: 10px; color: var(--xa-icon); }
.qt-drawer .qt-log { font-size: 12px; }
@media (max-width: 767.98px) {
  .qt-drawer .modal-dialog, .qt-drawer .modal-dialog.modal-lg { width: 100%; }
  .qt-drawer .modal-content { border-width: 0; }
  .qt-drawer .modal-header { padding: calc(8px + var(--safe-top)) 6px 8px 12px; }
  .qt-dr-name { font-size: 17px; }
  .qt-dr-acts { padding: 8px 12px; }
  .qt-dr-acts .btn { flex: 1 1 auto; min-height: 40px; }
  .qt-dr-acts .qt-more { width: 40px; height: 40px; }
  .qt-tabs .nav-link { min-height: 40px; padding: 8px 6px; font-size: 11.5px; white-space: normal; }
  /* Quản trị gói 1 (kiểm lại 28/10): the three tabs share the row and wrap their words (200% zoom: ~195px), so "Nhật ký"
     is never cut off at the right (styles.css gives tabs min-width: max-content) */
  .qt-tabs .nav-link { min-width: 0; overflow-wrap: anywhere; }
  .qt-tabpanel { padding: 12px 12px 0; }
  .qt-dl-row { grid-template-columns: 104px minmax(0, 1fr); }
  .qt-dl dd .qt-copybtn { width: 40px; height: 40px; margin: -8px 0; }
  .qt-notebox .link-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; }
  .qt-opt span { min-height: 40px; }
  .qt-pwrow { flex-wrap: wrap; }
  .qt-pwrow .btn { flex: 1 1 auto; }
  .qt-kind3-opt span { font-size: 12px; padding: 4px; }
  .qt-copy-foot .btn { flex: 1 1 auto; }
  .modal .qt-copy-text.form-control { font-size: 16px; }
  .qt-reasons .btn { min-height: 40px; }
}

/* ==================================================================================================================
   Quản trị gói 2 (design kiem/goi-2/THIET-KE.md §7.13): Tổng quan (js/view-tong-quan.js), Online (js/view-online.js),
   Thùng rác (js/view-thung-rac.js), the device rows and the G4 box (js/quan-tri-thiet-bi.js), the Thùng rác dialogs
   (js/quan-tri-thung-rac.js), "Hoạt động gần nhất" of Thành viên and the drawer's Thiết bị tab. Same rules as above:
   every class .qt-, theme tokens, figures in plain ink (no money colour), 40px taps and no sideways scroll on phones.
   ================================================================================================================== */
:root {
  --qt-dot-on: #1e9e55; --qt-dot-ring: rgba(30, 158, 85, .18); --qt-dot-off: #8b919c;
  --qt-tile-hover: #FBFAF7;
  --qt-lose-bg: #fdf0ee; --qt-lose-line: #f1c4bd;
  --qt-keep-bg: #edf7f0; --qt-keep-line: #bfe0c9;
}

/* ------------------------------------------------------------------ small marks: online dot, pills, last activity */
.qt-dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--qt-dot-off); vertical-align: 1px; }
.qt-dot.qt-dot-on { background: var(--qt-dot-on); box-shadow: 0 0 0 2.5px var(--qt-dot-ring); }
.qt-pill {
  display: inline-block; padding: 1px 8px; border: .8px solid var(--xa-line-2); border-radius: 999px; background: var(--xa-sunk);
  color: var(--xa-muted); font: 700 11px/16px var(--font-sans); white-space: nowrap; vertical-align: 1px;
}
.qt-pill.qt-pill-busy { border-color: var(--qt-ok-line); background: var(--qt-ok-bg); color: var(--qt-ok-ink); }
.qt-pill.qt-pill-open { border-color: var(--qt-warn-line); background: var(--qt-warn-bg); color: var(--qt-warn-ink); }
.qt-on-txt { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--qt-ok-ink); }
.qt-last-off { color: var(--xa-grey); }
.qt-last-off .ic { margin-right: 4px; font-size: 11px; color: var(--xa-icon); vertical-align: -1px; }
/* rebase on package 1 FINAL (kiểm lại 28/10, S14): names wrap below 1280px so the table never outgrows its card and no
   column slides under the sticky Thao tác column. Kiểm gói 2 28/10: "Hoạt động gần nhất" ("Đang online · 3 thiết bị")
   is wider than package 1's "Ngày tạo": it may wrap up to 1600px (measured with the full sidebar and 32-character names:
   at 1280 with the icon rail and at 1366 / 1440 with the full sidebar the one-line column made the table outgrow its
   card), one line from 1600px */
.qt-mem .qt-last { white-space: normal; }
@media (min-width: 1600px) {
  .qt-mem .qt-last { white-space: nowrap; }
}
/* with the full sidebar (992–1599px) the headers may wrap too ("HOẠT ĐỘNG / GẦN NHẤT"): a long name no longer pushes Ghi chú
   under Thao tác (as on a tablet, package 1's 768–991px rule) */
@media (min-width: 992px) and (max-width: 1599.98px) {
  .qt-mem thead th { white-space: normal; }
}
.qt-blockline { color: var(--danger-ink); font-weight: 600; }
.qt-upd { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--xa-grey); white-space: nowrap; }
.qt-upd .ic { font-size: 11px; color: var(--xa-icon); }
.qt-note { margin-bottom: 12px; }
.qt-soon { font-weight: 600; color: var(--qt-warn-ink); }
.qt-dr-name .qt-dot { margin-right: 8px; vertical-align: 3px; }

/* ------------------------------------------------------------------ Tổng quan: tiles (links), two boxes */
.qt-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 4px 0 16px; }
.qt-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; padding: 10px 12px;
  border: .8px solid var(--xa-line-2); border-radius: 8px; background: var(--xa-field); color: var(--tts-ink);
  text-decoration: none; box-shadow: var(--xa-shadow-flat);
}
.qt-tile:hover, .qt-tile:focus { border-color: var(--xa-line); background: var(--qt-tile-hover); color: var(--tts-ink); text-decoration: none; }
.qt-tile:focus-visible { outline: 2px solid var(--xa-focus-line); outline-offset: 1px; }
.qt-tile-top { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; }
.qt-tile-ic {
  display: inline-flex; flex: none; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px;
  background: var(--xa-sunk); color: var(--tts-blue); font-size: 14px;
}
.qt-tile-label { min-width: 0; font-size: 12.5px; font-weight: 600; line-height: 1.25; color: var(--xa-grey); }
.qt-tile-n { font-size: 26px; font-weight: 800; line-height: 1.1; color: var(--tts-ink); font-variant-numeric: tabular-nums; }
.qt-tile-sub { display: inline-flex; align-items: center; gap: 4px; min-width: 0; font-size: 11.5px; color: var(--xa-muted); overflow-wrap: anywhere; }
.qt-tile-sub .ic { flex: none; font-size: 9px; }
.qt-tile.qt-tile-on .qt-tile-n, .qt-tile.qt-tile-on .qt-tile-ic { color: var(--qt-ok-ink); }
.qt-tile.qt-tile-warn .qt-tile-n, .qt-tile.qt-tile-warn .qt-tile-ic { color: var(--qt-warn-ink); }
.qt-tile.qt-tile-bad .qt-tile-n, .qt-tile.qt-tile-bad .qt-tile-ic { color: var(--danger-ink); }
.qt-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.qt-box { min-width: 0; padding: 12px 14px; border: .8px solid var(--xa-line-2); border-radius: 8px; background: var(--xa-field); box-shadow: var(--xa-shadow-flat); }
.qt-box-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin-bottom: 8px; }
.qt-box-head h2 { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 14px; font-weight: 700; color: var(--tts-navy); }
.qt-box-head h2 .ic { color: var(--xa-icon); }
.qt-box-head .link-btn { color: var(--a-ink); font-size: 12.5px; text-decoration: none; }
.qt-mini { margin: 0; padding: 0; list-style: none; }
.qt-mini li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 0; border-top: .8px solid var(--xa-line-2); }
.qt-mini li:first-child { border-top: 0; padding-top: 2px; }
.qt-mini .qt-name { flex: none; }
.qt-mini-sub { flex: 1 1 auto; min-width: 0; font-size: 12px; }
.qt-mini li > .btn { margin-left: auto; }
.qt-mini-time { flex: none; width: 74px; font-size: 12px; color: var(--xa-grey); font-variant-numeric: tabular-nums; }
.qt-mini-main { display: flex; flex: 1 1 200px; flex-direction: column; min-width: 0; font-size: 12.5px; }
.qt-mini-main small { font-size: 11.5px; color: var(--xa-grey); overflow-wrap: anywhere; }
/* kiểm 28/10: the first line ("Thao tác · <tên>") wraps a 32-character name too (320px) */
.qt-mini-main > span { overflow-wrap: anywhere; }
.qt-mini-log li { flex-wrap: nowrap; align-items: flex-start; }
.qt-mini-empty { margin: 4px 0; }
@media (max-width: 991.98px) { .qt-cols { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ Online: one row per account, opened to its devices */
.qt-on .qt-head-acts { align-items: center; }
.qt-online { display: grid; gap: 6px; }
.qt-on-head, .qt-on-main { grid-template-columns: minmax(180px, 1.4fr) minmax(150px, 1fr) 120px 120px 22px; }
.qt-on-head {
  display: grid; gap: 10px; padding: 8px 14px; border-radius: 6px; background: var(--th-red); color: #fff;
  font: 700 12px/1.4 var(--font-sans); text-transform: uppercase;
}
.qt-on-row { overflow: hidden; border: .8px solid var(--xa-line-2); border-radius: 8px; background: var(--table-bg); }
.qt-on-row.qt-on-row-open { border-color: var(--xa-line); box-shadow: var(--xa-shadow); }
.qt-on-main {
  display: grid; gap: 10px; align-items: center; width: 100%; min-height: 48px; padding: 8px 14px; border: 0; background: none;
  color: var(--tts-ink); font: inherit; text-align: left; cursor: pointer;
}
.qt-on-main:hover { background: var(--xa-hover); }
.qt-on-main:focus-visible { outline: 2px solid var(--xa-focus-line); outline-offset: -2px; }
.qt-on-row.qt-on-row-open .qt-on-main { background: var(--xa-rose-soft); }
.qt-on-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
/* the name whole on one line (cut with … only when even alone it does not fit); the manager gives way first */
.qt-on-name strong { flex: 0 1 auto; min-width: 0; overflow: hidden; font-size: 13px; color: var(--tts-ink); text-overflow: ellipsis; white-space: nowrap; }
.qt-on-name small { flex: 0 100 auto; min-width: 0; overflow: hidden; font-size: 11.5px; color: var(--xa-grey); text-overflow: ellipsis; white-space: nowrap; }
.qt-on-dev { display: flex; align-items: center; gap: 4px; min-width: 0; color: var(--xa-grey); font-size: 12.5px; }
.qt-on-dev > span:last-child { margin-left: 4px; white-space: nowrap; }
.qt-devic {
  display: inline-flex; flex: none; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px;
  background: var(--xa-sunk); color: var(--tts-blue); font-size: 12px;
}
.qt-on-when { font-size: 12.5px; color: var(--xa-grey); white-space: nowrap; }
.qt-on-chev { color: var(--xa-icon); transition: transform .15s; }
.qt-on-row.qt-on-row-open .qt-on-chev { transform: rotate(180deg); }
.qt-on-sess { display: grid; gap: 8px; padding: 10px 14px 12px; border-top: .8px solid var(--xa-line-2); }
.qt-on-sess > p { margin: 0; }
.qt-on-all { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.qt-on-all .btn.is-danger, .qt-on-all .btn.is-danger .ic, .qt-dr-foot .btn.is-danger, .qt-dr-foot .btn.is-danger .ic { color: var(--tts-red); }

/* ------------------------------------------------------------------ devices (Online, the drawer's Thiết bị), G4 box */
.qt-sesslist { display: grid; gap: 8px; }
.qt-sess { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: .8px solid var(--xa-line-2); border-radius: 8px; background: var(--xa-field); }
.qt-sess-ic {
  display: inline-flex; flex: none; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 9px;
  background: var(--xa-sunk); color: var(--tts-blue); font-size: 18px;
}
.qt-sess-main { display: flex; flex: 1 1 auto; flex-direction: column; gap: 1px; min-width: 0; }
.qt-sess-main strong { font-size: 13px; color: var(--tts-ink); overflow-wrap: anywhere; }
.qt-sess-main small { font-size: 11.5px; line-height: 1.5; color: var(--xa-grey); overflow-wrap: anywhere; }
.qt-sess .btn { flex: none; }
.qt-oldline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 10px 0 0; font-size: 12px; color: var(--xa-grey); }
.qt-dr-foot { display: flex; justify-content: flex-end; margin-top: 12px; }
.qt-block {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 12px; padding: 9px 12px;
  border: .8px solid var(--err-border); border-radius: 8px; background: var(--err-bg); color: var(--err-ink); font-size: 12.5px;
}
.qt-block > .ic { flex: none; font-size: 15px; }
.qt-block > span { flex: 1 1 200px; min-width: 0; }

/* ------------------------------------------------------------------ Thùng rác: table (computer), cards (phone) */
.qt-rac-table .qt-name { padding: 0; border: 0; background: none; font: inherit; font-size: 13px; cursor: pointer; }
.qt-rac-table .qt-rac-acts { text-align: left; }
.qt-rac-table .qt-rac-acts .btn + .btn { margin-left: 6px; }
.qt-rac-table td.qt-rac-why, .qt-rac-table td.qt-rac-data { overflow-wrap: anywhere; }
/* kiểm 28/10 (S14 lesson): on a computer too the name and the headers of Thùng rác wrap where they must — at 1280px with the
   full sidebar a 32-character name kept on one line (package 1's rule from 1280px) and a 120-character reason made the
   table outgrow its card and slid Dữ liệu giữ nguyên under the sticky Thao tác; Lý do keeps a readable width */
.qt-rac-table .qt-name strong { white-space: normal; overflow-wrap: anywhere; }
.qt-rac-table thead th { white-space: normal; }
.qt-rac-table td.qt-rac-why { min-width: 8em; }
/* a tablet, and a computer up to 1199px (kiểm 28/10: with the full sidebar, from 992 to about 1160px the table outgrew its
   card and Lý do / Dữ liệu giữ nguyên slid under the sticky Thao tác): no Người quản lý, headers wrap, the buttons stacked */
@media (min-width: 768px) and (max-width: 1199.98px) {
  .qt-rac-table th.qt-rac-mgr, .qt-rac-table td.qt-rac-mgr { display: none; }
  .qt-rac-table thead th { white-space: normal; }
  .qt-rac-table .qt-rac-acts .btn { display: flex; width: 100%; margin: 0 0 6px; }
  .qt-rac-table .qt-rac-acts .btn + .btn { margin-left: 0; }
}

/* ------------------------------------------------------------------ dialogs: Xóa vĩnh viễn, the Hoàn tác toast */
.qt-purge-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 12px; }
.qt-lose, .qt-keep { min-width: 0; padding: 10px 12px; border-radius: 8px; font-size: 12.5px; }
.qt-lose { border: .8px solid var(--qt-lose-line); background: var(--qt-lose-bg); }
.qt-keep { border: .8px solid var(--qt-keep-line); background: var(--qt-keep-bg); }
.qt-lose h6, .qt-keep h6 { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 13px; font-weight: 700; }
.qt-lose h6 { color: var(--danger-ink); }
.qt-keep h6 { color: var(--qt-ok-ink); }
.qt-lose ul, .qt-keep ul { margin: 0; padding-left: 18px; line-height: 1.6; }
/* kiểm 28/10: the backup file name breaks at its hyphens / the space first, a word only when it must */
.qt-keep code { display: block; margin-top: 2px; color: var(--tts-navy); font-size: 11px; word-break: normal; overflow-wrap: anywhere; }
.qt-keep .qt-sub { overflow-wrap: anywhere; }
/* kiểm 28/10: a long name (32 characters, "WWWW…") wraps in the sentences, labels and lists of the package-2 dialogs too,
   not only in their title (package 1 S18): nothing sticks out of the dialog at 320px or at 200% zoom */
.qt-modal-2 .modal-body { overflow-wrap: anywhere; }
.qt-del-fail { display: flex; align-items: flex-start; gap: 7px; margin: 0 0 6px; color: var(--danger-ink); font-size: 13px; font-weight: 600; line-height: 1.45; }
.qt-del-fail .ic { flex: none; margin-top: 2px; }
.qt-purge-pause { margin: 0 0 10px; }
.qt-toast-act { flex: none; margin-left: 4px; }

/* ------------------------------------------------------------------ phones */
@media (max-width: 767.98px) {
  .qt-head-acts .qt-upd { order: 5; flex: 1 1 100%; }
  .qt-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 2px 0 14px; }
  .qt-tile { padding: 9px 10px; }
  .qt-tile-n { font-size: 28px; }
  .qt-tile-label { font-size: 12px; }
  .qt-tile-ic { width: 24px; height: 24px; font-size: 12px; }
  .qt-mini .btn, .qt-box-head .link-btn { min-height: 40px; }
  .qt-box-head .link-btn { display: inline-flex; align-items: center; }
  .qt-mini .qt-name { min-height: 40px; }

  /* Online: a card per account: line 1 dot + name + manager + pill, line 2 devices + time, the chevron right middle */
  .qt-on-head { display: none; }
  .qt-on-main {
    grid-template-columns: minmax(0, 1fr) auto 18px; grid-template-areas: "name pill chev" "dev when chev";
    row-gap: 5px; padding: 10px 12px;
  }
  .qt-on-name { grid-area: name; }
  .qt-on-name strong { font-size: 14px; }
  .qt-on-pill { grid-area: pill; }
  .qt-on-dev { grid-area: dev; }
  .qt-on-when { grid-area: when; font-size: 12px; text-align: right; }
  .qt-on-chev { grid-area: chev; }
  .qt-on-sess { padding: 8px 10px 10px; }
  .qt-on-all .btn { flex: 1 1 auto; min-height: 40px; }

  /* a device row: the text full width, its button full width under it */
  .qt-sess { flex-wrap: wrap; align-items: flex-start; }
  .qt-sess-main { flex: 1 1 0; }
  .qt-sess .btn { flex: 1 1 100%; min-height: 40px; }
  .qt-dr-foot .btn { flex: 1 1 100%; min-height: 40px; }
  .qt-oldline .link-btn { display: inline-flex; align-items: center; min-width: 40px; min-height: 40px; }
  .qt-block .btn { min-height: 40px; }

  /* Thành viên cards: line 3 = manager, then the last activity (whole, on its own line when both do not fit) */
  .qt-mem td.c-mgr { flex: 0 1 auto; margin-right: 14px; }
  .qt-mem td.qt-last {
    order: 7; flex: 0 1 auto; min-width: 0; max-width: 100%; margin-top: 5px; overflow: hidden; font-size: 12px; color: var(--xa-grey);
    text-overflow: ellipsis; white-space: nowrap;
  }
  .qt-mem td.qt-last:empty { display: none; }
  .qt-mem td.c-st > .qt-blockline { order: 4; flex: 1 1 100%; margin-top: 3px; font-size: 11.5px; }
  .qt-mem .qt-name .qt-dot { margin-right: 0; }

  /* Thùng rác: a card per member; the two buttons side by side, 40px high */
  .qt-rac-table, .qt-rac-table tbody { display: block; width: 100%; border: 0; background: none; }
  .qt-rac-table thead { display: none; }
  .qt-rac-table tr {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0 0 8px; padding: 10px 12px;
    border: .8px solid var(--td-line); border-radius: 10px; background: var(--table-bg); box-shadow: var(--xa-shadow-flat);
  }
  .qt-rac-table tbody tr:hover > td { background: none; }
  .qt-rac-table td { display: block; min-width: 0; padding: 0; border: 0 !important; background: none !important; font-size: 12.5px; }
  .qt-rac-table td[data-label]::before { content: attr(data-label) ": "; font-weight: 600; color: var(--xa-muted); }
  .qt-rac-table td.qt-rac-name { flex: 1 1 100%; font-size: 14px; }
  .qt-rac-table td.qt-rac-name::before, .qt-rac-table td.qt-rac-acts::before { content: none; }
  /* kiểm 28/10: the name opens the drawer: a 40px tap like every other control of these pages */
  .qt-rac-table .qt-name { min-height: 40px; font-size: 14px; }
  .qt-rac-table td.qt-rac-by, .qt-rac-table td.qt-rac-why, .qt-rac-table td.qt-rac-data { flex: 1 1 100%; }
  .qt-rac-table td.qt-rac-acts {
    position: static; display: flex; flex: 1 1 100%; gap: 8px; margin-top: 6px; box-shadow: none; white-space: normal;
  }
  .qt-rac-table td.qt-rac-acts .btn { flex: 1 1 0; min-height: 40px; margin: 0; }

  .qt-toast-act { min-height: 40px; padding: 0 12px; }
}
/* a narrow phone (320–399px): a smaller pill; the manager ("smart12 trực tiếp") stays on line 1 and gives way first (cut
   with …), as the approved screen owner-phone-03 (kiểm 28/10: it was hidden below 400px) */
@media (max-width: 399.98px) {
  .qt-on-main .qt-pill { padding: 1px 6px; font-size: 10.5px; }
}
/* Xóa vĩnh viễn: "Sẽ mất" above "Còn giữ" on a narrow phone */
@media (max-width: 575.98px) { .qt-purge-grid { grid-template-columns: 1fr; } }
/* kiểm 28/10 — 200% zoom of a phone (390px → ~195px, 320px → 160px): nothing cut, nothing on top of something else.
   Online: the name gets its own line (pill, devices, time each on theirs); a device row: its text full width (no icon
   box), its button's words may wrap; Thùng rác: the two buttons one under the other; the drawer's 4 tabs two per row with
   whole words */
@media (max-width: 299.98px) {
  .qt-on-main { grid-template-columns: minmax(0, 1fr) 18px; grid-template-areas: "name chev" "pill chev" "dev chev" "when chev"; }
  .qt-on-name { flex-wrap: wrap; row-gap: 2px; }
  .qt-on-name .qt-dot { display: none; }
  .qt-on-name strong { white-space: normal; overflow-wrap: anywhere; }
  .qt-on-name small { flex: 1 1 100%; white-space: normal; }
  .qt-on-pill { justify-self: start; }
  .qt-on-when { text-align: left; }
  .qt-sess-ic { display: none; }
  .qt-sess .btn, .qt-on-all .btn, .qt-dr-foot .btn, .qt-block .btn, .qt-rac-table td.qt-rac-acts .btn { white-space: normal; }
  .qt-rac-table td.qt-rac-acts { flex-wrap: wrap; }
  .qt-rac-table td.qt-rac-acts .btn { flex: 1 1 100%; }
  .qt-drawer .qt-tabs { flex-wrap: wrap; }
  .qt-drawer .qt-tabs .nav-link { flex: 1 1 40%; overflow-wrap: break-word; }
}
