/* Quản trị người dùng: Tài khoản + Vai trò + Tài khoản quản trị (26/09/2026). Màu theo token theme; ô bấm ≥44px; điện thoại không kéo ngang. */
.ns-page { max-width: 1180px; margin: 0 auto; padding: 4px 0 24px; color: var(--text-main); min-width: 0; }
.ns-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-end; margin-bottom: 14px; flex-wrap: wrap; }
.ns-head h1 { margin: 0; font-size: 26px; letter-spacing: -.01em; }
.ns-sub { margin: 4px 0 0; color: var(--text-muted); font-size: 14px; }
.ns-ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ns-dim { color: var(--text-muted); }
.ns-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ns-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 8px; }
.ns-search { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 12px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-input, var(--bg-card)); color: var(--text-muted); }
.ns-search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 15px; color: var(--text-main); outline: none; min-height: 44px; }
.ns-search:focus-within { outline: 2px solid var(--theme-accent-strong, #0071e3); outline-offset: 1px; }
.ns-sel { display: grid; gap: 4px; flex: 0 1 170px; }
.ns-lbl { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.ns-req { color: var(--txt-bad, #c0262d); }
.ns-sel select, .ns-f select, .ns-f input, .ns-f textarea { min-height: 44px; box-sizing: border-box; width: 100%; padding: 0 12px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-input, var(--bg-card)); color: var(--text-main); font: inherit; font-size: 15px; }
.ns-f textarea { padding: 10px 12px; resize: vertical; }
.ns-f input[aria-invalid="true"] { border-color: var(--txt-bad, #c0262d); }
.ns-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 0 16px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-card); color: var(--text-main); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ns-btn:disabled { opacity: .5; cursor: not-allowed; }
.ns-btn.ns-primary { background: var(--theme-accent-strong, #0071e3); border-color: var(--theme-accent-strong, #0071e3); color: #fff; }
html[data-itn-theme="graphite"] .ns-btn.ns-primary, html[data-itn-theme="gold-noir"] .ns-btn.ns-primary { color: var(--bg-app); }
.ns-btn.is-nguy { color: var(--txt-bad, #c0262d); }
.ns-btn.ns-sm { min-height: 44px; padding: 0 14px; font-size: 13px; }
.ns-btn.ns-icon { padding: 0; width: 44px; border-radius: 8px; }
.ns-link { border: 0; background: none; padding: 0 4px; min-height: 44px; color: var(--txt-accent, var(--theme-accent-strong)); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.ns-count { margin: 10px 2px 6px; font-size: 13px; color: var(--text-muted); min-height: 1em; }
.ns-table-wrap { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; }
.ns-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ns-table th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--text-muted); padding: 12px 14px; border-bottom: 1px solid var(--border-color); background: var(--bg-card-hover, var(--bg-card)); }
.ns-table td { padding: 10px 14px; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
.ns-table tbody tr:last-child td { border-bottom: 0; }
.ns-table tbody tr:hover { background: var(--bg-card-hover, transparent); }
.ns-who { display: flex; align-items: center; gap: 10px; }
.ns-av { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--theme-accent-soft, rgba(0,113,227,.12)); color: var(--txt-accent, var(--theme-accent-strong)); font-weight: 700; }
.ns-av-lg { width: 48px; height: 48px; font-size: 20px; }
.ns-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.ns-lh { line-height: 1.45; font-size: 13px; }
.ns-num, .ns-table th.ns-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ns-act { text-align: right; }
.ns-chip { display: inline-block; padding: 2px 8px; border-radius: 8px; background: var(--bg-card-hover, rgba(0,0,0,.04)); border: 1px solid var(--border-color); font-size: 12px; white-space: nowrap; }
.ns-tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--theme-accent-soft, rgba(0,113,227,.12)); color: var(--txt-accent, var(--theme-accent-strong)); vertical-align: middle; }
.ns-tag.is-warn { background: color-mix(in srgb, var(--txt-warn, #b25e00) 14%, transparent); color: var(--txt-warn, #b25e00); }
.ns-tag.is-ok { background: color-mix(in srgb, var(--txt-ok, #1d7a3a) 14%, transparent); color: var(--txt-ok, #1d7a3a); }
.ns-st { display: inline-block; padding: 3px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.ns-st.is-on { background: color-mix(in srgb, var(--txt-ok, #1d7a3a) 14%, transparent); color: var(--txt-ok, #1d7a3a); }
.ns-st.is-off { background: color-mix(in srgb, var(--txt-bad, #c0262d) 12%, transparent); color: var(--txt-bad, #c0262d); }
.ns-cards { display: none; list-style: none; margin: 0; padding: 0; }
.ns-card { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 12px 14px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 8px; color: var(--text-main); font: inherit; text-align: left; cursor: pointer; }
.ns-cards li + li { margin-top: 8px; }
.ns-card-b { display: grid; gap: 3px; min-width: 0; flex: 1; }
.ns-card-1 { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ns-card-2, .ns-card-3 { font-size: 13px; color: var(--text-muted); overflow-wrap: anywhere; }
.ns-chev { font-size: 22px; color: var(--text-muted); }
.ns-empty { display: grid; justify-items: center; gap: 6px; padding: 36px 16px; text-align: center; background: var(--bg-card); border: 1px dashed var(--border-color); border-radius: 8px; color: var(--text-muted); }
.ns-empty .ns-ic { width: 28px; height: 28px; }
.ns-empty-t { margin: 0; font-weight: 700; color: var(--text-main); font-size: 16px; }
.ns-empty-h { margin: 0 0 6px; font-size: 14px; }
.ns-empty.is-bad .ns-ic { color: var(--txt-bad, #c0262d); }
/* Bảng trượt quản lý quyền */
.ns-sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.36); z-index: 10040; }
.ns-sheet { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100%); z-index: 10050;   /* trên thanh đầu + thanh tab iPhone + toast */ display: flex; flex-direction: column; background: var(--bg-app, var(--bg-card)); color: var(--text-main); box-shadow: -18px 0 48px rgba(0,0,0,.22); }
.ns-sheet-h { display: flex; align-items: center; gap: 12px; padding: calc(16px + env(safe-area-inset-top, 0px)) 18px 16px; border-bottom: 1px solid var(--border-color); background: var(--bg-card); }
.ns-sheet-who { flex: 1; min-width: 0; }
.ns-sheet-who h2 { margin: 0; font-size: 19px; }
.ns-sheet-who p { margin: 2px 0 0; font-size: 13px; color: var(--text-muted); overflow-wrap: anywhere; }
.ns-sheet-b { flex: 1; overflow: auto; padding: 16px 18px; display: grid; gap: 14px; align-content: start; }
.ns-sheet-f { padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border-color); background: var(--bg-card); display: grid; gap: 8px; }
.ns-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 18px; }
.ns-grid1 { display: grid; gap: 12px; }
.ns-f { display: grid; gap: 5px; min-width: 0; border: 0; margin: 0; padding: 0; align-content: start; }
.ns-wide { grid-column: 1 / -1; }
.ns-hint { font-size: 13px; color: var(--text-muted); margin: 0; }
.ns-err { font-size: 13px; font-weight: 600; color: var(--txt-bad, #c0262d); }
.ns-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.ns-end { justify-content: flex-end; }
.ns-chk { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 15px; cursor: pointer; }
.ns-chk input, .ns-q input { width: 20px; height: 20px; accent-color: var(--theme-accent-strong, #0071e3); flex: none; }
.ns-lock { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-card); }
.ns-lock p { margin: 2px 0 0; }
.ns-qhead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.ns-qhead h3, .ns-qhead h2 { margin: 0; font-size: 17px; }
.ns-qgroup { margin: 0; padding: 12px 14px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-card); display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 16px; }
.ns-qgroup legend { font-weight: 700; padding: 0 4px; }
.ns-q { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; padding: 6px 0; cursor: pointer; }
.ns-q > span { display: grid; gap: 2px; min-width: 0; }
.ns-q-t { font-size: 15px; font-weight: 600; }
.ns-q-m { font-size: 13px; color: var(--text-muted); }
.ns-note { font-size: 13px; color: var(--text-muted); margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--bg-card-hover, rgba(0,0,0,.03)); }
.ns-alert { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.ns-alert.is-warn { background: color-mix(in srgb, var(--txt-warn, #b25e00) 12%, transparent); color: var(--text-main); }
.ns-alert.is-warn .ns-ic { color: var(--txt-warn, #b25e00); }
.ns-alert.is-bad { background: color-mix(in srgb, var(--txt-bad, #c0262d) 12%, transparent); color: var(--text-main); }
.ns-alert.is-ok { background: color-mix(in srgb, var(--txt-ok, #1d7a3a) 12%, transparent); color: var(--text-main); }
.ns-alert.is-ok .ns-ic { color: var(--txt-ok, #1d7a3a); }
/* Form + thẻ */
.ns-form { display: grid; gap: 14px; }
.ns-card-f { margin: 0; padding: 16px 18px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 8px; display: grid; gap: 12px; min-width: 0; }
.ns-card-f > legend { font-weight: 700; font-size: 16px; padding: 0 6px; }
.ns-card-f h2 { margin: 0; font-size: 18px; }
.ns-more > summary { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 700; font-size: 16px; cursor: pointer; }
.ns-sticky { position: sticky; bottom: 0; padding: 10px 0; background: linear-gradient(transparent, var(--bg-app, transparent) 30%); }
.ns-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; margin-bottom: 14px; align-items: start; }
.ns-page > .ns-card-f + .ns-card-f { margin-top: 14px; }
.ns-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ns-li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border-color); }
.ns-li-ic { color: var(--text-muted); }
.ns-li-b { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.ns-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; margin: 0; padding-left: 22px; font-size: 16px; }
.ns-audit td { font-size: 13px; }
@media (max-width: 760px) {
  .ns-head h1 { font-size: 22px; }
  .ns-toolbar { padding: 12px; }
  .ns-sel { flex: 1 1 calc(50% - 10px); }
  .ns-toolbar .ns-primary { flex: 1 1 100%; }
  .ns-table-wrap:has(> .ns-table:not(.ns-audit)) { display: none; }
  .ns-cards { display: block; }
  .ns-sheet { width: 100%; }
  .ns-codes { grid-template-columns: 1fr 1fr; }
  .ns-audit thead { display: none; }
  .ns-audit tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 12px; border-bottom: 1px solid var(--border-color); }
  .ns-audit td { padding: 0; border: 0; }
  .ns-audit td:nth-child(3) { font-weight: 700; grid-row: 1; grid-column: 1; }
  .ns-audit td:nth-child(1) { grid-row: 1; grid-column: 2; color: var(--text-muted); font-size: 12px; }
  .ns-audit td:nth-child(2), .ns-audit td:nth-child(4) { grid-column: 1 / -1; color: var(--text-muted); }
}
.ns-tam { font-size: 16px; user-select: all; padding: 1px 6px; border-radius: 6px; background: var(--bg-card); }
.ns-roles { margin-top: 14px; }
.ns-sheet .ns-more > summary { font-size: 15px; }
.ns-nhung { padding: 0; margin-top: 16px; }
.ns-nhung .ns-head h2 { margin: 0; font-size: 20px; }
/* Mục thu gọn (Hồ sơ, Vai trò, Phân quyền chi tiết) khi đóng: chỉ cao bằng dòng tiêu đề */
.ns-more:not([open]) { padding-top: 6px; padding-bottom: 6px; }
body.ns-sheet-mo { overflow: hidden; }   /* khoá cuộn nền khi bảng Quản lý quyền mở */
/* <details> dạng lưới vẫn giữ khoảng trống khi đóng (Chrome/Safari) → dùng khối, cách dòng bằng margin */
.ns-more { display: block; }
.ns-more[open] > :not(summary) { margin-top: 12px; }

/* ── v2: 2 tab, chọn nhiều, chi tiết dưới dòng, accordion quyền, vai trò ── */
.ns-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-color); margin: 0 0 14px; overflow-x: auto; scrollbar-width: none; }
.ns-tabs [role=tab], .ns-ct-tabs [role=tab] { min-height: 44px; padding: 0 16px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--text-muted); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap; margin-bottom: -1px; }
.ns-tabs [role=tab][aria-selected="true"], .ns-ct-tabs [role=tab][aria-selected="true"] { color: var(--text-main); border-bottom-color: var(--theme-accent-strong, #0071e3); }
.ns-tabs [role=tab]:hover, .ns-ct-tabs [role=tab]:hover { color: var(--text-main); }
.ns-page :focus-visible, .ns-sheet :focus-visible { outline: 2px solid var(--theme-accent-strong, #0071e3); outline-offset: 2px; }
.ns-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 10px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--theme-accent-strong, #0071e3); background: var(--theme-accent-soft, rgba(0,113,227,.08)); }
.ns-bulk strong { margin-right: 4px; }
.ns-cb { width: 44px; padding-right: 0 !important; }
.ns-cb input, .ns-card-cb, .ns-acc-chk input { width: 20px; height: 20px; accent-color: var(--theme-accent-strong, #0071e3); cursor: pointer; }
.ns-who { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 4px 0; min-height: 44px; color: var(--text-main); font: inherit; text-align: left; cursor: pointer; }
.ns-who-t { display: inline; }
.ns-who:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.ns-tr { cursor: pointer; }
.ns-tr.is-mo > td { background: var(--theme-accent-soft, rgba(0,113,227,.08)); border-bottom-color: transparent; }
.ns-tr.is-mo > td:first-child { box-shadow: inset 3px 0 0 var(--theme-accent-strong, #0071e3); }
.ns-ct-row > td { padding: 0 !important; background: var(--bg-card); }
.ns-ct { border-top: 1px solid var(--border-color); border-bottom: 2px solid var(--theme-accent-strong, #0071e3); box-shadow: inset 3px 0 0 var(--theme-accent-strong, #0071e3); cursor: default; }
.ns-ct-tabs { display: flex; gap: 2px; padding: 0 14px; border-bottom: 1px solid var(--border-color); overflow-x: auto; scrollbar-width: none; }
.ns-ct-b { padding: 16px 18px; display: grid; gap: 14px; }
.ns-ct-f { padding: 12px 18px 14px; border-top: 1px solid var(--border-color); display: grid; gap: 8px; }
.ns-acts { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.ns-btn.ns-ghost { border-color: transparent; background: none; }
.ns-dls { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 24px; margin: 0; }
.ns-dl { display: grid; gap: 3px; padding-bottom: 8px; border-bottom: 1px solid var(--border-color); min-width: 0; }
.ns-dl dt { font-size: 13px; color: var(--text-muted); }
.ns-dl dd { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.ns-accs { display: grid; gap: 8px; }
.ns-acc { border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-card); scroll-margin-top: 12px; }
.ns-acc.is-mo { border-color: color-mix(in srgb, var(--theme-accent-strong, #0071e3) 45%, var(--border-color)); }
.ns-acc-h { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 14px; }
.ns-acc-chk { flex: 1; display: flex; align-items: center; gap: 12px; min-height: 44px; min-width: 0; cursor: pointer; }
.ns-acc-t { display: grid; gap: 1px; min-width: 0; }
.ns-acc-t strong { font-size: 15px; }
.ns-acc-n { font-size: 13px; font-weight: 700; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.ns-acc-x .ns-ic { transition: transform .18s ease; }
.ns-acc-x[aria-expanded="true"] .ns-ic { transform: rotate(180deg); }
.ns-acc-b { padding: 4px 14px 10px 46px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 18px; border-top: 1px solid var(--border-color); }
.ns-acc-b[hidden] { display: none; }
.ns-lv { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: .02em; background: var(--bg-card-hover, rgba(0,0,0,.05)); border: 1px solid var(--border-color); color: var(--text-muted); vertical-align: 1px; }
.ns-sum { font-size: 14px; line-height: 2; padding: 10px 12px; border-radius: 8px; background: var(--bg-card-hover, rgba(0,0,0,.03)); }
.ns-search-sm { flex: 0 1 260px; min-height: 44px; }
.ns-qhead .ns-search-sm { margin-left: auto; }
.ns-tl { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--border-color); display: grid; gap: 12px; }
.ns-tl li { display: grid; gap: 2px; position: relative; }
.ns-tl li::before { content: ""; position: absolute; left: -20px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--theme-accent-strong, #0071e3); }
.ns-tl-t { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.ns-spin { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--border-color); border-top-color: var(--theme-accent-strong, #0071e3); animation: ns-quay .8s linear infinite; }
@keyframes ns-quay { to { transform: rotate(360deg); } }
.ns-st.is-idle { background: var(--bg-card-hover, rgba(0,0,0,.05)); color: var(--text-muted); }
.ns-li .ns-btn { margin-left: auto; }
.ns-card-li { display: flex; align-items: center; gap: 10px; }
.ns-card-li .ns-card { flex: 1; min-width: 0; }
.ns-card-li .ns-card-cb { flex: none; margin: 0 2px; }
.ns-vt-card { display: grid; gap: 8px; padding: 12px 14px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 8px; }
.ns-roles .ns-c-mota { max-width: 320px; }
.ns-roles .ns-act .ns-row { flex-wrap: nowrap; gap: 8px; }   /* Sửa · Nhân bản · Xóa luôn cùng một hàng */
/* Hộp thoại vai trò: mục lục nhóm quyền bên phải, chân dính */
.ns-sheet-lg { width: min(1080px, 100%); }
.ns-vt-b { grid-template-columns: minmax(0, 1fr) 220px; align-items: start; gap: 18px; }
.ns-vt-main { display: grid; gap: 14px; min-width: 0; }
.ns-vt-nav { position: sticky; top: 0; display: grid; gap: 2px; padding: 10px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-card); }
.ns-vt-nav p { margin: 0 0 4px; }
.ns-vt-nav a { display: flex; justify-content: space-between; gap: 8px; align-items: center; min-height: 40px; padding: 0 8px; border-radius: 8px; color: var(--text-main); text-decoration: none; font-size: 14px; }
.ns-vt-nav a:hover { background: var(--bg-card-hover, rgba(0,0,0,.04)); }
@media (max-width: 1180px) {
  .ns-users .ns-c-login, .ns-roles .ns-c-cn { display: none; }
}
@media (max-width: 1024px) {
  .ns-users .ns-c-phone, .ns-roles .ns-c-mota { display: none; }
  .ns-table th, .ns-table td { padding-left: 10px; padding-right: 10px; }
  .ns-vt-b { grid-template-columns: 1fr; }
  .ns-vt-nav { display: none; }
}
@media (max-width: 760px) {
  .ns-head > .ns-btn { flex: 1 1 100%; }
  .ns-tabs [role=tab] { flex: 1; padding: 0 8px; font-size: 14px; }
  .ns-table-wrap.ns-users, .ns-table-wrap.ns-roles { display: none; }
  .ns-sheet .ns-ct { border: 0; box-shadow: none; display: flex; flex-direction: column; flex: 1; min-height: 0; }
  .ns-sheet .ns-ct-b { flex: 1; overflow: auto; }
  .ns-sheet .ns-ct-f { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--bg-card); }
  .ns-ct-b { padding: 14px; }
  .ns-acc-b { padding-left: 14px; grid-template-columns: 1fr; }
  .ns-qhead .ns-search-sm { margin-left: 0; flex: 1 1 100%; }
  .ns-acts { flex-direction: column; align-items: stretch; }
  .ns-acts .ns-row { justify-content: stretch; }
  .ns-acts .ns-btn { flex: 1 1 auto; }
  .ns-acts .ns-btn.is-nguy.ns-sm { flex: 0 1 auto; align-self: flex-start; }
  .ns-dls { grid-template-columns: 1fr 1fr; }
  .ns-vt-card .ns-row .ns-btn:not(.ns-icon) { flex: 1; }
}
@media (max-width: 420px) { .ns-dls { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  .ns-acc-x .ns-ic { transition: none; }
  .ns-spin { animation-duration: 2.4s; }
}
/* Chi nhánh áp dụng — luôn đầu phần phân quyền (26/09/2026) */
.ns-cn-ad { padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--border-color); }
.ns-cn-ad .ns-row { gap: 8px 20px; }
/* Yêu cầu quên mật khẩu (26/09/2026): danh sách dòng (máy tính: thông tin trái, nút phải; điện thoại ≤760px: xếp dọc, nút đủ 44px). */
.ns-qmk { max-width: 1180px; margin: 0 auto 16px; padding: 14px 16px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 8px; color: var(--text-main); }
.ns-qmk-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ns-qmk-h h2 { margin: 0; font-size: 17px; }
.ns-qmk > .ns-hint { display: block; margin: 4px 0 8px; }
.ns-qmk-ds { list-style: none; margin: 0; padding: 0; }
.ns-qmk-d { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border-color); }
.ns-qmk-ai { display: grid; gap: 2px; min-width: 0; }
.ns-qmk-phu, .ns-qmk-note { font-size: 13px; color: var(--text-muted); overflow-wrap: anywhere; }
.ns-qmk-note { color: var(--text-main); }
.ns-qmk-n { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ns-qmk-hoi { font-size: 13px; font-weight: 600; }
.ns-qmk-tam { margin: 6px 0 10px; }
.ns-qmk-tam-n { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.ns-qmk-cho, .ns-qmk-rong { margin: 8px 0 2px; font-size: 14px; }
@media (max-width: 760px) {
  .ns-qmk { margin: 0 0 12px; padding: 12px; }
  .ns-qmk-d { flex-direction: column; align-items: stretch; }
  .ns-qmk-n { justify-content: flex-start; }
  .ns-qmk-n .ns-btn { flex: 1 1 auto; }
  .ns-qmk-hoi { flex-basis: 100%; }
}

/* ══ P2 (anh Nghĩa chọn 26/09/2026): bảng vận hành gọn + NGĂN BÊN PHẢI cho chi tiết ở mọi khổ màn ══════════════════════════
   Mỗi dòng một thao tác "Quản lý"; ngăn phải rộng 560px (điện thoại: toàn màn), nền mờ nhẹ để danh sách phía sau vẫn đọc được.
   Thao tác một lần ở đầu ngăn, thanh Lưu cố định ở chân khi đang sửa. Hộp xác nhận riêng cho thao tác nguy hiểm. */
.ns-who { cursor: inherit; padding: 0; min-height: 0; }
.ns-who:hover strong { text-decoration: none; }
.ns-tr:hover .ns-who strong { text-decoration: underline; text-underline-offset: 3px; }
.ns-table td.ns-act, .ns-table th.ns-act { width: 1%; white-space: nowrap; text-align: right; }
.ns-btn.ns-quanly { gap: 2px; padding: 0 8px 0 12px; }
.ns-c-login { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ns-c-lh { font-variant-numeric: tabular-nums; }
@media (max-width: 1180px) {
  .ns-users .ns-c-login { display: table-cell; }   /* cột Phiên giữ lại ở tablet */
  .ns-users .ns-c-lh { display: none; }            /* bớt cột phụ: Liên hệ xem trong ngăn */
}
@media (max-width: 1024px) { .ns-users .ns-c-cn .ns-chip + .ns-chip { margin-top: 4px; } }
.ns-sheet-bg { background: rgba(15, 23, 42, .18); }
.ns-sheet.ns-drawer { width: min(560px, 100%); border-left: 1px solid var(--border-color); box-shadow: -8px 0 24px rgba(15, 23, 42, .12); }
.ns-drawer .ns-sheet-h { padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 12px 18px; }
.ns-drawer .ns-sheet-who h2 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 18px; }
.ns-drawer .ns-sheet-who h2 .ns-st { font-size: 12px; }
.ns-sheet .ns-ct { border: 0; box-shadow: none; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.ns-sheet .ns-ct-b { flex: 1; overflow: auto; overscroll-behavior: contain; }
.ns-sheet .ns-ct-f { background: var(--bg-card); padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
.ns-ct-acts { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--border-color); background: var(--bg-card); }
.ns-ct-acts .ns-ghost { margin-left: auto; }
.ns-drawer .ns-ct-tabs { background: var(--bg-card); padding: 0 8px; }
.ns-drawer .ns-ct-tabs [role=tab] { padding: 0 12px; font-size: 14px; }
.ns-h3 { margin: 4px 0 0; font-size: 14px; font-weight: 700; color: var(--text-muted); }
.ns-ct-note { margin: 4px 0 0; }
.ns-qmk-ngan { margin: 0; padding: 0; border: 0; background: none; }
.ns-qmk-ngan .ns-qmk-d:first-child { border-top: 0; padding-top: 0; }
/* Hộp xác nhận */
.ns-hoi-bg { position: fixed; inset: 0; z-index: 10090; background: rgba(15, 23, 42, .32); }
.ns-hoi { position: fixed; z-index: 10100; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, calc(100% - 32px)); box-sizing: border-box;
  padding: 20px; display: grid; gap: 10px; background: var(--bg-card); color: var(--text-main); border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 12px 32px rgba(15, 23, 42, .18); }
.ns-hoi h2 { margin: 0; font-size: 17px; line-height: 1.35; }
.ns-hoi p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-muted); }
.ns-hoi .ns-row { margin-top: 6px; gap: 8px; }
.ns-hoi :focus-visible { outline: 2px solid var(--theme-accent-strong, #0071e3); outline-offset: 2px; }
.ns-btn.ns-primary.is-nguy { background: var(--theme-danger, #c0262d); border-color: var(--theme-danger, #c0262d); color: #fff; }
@media (max-width: 760px) {
  /* Danh sách điện thoại: MỘT bề mặt, các dòng ngăn bằng đường mảnh (không thẻ trong thẻ). */
  .ns-cards { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; }
  .ns-cards li + li { margin-top: 0; border-top: 1px solid var(--border-color); }
  .ns-card-li { padding-left: 12px; gap: 6px; }
  .ns-card-li .ns-card { border: 0; border-radius: 0; background: none; padding: 10px 12px 10px 4px; min-height: 64px; }
  .ns-sheet.ns-drawer { width: 100%; border-left: 0; }
  .ns-ct-acts { padding: 10px 14px; }
  .ns-ct-acts .ns-btn { flex: 1 1 calc(50% - 8px); }
  .ns-ct-acts .ns-ghost { flex: 0 0 44px; margin-left: 0; }
  .ns-hoi .ns-row .ns-btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: no-preference) {
  .ns-drawer { animation: ns-vao .18s ease-out; }
  @keyframes ns-vao { from { transform: translateX(24px); opacity: .6; } }
}
/* Nhãn dài / ngắn (nút trong ngăn), khối Quên mật khẩu thu gọn, tab trong ngăn cuộn ngang được */
.ns-ngan { display: none; }
.ns-sheet-h .ns-ghost { color: var(--text-muted); }
details.ns-qmk > summary { list-style: none; cursor: pointer; min-height: 44px; }
details.ns-qmk > summary::-webkit-details-marker { display: none; }
.ns-qmk-mo { margin-left: auto; display: inline-grid; place-items: center; width: 32px; height: 32px; color: var(--text-muted); }
.ns-qmk-mo .ns-ic { transition: transform .18s ease; }
details.ns-qmk[open] .ns-qmk-mo .ns-ic { transform: rotate(180deg); }
details.ns-qmk:not([open]) { padding-top: 6px; padding-bottom: 6px; }
.ns-drawer .ns-ct-tabs { scroll-padding: 0 24px; }
@media (max-width: 760px) {
  .ns-dai { display: none; }
  .ns-ngan { display: inline; }
  .ns-ct-acts { flex-wrap: nowrap; }
  .ns-ct-acts .ns-btn { flex: 1 1 0; min-width: 0; padding: 0 8px; }
  .ns-drawer .ns-ct-tabs [role=tab] { padding: 0 10px; }
  .ns-qmk .ns-qmk-d { gap: 8px; }
  .ns-qmk-n { flex-wrap: nowrap; }
  .ns-qmk-n .ns-btn { flex: 1 1 0; }
  .ns-qmk > .ns-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) { .ns-qmk-mo .ns-ic { transition: none; } }
/* Nhân viên › Bot Telegram (076, 04/10/2026): người dùng bot + vai trò trong bot (vai-tro-bot.js). Dùng lại bảng / thẻ / form của màn Nhân viên. */
.ns-bot-dau { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 12px; }
.ns-bot-dau .ns-sub { margin: 0; flex: 1 1 320px; }
.ns-bot-loc { margin-bottom: 4px; }
.ns-bot-nut { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.ns-bot-hoi { font-size: 13px; font-weight: 600; }
.ns-tag.is-la { background: var(--bg-card-hover, rgba(0,0,0,.05)); color: var(--text-muted); }
.ns-bot-form { margin-bottom: 14px; }
.ns-bot-form h2 { margin: 0 0 10px; font-size: 18px; }
.ns-bot-form .ns-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ns-bot-form input[readonly] { background: var(--bg-card-hover, transparent); color: var(--text-muted); }
.ns-bot-vai { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.ns-bot-vai-o { align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 8px; min-height: 44px; }
.ns-bot-vai-o > span { display: grid; gap: 2px; }
.ns-bot-ls { padding: 8px 4px 4px; }
.ns-bot-card { display: grid; gap: 8px; padding: 12px 14px; background: var(--bg-card); }
.ns-bot-card .ns-bot-nut { justify-content: flex-start; }
@media (max-width: 760px) {
  .ns-bot-form .ns-grid2 { grid-template-columns: 1fr; }
  .ns-bot-dau .ns-btn { width: 100%; }
  .ns-bot-nut .ns-btn { flex: 1 1 auto; }
}
.ns-bot-bang .ns-bot-nut { flex-wrap: nowrap; }
