/* Quản trị gói 4 (g4/kiem/THIET-KE.md §12.6): Tổng (đại lý) — the owner's master-detail page, the Tổng cards, the quota
   panel, plan chips, the ledger table, the "Chờ đổi mật khẩu" / "Đã khóa bởi quản trị" badges, the forced Đổi mật khẩu
   card. Existing tokens only (--xa-* of styles.css, the quan-tri.css variables); loaded after css/quan-tri.css. */

/* ---- the owner's page: list left, detail right (a computer); one or the other (a phone / tablet) */
.qt4-md { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 16px; align-items: start; }
.qt4-cards { display: flex; flex-direction: column; gap: 10px; }
.qt4-card {
  display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--xa-line-2); background: var(--table-bg, #fff); color: var(--tts-ink); cursor: pointer; position: relative;
}
.qt4-card:hover, .qt4-card:focus-visible { border-color: var(--xa-focus-line); }
.qt4-card.is-on { border-color: var(--tts-blue); box-shadow: 0 0 0 2px var(--xa-focus-line); }
.qt4-card.is-locked { background: var(--xa-sunk); }
.qt4-card-top { display: flex; align-items: center; gap: 6px; padding-right: 74px; }
.qt4-card-top strong { font-size: 15px; }
.qt4-card-sub { font-size: 13px; color: var(--xa-muted); padding-right: 74px; }
.qt4-card-q { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.qt4-card-q b { font-size: 22px; color: var(--tts-navy); }
.qt4-card-q small { font-size: 11px; color: var(--xa-muted); }
.qt4-detail { min-width: 0; }
.qt4-detail-empty { display: flex; align-items: center; gap: 8px; padding: 32px 16px; border: 1px dashed var(--xa-line-2); border-radius: 10px; justify-content: center; }
.qt4-dhead { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 6px; }
.qt4-dname { flex: 1 1 auto; min-width: 0; }
.qt4-dname h2 { font-size: 20px; margin: 0; display: flex; align-items: center; gap: 6px; }
.qt4-dname small { color: var(--xa-muted); }
.qt4-dacts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.qt4-back { display: none; }
.qt4-dline { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 13px; color: var(--xa-grey); margin: 0 0 12px; }
.qt4-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.qt4-tile { cursor: default; }
.qt4-plans { display: flex; flex-wrap: wrap; gap: 8px; }
.qt4-plan { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--xa-line-2); color: var(--xa-muted); font-size: 13px; }
.qt4-plan.is-on { color: var(--qt-ok-ink); border-color: var(--qt-ok-line); }
.qt4-ledger td, .qt4-ledger th { font-size: 13px; }
.qt4-plus { color: var(--qt-ok-ink); font-weight: 600; }
.qt4-minus { color: var(--danger-ink); font-weight: 600; }
.qt4-links { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
@media (max-width: 991.98px) {
  .qt4-md { grid-template-columns: 1fr; }
  .qt4-md.has-detail .qt4-list { display: none; }
  .qt4-md:not(.has-detail) .qt4-detail { display: none; }
  .qt4-back { display: inline-flex; }
  .qt4-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- plan chips of the dialogs; a Tổng's Hạn dùng chips (a plan above the quota is off) */
.qt4-plan-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.qt4-plan-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--xa-field-line); border-radius: 999px; cursor: pointer; margin: 0; }
.qt4-plan-chip input { margin: 0; }
.qt-opt.is-off { opacity: .55; }
.qt-opt small { display: block; font-size: 11px; color: var(--xa-muted); }
.qt4-num { max-width: 160px; }
.qt4-quota-line { display: block; color: var(--xa-muted); margin-top: 2px; }
.qt4-refuse { display: flex; gap: 10px; align-items: flex-start; color: var(--qt-warn-ink); background: var(--qt-warn-bg); border-radius: 8px; padding: 12px; }
.qt4-refuse p { margin: 0; }

/* ---- a Tổng's quota panel (Tổng quan) */
.qt4-quota-big { display: flex; align-items: baseline; gap: 8px; margin: 4px 0; }
.qt4-quota-big b { font-size: 34px; color: var(--tts-navy); line-height: 1; }
.qt4-quota-big span { color: var(--xa-muted); }
.qt4-quota-sub { margin: 0 0 6px; font-size: 13px; }
.qt4-quota-rule { font-size: 12px; margin: 0 0 8px; }
.qt4-cols { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* ---- badges under a member's status */
.qt4-badges { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 4px; vertical-align: middle; }
.qt4-badges:empty { display: none; }
.qt4-badge-pw { background: var(--qt-warn-bg); color: var(--qt-warn-ink); }
.qt4-badge-owner { background: var(--xa-sunk); color: var(--danger-ink); }
.qt4-badge-owner small { margin-left: 4px; color: var(--xa-muted); font-weight: 400; }
.qt4-mgr { font-weight: 600; color: var(--tts-navy); }
.qt4-mgr-sel, .qt4-tong-sel { min-width: 180px; }
.qt4-c5-note { font-size: 13px; }

/* ---- the forced Đổi mật khẩu card (a member whose password a Tổng set) */
/* rà soát gói 4: 440 px only where it fits (a phone keeps the login card's max-width: 100%); the line takes the card's
   own light text colour (the page ink on the dark card was about 1.3:1) */
.qt4-dmk .lv2-card { width: 440px; max-width: 100%; }
.qt4-dmk-line { font-size: 15px; margin: 4px 0 6px; color: inherit; }
.qt4-dmk-hint { font-size: 13px; margin: 0 0 12px; }
.qt4-dmk .auth-switch { margin-top: 10px; display: inline-flex; gap: 6px; align-items: center; }
