/* ============================================================================
   QUẢN LÝ PIC — giao diện v3 (17/10/2026) · prefix qp-
   Thẻ số bấm lọc · thanh công cụ (tìm · loại · brand · sắp xếp · thẻ/bảng) · lưới thẻ PIC
   · bảng (phòng gom theo brand) · NGĂN CHI TIẾT bên phải (#qpNgan, gắn ở body) · form Thêm/Sửa 2 cột
   Màu theo biến của admin (--white, --gray-*) ⇒ sáng/tối tự theo.
   ========================================================================== */
:root, .qp-ngan-nen, .qp-form-modal {
  --qp-the: var(--white, #fff);
  --qp-nen: var(--gray-50, #f8fafc);
  --qp-vien: var(--gray-200, #e2e8f0);
  --qp-vien2: var(--gray-100, #f1f5f9);
  --qp-chu: var(--gray-900, #0f172a);
  --qp-chu2: var(--gray-700, #334155);
  --qp-mo: var(--gray-500, #64748b);
  --qp-tim: #6366f1; --qp-tim2: #8b5cf6;
  --qp-op: #4f46e5; --qp-op-n: #eef2ff;
  --qp-te: #b45309; --qp-te-n: #fef3c7;
  --qp-bong: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px -12px rgba(15,23,42,.14);
  --qp-bong-ro: 0 2px 6px rgba(15,23,42,.06), 0 18px 40px -16px rgba(79,70,229,.32);
}
[data-theme="dark"] :is(:root, .qp-ngan-nen, .qp-form-modal), [data-theme="dark"] {
  --qp-op: #a5b4fc; --qp-op-n: rgba(99,102,241,.18);
  --qp-te: #fcd34d; --qp-te-n: rgba(245,158,11,.16);
  --qp-bong: 0 1px 2px rgba(0,0,0,.35), 0 10px 26px -12px rgba(0,0,0,.6);
  --qp-bong-ro: 0 2px 6px rgba(0,0,0,.4), 0 20px 44px -16px rgba(99,102,241,.4);
}

/* ---------- Thẻ số (bấm để lọc) ---------- */
#page-pics .qp-kpis .qp-kpi { font: inherit; text-align: left; cursor: pointer; width: 100%; color: inherit; }
#page-pics .qp-kpis .qp-kpi:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(99,102,241,.25), var(--p-bong-ro); }
#page-pics .qp-kpis .qp-kpi.on { border-color: var(--ac); box-shadow: 0 0 0 1.5px var(--ac), var(--p-bong-ro); }
#page-pics .qp-kpis .qp-kpi.on::after { content: "\f00c"; font: 900 .6rem "Font Awesome 6 Free"; position: absolute; top: 10px; right: 10px; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--ac), var(--ac2)); }

/* ---------- Thanh công cụ ---------- */
#page-pics .qp-cc { gap: 10px; }
#page-pics .qp-cc .pv2-chon { min-width: 150px; }
.qp-seg { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 11px; background: var(--qp-nen); border: 1px solid var(--qp-vien); flex: none; }
.qp-seg button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: none; color: var(--qp-mo); font-family: inherit; font-weight: 700; font-size: .78rem; line-height: 1; cursor: pointer; white-space: nowrap; transition: background .15s ease, color .15s ease, box-shadow .15s ease; }
.qp-seg button b { font-weight: 800; color: inherit; opacity: .75; }
.qp-seg button:hover { color: var(--qp-chu); }
.qp-seg button.on { background: var(--qp-the); color: var(--qp-tim); box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.qp-seg button:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(99,102,241,.2); }
.qp-seg.nho button { height: 28px; padding: 0 10px; font-size: .74rem; }
.qp-seg-xem button { width: 36px; padding: 0; justify-content: center; }
.qp-dem { display: flex; align-items: center; gap: 10px; margin: -6px 2px 12px; font-size: .78rem; color: var(--qp-mo); }
.qp-dem strong { color: var(--qp-chu); font-weight: 800; }
.qp-boloc { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border: 1px dashed var(--qp-vien); border-radius: 999px; background: none; color: var(--qp-mo); font-family: inherit; font-weight: 700; font-size: .72rem; line-height: 1; cursor: pointer; }
.qp-boloc:hover { color: #dc2626; border-color: #fca5a5; }

/* ---------- Lưới thẻ PIC ---------- */
.qp-luoi { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 14px; }
.qp-luoi[hidden], .qp-bang-the[hidden] { display: none !important; }
.qp-the {
  position: relative; display: flex; flex-direction: column; gap: 12px; min-width: 0;
  padding: 16px; border-radius: 16px; background: var(--qp-the); border: 1px solid var(--qp-vien);
  box-shadow: var(--qp-bong); cursor: pointer; outline: 0;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.qp-the::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; border-radius: 16px 16px 0 0; background: linear-gradient(90deg, var(--qp-tim), var(--qp-tim2)); opacity: 0; transition: opacity .18s ease; }
.qp-the:hover { transform: translateY(-2px); box-shadow: var(--qp-bong-ro); border-color: #c7d2fe; }
.qp-the:hover::before, .qp-the:focus-visible::before { opacity: 1; }
.qp-the:focus-visible { box-shadow: 0 0 0 3px rgba(99,102,241,.25), var(--qp-bong-ro); }
.qp-the.tat { opacity: .72; }
.qp-the.tat .qp-av { filter: grayscale(.8); }
.qp-the-dau { display: flex; align-items: center; gap: 12px; min-width: 0; }
.qp-the-ten { flex: 1; min-width: 0; }
.qp-the-ten > b { display: block; font-size: .98rem; font-weight: 800; color: var(--qp-chu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.qp-the-phu { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 5px; }
.qp-the-so { display: flex; flex-wrap: wrap; gap: 6px; }
.qp-the-so > span { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 8px; background: var(--qp-nen); border: 1px solid var(--qp-vien2); font-size: .74rem; color: var(--qp-mo); font-weight: 600; }
.qp-the-so b { color: var(--qp-chu); font-weight: 800; font-variant-numeric: tabular-nums; }
.qp-so-vt i { font-size: .66rem; }
.qp-so-vt i:first-child { color: var(--qp-op); }
.qp-so-vt i:nth-of-type(2) { color: var(--qp-te); margin-left: 4px; }
.qp-the-than { flex: 1; min-width: 0; }
.qp-the-chan { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px dashed var(--qp-vien); }

/* skeleton */
.qp-the.qp-xuong { cursor: default; gap: 10px; pointer-events: none; }
.qp-the.qp-xuong span { display: block; height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--qp-vien2), var(--qp-vien), var(--qp-vien2)); background-size: 200% 100%; animation: qpXuong 1.2s ease-in-out infinite; }
.qp-the.qp-xuong span:first-child { height: 46px; width: 60%; border-radius: 12px; }
.qp-the.qp-xuong span:last-child { width: 80%; }
@keyframes qpXuong { to { background-position: -200% 0; } }

/* ---------- Ảnh đại diện ---------- */
.qp-av { position: relative; display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; background: var(--qp-nen); box-shadow: 0 0 0 2px var(--qp-the), 0 0 0 3px var(--qp-vien); }
.qp-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.qp-av-chu { width: 100%; height: 100%; display: grid; place-items: center; font-weight: 800; font-size: .78rem; color: #fff; letter-spacing: .02em; background: linear-gradient(135deg, hsl(var(--h,250) 70% 58%), hsl(calc(var(--h,250) + 40) 72% 50%)); }
.qp-av.lon { width: 52px; height: 52px; }
.qp-av.lon .qp-av-chu { font-size: 1rem; }
.qp-av.xl { width: 76px; height: 76px; box-shadow: 0 0 0 3px rgba(255,255,255,.9), 0 10px 24px -8px rgba(15,23,42,.45); }
.qp-av.xl .qp-av-chu { font-size: 1.4rem; }
.qp-av-nut { padding: 0; border: 0; background: none; border-radius: 50%; cursor: zoom-in; flex: none; line-height: 0; transition: transform .15s ease; }
.qp-av-nut:hover { transform: scale(1.04); }
.qp-av-nut:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(99,102,241,.3); }

/* ---------- Nhãn nhỏ ---------- */
.qp-loai { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: .7rem; font-weight: 800; white-space: nowrap; background: var(--qp-nen); color: var(--qp-mo); }
.qp-loai i { font-size: .62rem; }
.qp-loai.op { background: var(--qp-op-n); color: var(--qp-op); }
.qp-loai.tech { background: var(--qp-te-n); color: var(--qp-te); }
.qp-ma { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--qp-vien); background: var(--qp-nen); color: var(--qp-chu2); font: 700 .7rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; cursor: copy; transition: border-color .15s ease, color .15s ease; }
.qp-ma i { font-size: .62rem; opacity: .55; }
.qp-ma:hover { border-color: #a5b4fc; color: var(--qp-tim); }
.qp-ma.nho { display: flex; margin-top: 3px; width: max-content; }
.qp-tt { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 24px; padding: 0 10px; border-radius: 999px; font-size: .7rem; font-weight: 800; white-space: nowrap; }
.qp-tt i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.qp-tt.bat { background: #ecfdf5; color: #047857; }
.qp-tt.bat i { box-shadow: 0 0 0 3px rgba(16,185,129,.2); }
.qp-tt.tat { background: var(--qp-nen); color: var(--qp-mo); }
[data-theme="dark"] .qp-tt.bat { background: rgba(16,185,129,.16); color: #6ee7b7; }

/* Brand + phòng (một dòng / brand) */
.qp-pb { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.qp-pb-d { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.qp-bp { flex: none; display: inline-flex; align-items: center; height: 22px; max-width: 130px; padding: 0 8px; border-radius: 6px; background: var(--bg); color: var(--fg); font-size: .68rem; font-weight: 800; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; }
[data-theme="dark"] .qp-bp { background: color-mix(in srgb, var(--bg) 18%, transparent); color: color-mix(in srgb, var(--fg) 45%, #fff); }
.qp-pb-ds { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.qp-rp { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border-radius: 6px; border: 1px solid var(--qp-vien); background: var(--qp-the); color: var(--qp-chu2); font-size: .7rem; font-weight: 600; white-space: nowrap; }
.qp-rp i { font-size: .58rem; }
.qp-rp.op i { color: var(--qp-op); }
.qp-rp.tech i { color: var(--qp-te); }
.qp-rp.ngung { text-decoration: line-through; opacity: .55; }
.qp-pb-them { font-size: .72rem; font-weight: 700; color: var(--qp-tim); padding-left: 2px; }
.qp-chua-gan { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 8px; background: #fffbeb; color: #b45309; border: 1px dashed #fcd34d; font-size: .74rem; font-weight: 700; }
[data-theme="dark"] .qp-chua-gan { background: rgba(245,158,11,.1); color: #fcd34d; border-color: rgba(245,158,11,.4); }

/* Liên hệ + nút */
.qp-lhs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.qp-lh { display: inline-flex; align-items: center; gap: 5px; height: 28px; min-width: 28px; justify-content: center; padding: 0 8px; border-radius: 8px; background: var(--qp-nen); border: 1px solid var(--qp-vien2); color: var(--qp-chu2); font-size: .72rem; font-weight: 700; text-decoration: none; max-width: 150px; transition: all .15s ease; }
.qp-lh span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qp-lh i { font-size: .7rem; color: var(--qp-tim); }
.qp-lh:hover { border-color: #c7d2fe; color: var(--qp-tim); transform: translateY(-1px); text-decoration: none; }
.qp-mo { color: var(--qp-mo); font-size: .76rem; }
.qp-nuts { display: flex; align-items: center; gap: 6px; flex: none; }
.qp-nut { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 10px; border: 1px solid var(--qp-vien); background: var(--qp-the); color: var(--qp-chu2); cursor: pointer; transition: all .15s ease; }
.qp-nut:hover { border-color: #a5b4fc; color: var(--qp-tim); background: #eef2ff; transform: translateY(-1px); }
.qp-nut.xoa:hover { border-color: #fca5a5; color: #dc2626; background: #fef2f2; }
.qp-nut:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(99,102,241,.22); }
.qp-nut:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.qp-nut.nho { width: 28px; height: 28px; border-radius: 8px; font-size: .74rem; }
[data-theme="dark"] .qp-nut:hover { background: rgba(99,102,241,.16); }
[data-theme="dark"] .qp-nut.xoa:hover { background: rgba(239,68,68,.14); }

/* Trạng thái rỗng */
.qp-trong { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 44px 16px; border-radius: 16px; border: 1.5px dashed var(--qp-vien); background: var(--qp-the); text-align: center; color: var(--qp-mo); font-size: .82rem; }
.qp-trong > i { font-size: 2rem; color: var(--gray-300, #cbd5e1); margin-bottom: 4px; }
.qp-trong b { color: var(--qp-chu); font-size: .95rem; }
.qp-trong .btn { margin-top: 8px; }
.qp-trong.nho { padding: 26px 12px; }
.qp-trong-o { padding: 12px !important; }

/* ---------- Bảng ---------- */
#page-pics .qp-bang td { vertical-align: middle; }
#page-pics .qp-bang tr[data-id] { cursor: pointer; }
#page-pics .qp-bang tr.tat { opacity: .7; }
.qp-o-ten { display: flex; align-items: center; gap: 10px; min-width: 0; }
.qp-o-ten b { display: block; font-weight: 800; color: var(--qp-chu); }
#page-pics .qp-o-pb { min-width: 280px; }

/* ============================================================================
   NGĂN CHI TIẾT
   ========================================================================== */
body.qp-khoa { overflow: hidden; }
.qp-ngan-nen { position: fixed; inset: 0; z-index: 10060;   /* trên thanh tiêu đề (200) + cột nút nổi/khung chat nổi (≤10040), dưới hộp thoại (100000+) */ background: rgba(15,23,42,.42); backdrop-filter: blur(3px); opacity: 0; transition: opacity .2s ease; }
.qp-ngan-nen[hidden] { display: none; }
.qp-ngan-nen.mo { opacity: 1; }
.qp-ngan {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100vw);
  display: flex; flex-direction: column; background: var(--qp-nen); outline: 0;
  box-shadow: -24px 0 60px -20px rgba(15,23,42,.45);
  transform: translateX(28px); opacity: .6; transition: transform .22s cubic-bezier(.2,.8,.2,1), opacity .2s ease;
}
.qp-ngan-nen.mo .qp-ngan { transform: none; opacity: 1; }
.qp-ng-dau {
  flex: none; position: relative; padding: 14px 18px 0; color: #fff;
  background:
    radial-gradient(420px 200px at 100% 0%, rgba(236,72,153,.35), transparent 60%),
    radial-gradient(360px 220px at 0% 100%, rgba(56,189,248,.28), transparent 60%),
    linear-gradient(125deg, #4f46e5, #6366f1 45%, #8b5cf6);
}
.qp-ng-thanh { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qp-ng-vt { font-size: .72rem; font-weight: 700; opacity: .8; font-variant-numeric: tabular-nums; }
.qp-ng-dh { display: flex; gap: 6px; }
.qp-nut.kinh { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.24); color: #fff; backdrop-filter: blur(8px); }
.qp-nut.kinh:hover { background: rgba(255,255,255,.26); color: #fff; border-color: rgba(255,255,255,.4); }
.qp-ng-ho { display: flex; align-items: center; gap: 16px; margin: 12px 0 14px; min-width: 0; }
.qp-ng-av { position: relative; flex: none; }
.qp-ng-cam { position: absolute; right: -2px; bottom: -2px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; border: 2px solid #fff; background: #0f172a; color: #fff; font-size: .7rem; cursor: pointer; transition: transform .15s ease; }
.qp-ng-cam:hover { transform: scale(1.1); }
.qp-ng-ten { min-width: 0; }
.qp-ng-ten h3 { margin: 0 0 8px; font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; color: #fff; overflow-wrap: anywhere; }
.qp-ng-the { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.qp-ng-the .qp-loai { background: rgba(255,255,255,.95); }
.qp-ng-the .qp-loai.op { color: #4f46e5; }
.qp-ng-the .qp-loai.tech { color: #b45309; }
.qp-ma.kinh, .qp-tt.kinh { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); color: #fff; }
.qp-tt.kinh.bat i { background: #6ee7b7; }
.qp-ng-suaanh { display: grid; grid-template-columns: auto 1fr; gap: 8px; margin: -4px 0 14px; padding: 10px; border-radius: 12px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); }
.qp-ng-suaanh .form-control { height: 34px; border-radius: 9px; border: 0; font-size: .8rem; }
.qp-ng-suaanh-nut { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 6px; }
.qp-ng-suaanh .qp-them { background: rgba(255,255,255,.95); }
.qp-ng-suaanh .btn-outline { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.35); }
.qp-ng-so { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.qp-ng-so span { padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); }
.qp-ng-so b { display: block; font-size: 1.15rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.qp-ng-so small { font-size: .68rem; opacity: .85; font-weight: 600; }
.qp-ng-hd { display: flex; gap: 8px; margin-bottom: 12px; }
.qp-ng-hd-n { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; border-radius: 10px; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.14); color: #fff; font-family: inherit; font-weight: 700; font-size: .8rem; line-height: 1; cursor: pointer; transition: all .15s ease; }
.qp-ng-hd-n:first-child { background: #fff; color: #4f46e5; border-color: #fff; }
.qp-ng-hd-n:hover { transform: translateY(-1px); background: rgba(255,255,255,.26); }
.qp-ng-hd-n:first-child:hover { background: #eef2ff; }
.qp-ng-hd-n.xoa:hover { background: #dc2626; border-color: #dc2626; }
.qp-ng-hd-n:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(255,255,255,.45); }
.qp-ng-tabs { display: flex; gap: 4px; margin: 0 -18px; padding: 0 14px; }
.qp-ng-tabs button { display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 14px; border: 0; border-radius: 12px 12px 0 0; background: none; color: rgba(255,255,255,.82); font-family: inherit; font-weight: 700; font-size: .82rem; line-height: 1; cursor: pointer; transition: background .15s ease, color .15s ease; }
.qp-ng-tabs button b { display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 5px; border-radius: 999px; background: rgba(255,255,255,.22); font-size: .66rem; }
.qp-ng-tabs button:hover { color: #fff; background: rgba(255,255,255,.1); }
.qp-ng-tabs button.on { background: var(--qp-nen); color: var(--qp-tim); }
.qp-ng-tabs button.on b { background: var(--qp-op-n); color: var(--qp-tim); }
.qp-ng-than { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 18px 28px; display: flex; flex-direction: column; gap: 12px; }
.qp-ng-cc { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.qp-ng-phong { display: flex; flex-direction: column; gap: 10px; }
.qp-ng-br { padding: 12px; border-radius: 14px; background: var(--qp-the); border: 1px solid var(--qp-vien); box-shadow: var(--qp-bong); }
.qp-ng-br-dau { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.qp-ng-br-dau small { font-size: .72rem; color: var(--qp-mo); font-weight: 600; }
.qp-ng-p { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 10px; transition: background .15s ease; }
.qp-ng-p + .qp-ng-p { border-top: 1px solid var(--qp-vien2); }
.qp-ng-p:hover { background: var(--qp-nen); }
.qp-ng-p.ngung .qp-ng-p-ten b { text-decoration: line-through; opacity: .6; }
.qp-ng-p-ic { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; font-size: .72rem; }
.qp-ng-p-ic.op { background: var(--qp-op-n); color: var(--qp-op); }
.qp-ng-p-ic.tech { background: var(--qp-te-n); color: var(--qp-te); }
.qp-ng-p-ten { flex: 1; min-width: 0; }
.qp-ng-p-ten b { display: block; font-size: .84rem; color: var(--qp-chu); font-weight: 700; }
.qp-ng-p-ten small { font-size: .7rem; color: var(--qp-mo); }
.qp-ng-p-ten em { color: #dc2626; font-style: normal; }

/* khối gán phòng */
.qp-gan { padding: 14px; border-radius: 14px; background: var(--qp-the); border: 1.5px solid #c7d2fe; box-shadow: 0 10px 30px -18px rgba(79,70,229,.5); display: flex; flex-direction: column; gap: 10px; }
.qp-gan[hidden] { display: none; }
.qp-gan-dau { display: flex; align-items: center; justify-content: space-between; font-size: .84rem; color: var(--qp-chu); }
.qp-gan-dau b i { color: var(--qp-tim); }
.qp-gan-hang { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.qp-gan-hang select { flex: 1 1 180px; height: 36px; border-radius: 10px; border: 1.5px solid var(--qp-vien); font-size: .82rem; }
.qp-gan-tim { position: relative; margin-bottom: 8px; }
.qp-gan-tim i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); font-size: .74rem; color: var(--qp-mo); }
.qp-gan-tim input { width: 100%; height: 34px; padding: 0 10px 0 30px; border-radius: 9px; border: 1.5px solid var(--qp-vien); background: var(--qp-the); color: var(--qp-chu); font-size: .8rem; }
.qp-gan-tim input:focus { outline: 0; border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99,102,241,.14); }
.qp-gan-ds { max-height: 260px; overflow-y: auto; }
.qp-gan-luoi { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.qp-gan-p { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1.5px solid var(--qp-vien); background: var(--qp-the); cursor: pointer; transition: all .15s ease; min-width: 0; }
.qp-gan-p input { accent-color: var(--qp-tim); flex: none; }
.qp-gan-p span { min-width: 0; }
.qp-gan-p b { display: block; font-size: .78rem; color: var(--qp-chu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qp-gan-p small { font-size: .66rem; color: var(--qp-mo); }
.qp-gan-p:hover { border-color: #a5b4fc; }
.qp-gan-p.on { border-color: var(--qp-tim); background: var(--qp-op-n); }
.qp-gan-p.da { opacity: .5; cursor: not-allowed; }
.qp-gan-chan { display: flex; justify-content: flex-end; }

/* tab Thông tin */
.qp-ng-nhom { padding: 14px; border-radius: 14px; background: var(--qp-the); border: 1px solid var(--qp-vien); box-shadow: var(--qp-bong); }
.qp-ng-nhom h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--qp-mo); }
.qp-ng-dong { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.qp-ng-dong + .qp-ng-dong { border-top: 1px solid var(--qp-vien2); }
.qp-ng-dong > div { flex: 1; min-width: 0; }
.qp-ng-dong small { display: block; font-size: .68rem; color: var(--qp-mo); font-weight: 600; }
.qp-ng-dong span, .qp-ng-dong a { font-size: .86rem; font-weight: 700; color: var(--qp-chu); overflow-wrap: anywhere; }
.qp-ng-ic { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--qp-op-n); color: var(--qp-tim); font-size: .78rem; }
.qp-ng-urls { display: flex; flex-direction: column; gap: 6px; }
.qp-ng-url { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--qp-vien); color: var(--qp-chu); text-decoration: none; transition: all .15s ease; min-width: 0; }
.qp-ng-url i { color: var(--qp-tim); font-size: .74rem; }
.qp-ng-url span { min-width: 0; }
.qp-ng-url b { display: block; font-size: .82rem; }
.qp-ng-url small { display: block; font-size: .68rem; color: var(--qp-mo); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qp-ng-url:hover { border-color: #a5b4fc; background: var(--qp-nen); text-decoration: none; }
.qp-ng-mota { font-size: .86rem; line-height: 1.6; color: var(--qp-chu2); overflow-wrap: anywhere; }
.qp-ng-mota img { max-width: 100%; height: auto; border-radius: 8px; }

/* hộp xác nhận */
.qp-xn { text-align: left; }
.qp-xn p { margin: 8px 0; }
.qp-xn-ho { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--gray-50, #f8fafc); border: 1px solid var(--gray-200, #e2e8f0); }
.qp-xn-ho b { display: block; }
.qp-xn-ho small { color: var(--gray-500, #64748b); }
.qp-xn-o { display: flex; flex-wrap: wrap; gap: 6px; }
.qp-xn-o span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; background: var(--gray-50, #f8fafc); border: 1px solid var(--gray-200, #e2e8f0); font-size: .8rem; font-weight: 600; }
.qp-xn-canh { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: #fef2f2; color: #991b1b; font-size: .8rem; border: 1px solid #fecaca; }
[data-theme="dark"] .qp-xn-canh { background: rgba(239,68,68,.12); color: #fca5a5; border-color: rgba(239,68,68,.35); }

/* ============================================================================
   FORM THÊM / SỬA
   ========================================================================== */
#adminModal.qp-form-modal > .modal { max-width: min(95vw, 880px) !important; }
#adminModal.qp-form-modal .modal-body { background: var(--qp-nen); padding: 18px 20px; }
.qp-form { display: flex; flex-direction: column; gap: 14px; }
.qp-form-tren { display: grid; grid-template-columns: 200px 1fr; gap: 18px; padding: 16px; border-radius: 16px; background: var(--qp-the); border: 1px solid var(--qp-vien); box-shadow: var(--qp-bong); }
.qp-form-anh { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.qp-anh-o { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; padding: 14px 10px; border-radius: 14px; border: 1.5px dashed var(--qp-vien); cursor: pointer; text-align: center; transition: border-color .15s ease, background .15s ease; }
.qp-anh-o:hover, .qp-anh-o.drag-over { border-color: #818cf8; background: var(--qp-op-n); }
.qp-anh-o small { font-size: .68rem; color: var(--qp-mo); line-height: 1.4; }
.qp-anh-tron { position: relative; width: 104px; height: 104px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; box-shadow: 0 0 0 4px var(--qp-the), 0 0 0 5px var(--qp-vien), 0 12px 24px -12px rgba(15,23,42,.4); }
.qp-anh-tron img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.qp-anh-tron img[hidden], .qp-anh-chu[hidden], .qp-anh-xoa[hidden] { display: none; }
.qp-anh-chu { width: 100%; height: 100%; display: grid; place-items: center; font-size: 2rem; color: #fff; background: linear-gradient(135deg, hsl(var(--h,250) 70% 60%), hsl(calc(var(--h,250) + 40) 72% 50%)); }
.qp-anh-phu { position: absolute; inset: auto 0 0; height: 32px; display: grid; place-items: center; background: rgba(15,23,42,.55); color: #fff; font-size: .8rem; opacity: 0; transition: opacity .15s ease; }
.qp-anh-o:hover .qp-anh-phu { opacity: 1; }
.qp-anh-link { width: 100%; }
.qp-anh-link .form-control { height: 34px; font-size: .74rem; border-radius: 9px; }
.qp-form-o { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; align-content: start; min-width: 0; }
.qp-truong { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.qp-truong.qp-rong2 { grid-column: 1 / -1; }
.qp-truong > label { font-size: .74rem; font-weight: 700; color: var(--qp-chu2); margin: 0; }
.qp-form .form-control { height: 40px; border: 1.5px solid var(--qp-vien); border-radius: 10px; background: var(--qp-the); color: var(--qp-chu); font-size: .86rem; transition: border-color .15s ease, box-shadow .15s ease; }
.qp-form .form-control:focus { outline: 0; border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.qp-form .qp-loi, .qp-form .form-control.qp-loi { border-color: #ef4444 !important; box-shadow: 0 0 0 3px rgba(239,68,68,.14) !important; animation: qpRung .3s ease; }
@keyframes qpRung { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.qp-chi-doc { height: 40px; display: flex; align-items: center; padding: 0 12px; border-radius: 10px; background: var(--qp-nen); border: 1.5px dashed var(--qp-vien); color: var(--qp-mo); font-size: .84rem; font-weight: 600; }
.qp-loai-chon { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; border-radius: 12px; }
.qp-loai-the { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--qp-vien); background: var(--qp-the); cursor: pointer; transition: all .15s ease; margin: 0; }
.qp-loai-the input { position: absolute; opacity: 0; pointer-events: none; }
.qp-loai-the > i { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--qp-nen); color: var(--qp-mo); }
.qp-loai-the b { display: block; font-size: .86rem; color: var(--qp-chu); }
.qp-loai-the small { display: block; font-size: .7rem; color: var(--qp-mo); }
.qp-loai-the:hover { border-color: #a5b4fc; }
.qp-loai-the:focus-within { box-shadow: 0 0 0 3px rgba(99,102,241,.16); }
.qp-loai-the.op.on { border-color: #6366f1; background: var(--qp-op-n); }
.qp-loai-the.op.on > i { background: #6366f1; color: #fff; }
.qp-loai-the.tech.on { border-color: #f59e0b; background: var(--qp-te-n); }
.qp-loai-the.tech.on > i { background: #f59e0b; color: #fff; }
.qp-form-muc { padding: 14px 16px; border-radius: 16px; background: var(--qp-the); border: 1px solid var(--qp-vien); box-shadow: var(--qp-bong); }
.qp-form-muc-dau { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.qp-form-muc-dau > span { font-size: .78rem; font-weight: 800; color: var(--qp-chu2); text-transform: uppercase; letter-spacing: .04em; }
.qp-form-muc-dau > span i { color: var(--qp-tim); margin-right: 4px; }
.qp-them { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 9px; border: 1px solid #c7d2fe; background: #eef2ff; color: #4f46e5; font-family: inherit; font-weight: 700; font-size: .76rem; line-height: 1; cursor: pointer; transition: all .15s ease; }
.qp-them:hover { background: #e0e7ff; transform: translateY(-1px); }
.qp-them.xoa { border-color: #fecaca; background: #fef2f2; color: #dc2626; }
[data-theme="dark"] .qp-them { background: rgba(99,102,241,.16); border-color: rgba(99,102,241,.4); color: #c7d2fe; }
[data-theme="dark"] .qp-them.xoa { background: rgba(239,68,68,.14); border-color: rgba(239,68,68,.4); color: #fca5a5; }
.qp-urls { display: flex; flex-direction: column; gap: 8px; }
.qp-url-row { display: grid; grid-template-columns: 160px 1fr 34px; gap: 8px; align-items: center; }
.qp-urls-trong { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 10px; border: 1.5px dashed var(--qp-vien); color: var(--qp-mo); font-size: .78rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  #page-pics .qp-cc .pv2-chon { min-width: 130px; }
  .qp-form-tren { grid-template-columns: 170px 1fr; }
}
@media (max-width: 767px) {
  #page-pics .qp-cc { flex-direction: row !important; flex-wrap: wrap; align-items: center; }
  #page-pics .qp-cc .pv2-tim-kiem { flex: 1 1 100% !important; }
  #page-pics .qp-cc .pv2-chon { flex: 1 1 140px; width: auto !important; }
  #page-pics .qp-cc #picLoaiSeg { flex: 1 1 100%; }
  #page-pics .qp-cc #picLoaiSeg button { flex: none; }
  .qp-luoi { grid-template-columns: minmax(0, 1fr); }
  .qp-ngan { width: 100vw; }
  .qp-ng-so { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .qp-form-tren { grid-template-columns: minmax(0, 1fr); }
  .qp-form-anh { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; justify-items: start; gap: 6px 14px; }
  .qp-anh-o { grid-row: 1 / span 2; width: auto; padding: 6px; }
  .qp-anh-tron { width: 84px; height: 84px; }
  .qp-anh-goiy { text-align: left; }
  .qp-form-o { grid-template-columns: minmax(0, 1fr); }
  .qp-url-row { grid-template-columns: minmax(0, 1fr) 34px; }
  .qp-url-row .pic-url-value { grid-column: 1; grid-row: 2; }
  .qp-url-row .pic-url-remove { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
  #adminModal.qp-form-modal .modal-body { padding: 12px; }
}
@media (max-width: 480px) {
  .qp-the { padding: 14px; }
  .qp-av.lon { width: 46px; height: 46px; }
  .qp-the-chan { flex-wrap: wrap; }
  .qp-nut { width: 36px; height: 36px; }
  .qp-ng-dau { padding: 12px 14px 0; }
  .qp-ng-than { padding: 14px 12px 24px; }
  .qp-ng-ten h3 { font-size: 1.12rem; }
  .qp-av.xl { width: 64px; height: 64px; }
  .qp-ng-so b { font-size: 1rem; }
  .qp-ng-hd-n { font-size: .74rem; }
  .qp-ng-tabs button { padding: 0 10px; font-size: .76rem; }
  .qp-loai-chon { grid-template-columns: minmax(0, 1fr); }
  .qp-form .form-control { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .qp-the, .qp-ngan, .qp-ngan-nen, .qp-nut { transition: none !important; }
}

/* ============================================================================
   (17/10 b) CHỨC VỤ · BỘ CHỌN ẢNH · NÚT ĐỔI ẢNH
   ========================================================================== */
/* chip chức vụ — màu riêng từng chức vụ (--c) */
.qp-cv { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: .7rem; font-weight: 800; white-space: nowrap;
  color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--qp-the)); border: 1px solid color-mix(in srgb, var(--c) 28%, transparent); }
.qp-cv i { font-size: .62rem; }
.qp-cv.chinh { box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--c) 55%, transparent); }
.qp-cv.them { --c: #64748b; }
.qp-cv.kinh { background: rgba(255,255,255,.95); border-color: transparent; }
[data-theme="dark"] .qp-cv { color: color-mix(in srgb, var(--c) 55%, #fff); background: color-mix(in srgb, var(--c) 22%, transparent); }
[data-theme="dark"] .qp-cv.kinh { color: var(--c); background: rgba(255,255,255,.95); }
.qp-cvs { display: flex; flex-wrap: wrap; gap: 4px; }

/* thanh lọc chức vụ: cuộn ngang khi nhiều */
#page-pics #picLoaiSeg { max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
#picLoaiSeg button i { color: var(--c, currentColor); }
#picLoaiSeg button b { font-size: .68rem; min-width: 16px; text-align: center; }
#picLoaiSeg button.rong { opacity: .55; }
#picLoaiSeg button.on { color: var(--c, var(--qp-tim)); box-shadow: 0 1px 3px rgba(15,23,42,.12), inset 0 -2px 0 var(--c, var(--qp-tim)); }

/* form: chọn chức vụ */
.qp-truong > label { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.qp-truong > label .qp-nhan-phu { font-weight: 600; color: var(--qp-mo); margin-left: 4px; }
.qp-lk { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border: 0; border-radius: 7px; background: none; color: var(--qp-tim); font-family: inherit; font-size: .72rem; font-weight: 700; cursor: pointer; }
.qp-lk:hover { background: var(--qp-op-n); }
.qp-cv-chon { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px; border-radius: 12px; border: 1.5px solid var(--qp-vien); background: var(--qp-nen); }
.qp-cv-c { position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--qp-vien); background: var(--qp-the); color: var(--qp-chu2); font-family: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; transition: all .15s ease; }
.qp-cv-c > i:first-child { color: var(--c); }
.qp-cv-c:hover { border-color: color-mix(in srgb, var(--c) 50%, transparent); transform: translateY(-1px); }
.qp-cv-c:focus-visible { outline: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); }
.qp-cv-c.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--qp-the)); color: var(--qp-chu); }
.qp-cv-c.chinh { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.qp-cv-chinh { font-style: normal; font-size: .6rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 2px 6px; border-radius: 5px; color: #fff; background: var(--c); }
.qp-cv-sao { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; color: var(--qp-mo); font-size: .7rem; }
.qp-cv-sao:hover { color: #f59e0b; background: #fef3c7; }
.qp-cv-v { font-size: .66rem; color: var(--c); }
.qp-cv-nhom { flex-basis: 100%; font-size: .72rem; color: var(--qp-mo); }
.qp-cv-nhom b { color: var(--qp-chu2); }
.qp-cv-chon.qp-loi { border-color: #ef4444; }

/* form: ô ảnh (bấm mở bộ chọn ảnh) */
.qp-anh-o { appearance: none; background: none; font-family: inherit; color: inherit; }
.qp-anh-o:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(99,102,241,.22); }
.qp-anh-phu { inset: 0 !important; height: auto !important; flex-direction: column; gap: 2px; display: flex !important; align-items: center; justify-content: center; font-size: 1rem !important; background: rgba(15,23,42,.5) !important; }
.qp-anh-phu em { font-style: normal; font-size: .66rem; font-weight: 700; }
.qp-anh-o:focus-visible .qp-anh-phu { opacity: 1; }
.qp-anh-nut { display: flex; gap: 6px; justify-content: center; }
.qp-anh-nut [hidden] { display: none; }
.qp-anh-goiy { font-size: .66rem; color: var(--qp-mo); text-align: center; line-height: 1.45; }

/* ngăn chi tiết: nút đổi ảnh (sửa lỗi hiển thị) */
.qp-ng-av { line-height: 0; }
.qp-ng-cam {
  position: absolute; right: -4px; bottom: -4px; z-index: 3; box-sizing: border-box;
  width: 30px !important; height: 30px !important; min-width: 0; padding: 0 !important; margin: 0;
  display: grid !important; place-items: center; border-radius: 50% !important;
  border: 2px solid #fff !important; background: linear-gradient(135deg, #6366f1, #8b5cf6) !important; color: #fff !important;
  font-size: 12px !important; line-height: 1 !important; box-shadow: 0 4px 12px rgba(15,23,42,.35); cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.qp-ng-cam i { font-size: 12px; line-height: 1; margin: 0; width: auto; }
.qp-ng-cam:hover { transform: scale(1.1); box-shadow: 0 6px 16px rgba(79,70,229,.5); }
.qp-ng-cam:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(255,255,255,.6); }

/* ---------- Hộp nổi dùng chung ---------- */
.qp-hop-nen { position: fixed; inset: 0; z-index: 100120; display: grid; place-items: center; padding: 16px; background: rgba(15,23,42,.5); backdrop-filter: blur(4px); opacity: 0; transition: opacity .18s ease; }
.qp-hop-nen.mo { opacity: 1; }
.qp-hop { width: min(560px, 100%); max-height: min(90vh, 760px); display: flex; flex-direction: column; border-radius: 18px; background: var(--qp-the); color: var(--qp-chu); box-shadow: 0 30px 80px -20px rgba(15,23,42,.55); outline: 0; overflow: hidden;
  transform: translateY(10px) scale(.98); transition: transform .2s cubic-bezier(.2,.8,.2,1); }
.qp-hop-nen.mo .qp-hop { transform: none; }
.qp-hop-dau { flex: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; border-bottom: 1px solid var(--qp-vien2); }
.qp-hop-dau b { display: block; font-size: 1rem; font-weight: 800; }
.qp-hop-dau b i { color: var(--qp-tim); margin-right: 6px; }
.qp-hop-dau small { display: block; margin-top: 2px; font-size: .74rem; color: var(--qp-mo); }
.qp-hop-than { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 18px; }
.qp-hop-chan { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--qp-vien2); background: var(--qp-nen); }
.qp-hop-chan .qp-mo { flex: 1; color: #dc2626; }
.qp-chan-phai { display: flex; gap: 8px; margin-left: auto; }

/* quản lý chức vụ */
.qp-cvql { width: min(720px, 100%); }
.qp-cvql-ds { display: flex; flex-direction: column; gap: 8px; }
.qp-cvql-d { position: relative; display: grid; grid-template-columns: 28px 40px minmax(0, 1fr) 150px 56px 28px; gap: 8px; align-items: center; padding: 8px; border-radius: 12px; border: 1px solid var(--qp-vien); background: var(--qp-the); }
.qp-cvql-thu { display: flex; flex-direction: column; gap: 2px; }
.qp-cvql-thu .qp-nut { width: 26px; height: 18px; border-radius: 5px; font-size: .58rem; }
.qp-cvql-ic { width: 40px; height: 40px; border-radius: 11px; border: 0; display: grid; place-items: center; color: #fff; background: var(--c); cursor: pointer; box-shadow: 0 4px 12px -4px var(--c); transition: transform .15s ease; }
.qp-cvql-ic:hover { transform: scale(1.06); }
.qp-cvql-d .form-control { height: 38px; border: 1.5px solid var(--qp-vien); border-radius: 10px; background: var(--qp-the); color: var(--qp-chu); font-size: .84rem; }
.qp-cvql-d .form-control:focus { outline: 0; border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.qp-cvql-d select:disabled { opacity: .7; cursor: not-allowed; }
.qp-cvql-so { font-size: .72rem; color: var(--qp-mo); font-weight: 700; text-align: center; }
.qp-cvql-pop { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 10px; padding: 10px; border-radius: 10px; background: var(--qp-nen); border: 1px solid var(--qp-vien2); }
.qp-cvql-mau { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.qp-cvql-mau button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--qp-the); background: var(--c); box-shadow: 0 0 0 1px var(--qp-vien); cursor: pointer; }
.qp-cvql-mau button.on { box-shadow: 0 0 0 2px var(--c); }
.qp-cvql-mau label { position: relative; width: 26px; height: 26px; border-radius: 50%; overflow: hidden; background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); cursor: pointer; }
.qp-cvql-mau input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.qp-cvql-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 4px; }
.qp-cvql-icons button { height: 34px; border-radius: 9px; border: 1px solid var(--qp-vien); background: var(--qp-the); color: var(--qp-chu2); cursor: pointer; }
.qp-cvql-icons button:hover { border-color: #a5b4fc; color: var(--qp-tim); }
.qp-cvql-icons button.on { background: var(--qp-tim); color: #fff; border-color: var(--qp-tim); }
.qp-cvql-them { width: 100%; margin-top: 10px; height: 42px; border-radius: 12px; border: 1.5px dashed #a5b4fc; background: var(--qp-op-n); color: var(--qp-tim); font-family: inherit; font-size: .84rem; font-weight: 800; cursor: pointer; transition: all .15s ease; }
.qp-cvql-them:hover { border-style: solid; transform: translateY(-1px); }

/* bộ chọn ảnh */
.qp-anhhop { width: min(520px, 100%); }
.qp-anhhop.keo { box-shadow: 0 0 0 3px #818cf8, 0 30px 80px -20px rgba(15,23,42,.55); }
.qp-anh-tabs { flex: none; display: flex; gap: 4px; padding: 10px 18px 0; border-bottom: 1px solid var(--qp-vien2); }
.qp-anh-tabs button { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--qp-mo); font-family: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; }
.qp-anh-tabs button.on { color: var(--qp-tim); border-bottom-color: var(--qp-tim); }
.qp-anh-p[hidden] { display: none; }
.qp-anh-tha { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 34px 18px; border-radius: 16px; border: 2px dashed var(--qp-vien); background: var(--qp-nen); text-align: center; cursor: pointer; transition: all .18s ease; }
.qp-anh-tha[hidden] { display: none; }
.qp-anh-tha:hover, .qp-anhhop.keo .qp-anh-tha { border-color: #818cf8; background: var(--qp-op-n); }
.qp-anh-tha-ic { width: 64px; height: 64px; display: grid; place-items: center; margin-bottom: 4px; border-radius: 18px; font-size: 1.6rem; color: #fff; background: linear-gradient(135deg, #6366f1, #8b5cf6); box-shadow: 0 12px 24px -10px rgba(99,102,241,.7); }
.qp-anh-tha b { font-size: .95rem; color: var(--qp-chu); }
.qp-anh-tha > span:not(.qp-anh-tha-ic) { font-size: .8rem; color: var(--qp-mo); }
.qp-anh-tha u { color: var(--qp-tim); text-decoration: none; font-weight: 700; }
.qp-anh-tha small { font-size: .7rem; color: var(--qp-mo); opacity: .85; }
.qp-hop kbd { display: inline-block; padding: 1px 5px; border-radius: 5px; border: 1px solid var(--qp-vien); border-bottom-width: 2px; background: var(--qp-the); font: 700 .68rem ui-monospace, Menlo, Consolas, monospace; color: var(--qp-chu2); }
.qp-cat[hidden] { display: none; }
.qp-cat { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.qp-cat-khung { position: relative; width: var(--v); height: var(--v); border-radius: 14px; overflow: hidden; cursor: grab; touch-action: none; background: repeating-conic-gradient(#e2e8f0 0 25%, #f8fafc 0 50%) 0 0/16px 16px; outline: 0; }
.qp-cat-khung:active { cursor: grabbing; }
.qp-cat-khung:focus-visible { box-shadow: 0 0 0 3px rgba(99,102,241,.3); }
.qp-cat-khung canvas { width: 100%; height: 100%; display: block; }
.qp-cat-mat { position: absolute; inset: 0; pointer-events: none; border-radius: 50%; box-shadow: 0 0 0 999px rgba(15,23,42,.55); outline: 2px solid rgba(255,255,255,.9); outline-offset: -2px; }
.qp-cat-luoi { position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background: linear-gradient(90deg, transparent calc(33.33% - .5px), #fff calc(33.33% - .5px), #fff calc(33.33% + .5px), transparent calc(33.33% + .5px), transparent calc(66.66% - .5px), #fff calc(66.66% - .5px), #fff calc(66.66% + .5px), transparent calc(66.66% + .5px)),
              linear-gradient(0deg, transparent calc(33.33% - .5px), #fff calc(33.33% - .5px), #fff calc(33.33% + .5px), transparent calc(33.33% + .5px), transparent calc(66.66% - .5px), #fff calc(66.66% - .5px), #fff calc(66.66% + .5px), transparent calc(66.66% + .5px)); }
.qp-cat-dk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.qp-cat-zoom { width: 150px; accent-color: var(--qp-tim); }
.qp-cat-gach { width: 1px; height: 22px; background: var(--qp-vien); }
.qp-cat-goiy { margin: 0; font-size: .72rem; color: var(--qp-mo); }
.qp-anh-link2 { display: flex; flex-direction: column; gap: 12px; }
.qp-anh-link2 .form-control { height: 42px; border: 1.5px solid var(--qp-vien); border-radius: 11px; background: var(--qp-the); color: var(--qp-chu); font-size: .86rem; }
.qp-anh-link2 .form-control:focus { outline: 0; border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.qp-anh-xt { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 12px; background: var(--qp-nen); border: 1px solid var(--qp-vien2); }
.qp-anh-xt-o { position: relative; width: 84px; height: 84px; flex: none; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--qp-the); color: var(--gray-300, #cbd5e1); font-size: 1.6rem; box-shadow: 0 0 0 1px var(--qp-vien); }
.qp-anh-xt-o img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.qp-anh-xt-o img[hidden] { display: none; }
.qp-anh-xt-tt { font-size: .78rem; color: var(--qp-chu2); font-weight: 600; }
[data-theme="dark"] .qp-cat-khung { background: repeating-conic-gradient(#1e293b 0 25%, #0f172a 0 50%) 0 0/16px 16px; }

@media (max-width: 767px) {
  .qp-cvql-d { grid-template-columns: 28px 40px minmax(0, 1fr) 28px; }
  .qp-cvql-nhom { grid-column: 3; grid-row: 2; }
  .qp-cvql-so { grid-column: 2; grid-row: 2; }
  .qp-cvql-d .xoa { grid-column: 4; grid-row: 1; }
  .qp-hop-nen { padding: 0; place-items: end stretch; }
  .qp-hop { width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; }
}
@media (max-width: 480px) {
  .qp-hop-chan { flex-wrap: wrap; }
  .qp-hop-chan > .qp-them { order: 2; }
  .qp-chan-phai { width: 100%; }
  .qp-chan-phai .btn { flex: 1; }
  .qp-cat-zoom { width: 110px; }
  .qp-anh-tha { padding: 24px 12px; }
  .qp-anh-link2 .form-control { font-size: 16px; }
}

/* ============================================================================
   (17/10 c) POPUP THÔNG BÁO / XÁC NHẬN · PIC TỪ TÀI KHOẢN HỆ THỐNG
   ========================================================================== */
/* popup luôn ở GIỮA màn hình (kể cả điện thoại — không thành tấm trượt dưới) */
.qp-hop-nen.giua { place-items: center !important; padding: 16px !important; }
.qp-hop.qp-tb { position: relative; width: min(400px, 100%); border-radius: 20px !important; text-align: center; }
.qp-tb-than { padding: 26px 24px 8px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.qp-tb-ic { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; font-size: 1.7rem; margin-bottom: 4px;
  color: var(--k); background: color-mix(in srgb, var(--k) 12%, var(--qp-the)); box-shadow: 0 0 0 8px color-mix(in srgb, var(--k) 6%, transparent); animation: qpNay .35s cubic-bezier(.34,1.56,.64,1); }
@keyframes qpNay { from { transform: scale(.6); opacity: 0; } }
.qp-tb.k-ok { --k: #10b981; } .qp-tb.k-loi { --k: #ef4444; } .qp-tb.k-canh { --k: #f59e0b; }
.qp-tb.k-info { --k: #6366f1; } .qp-tb.k-hoi { --k: #6366f1; } .qp-tb.k-nguy { --k: #ef4444; }
.qp-tb h3 { margin: 0; font-size: 1.08rem; font-weight: 800; color: var(--qp-chu); letter-spacing: -.01em; }
.qp-tb p { margin: 0; font-size: .88rem; line-height: 1.55; color: var(--qp-chu2); overflow-wrap: anywhere; }
.qp-tb-nd { width: 100%; font-size: .86rem; line-height: 1.55; color: var(--qp-chu2); text-align: left; }
.qp-tb-nd > p { text-align: center; }
.qp-tb-chan { display: flex; justify-content: center; gap: 10px; padding: 16px 24px 22px; }
.qp-tb-chan .btn { min-width: 120px; height: 40px; border-radius: 11px; font-weight: 700; justify-content: center; }
.qp-tb-chay { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--k); transform-origin: left; animation: qpChay var(--ms) linear forwards; }
.qp-tb-chay.dung { animation-play-state: paused; opacity: .35; }
@keyframes qpChay { to { transform: scaleX(0); } }
.qp-xn { text-align: left; }
@media (max-width: 480px) {
  .qp-tb-chan { flex-direction: column-reverse; }
  .qp-tb-chan .btn { width: 100%; }
}

/* chip tài khoản liên kết */
.qp-tk { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: .7rem; font-weight: 700; white-space: nowrap;
  color: #0e7490; background: #ecfeff; border: 1px solid #a5f3fc; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.qp-tk i { font-size: .62rem; }
.qp-tk.tat { color: #64748b; background: var(--qp-nen); border-color: var(--qp-vien); }
.qp-tk.loi { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.qp-tk.nho { display: flex; width: max-content; margin-top: 3px; }
.qp-tk.kinh { color: #fff; background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.28); }
[data-theme="dark"] .qp-tk { color: #67e8f9; background: rgba(8,145,178,.16); border-color: rgba(34,211,238,.3); }

/* form: nguồn thông tin */
.qp-nguon { padding: 12px; border-radius: 16px; background: var(--qp-the); border: 1px solid var(--qp-vien); box-shadow: var(--qp-bong); display: flex; flex-direction: column; gap: 10px; }
.qp-nguon-seg { width: 100%; }
.qp-nguon-seg button { flex: 1; justify-content: center; height: 38px; font-size: .82rem; }
.qp-tk-goiy { margin: 0; font-size: .78rem; color: var(--qp-mo); display: flex; gap: 8px; align-items: flex-start; }
.qp-tk-goiy i { color: var(--qp-tim); margin-top: 3px; }
.qp-tk-tim { position: relative; }
.qp-tk-tim i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--qp-mo); font-size: .8rem; }
.qp-tk-tim input { width: 100%; height: 40px; padding: 0 12px 0 34px; border-radius: 10px; border: 1.5px solid var(--qp-vien); background: var(--qp-the); color: var(--qp-chu); font-size: .86rem; font-family: inherit; }
.qp-tk-tim input:focus { outline: 0; border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.qp-tk-ds { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: 2px; }
.qp-tk-cho { padding: 18px; text-align: center; }
.qp-tk-d { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 11px; border: 1px solid transparent; background: none; text-align: left; font-family: inherit; color: inherit; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.qp-tk-d:hover:not([disabled]), .qp-tk-d:focus-visible { background: var(--qp-op-n); border-color: #c7d2fe; outline: 0; }
.qp-tk-d[disabled] { cursor: not-allowed; opacity: .55; }
.qp-tk-d.tat .qp-av { filter: grayscale(1); }
.qp-tk-d-ten { flex: 1; min-width: 0; }
.qp-tk-d-ten b { display: block; font-size: .86rem; color: var(--qp-chu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qp-tk-d-ten small { display: block; font-size: .72rem; color: var(--qp-mo); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qp-tk-d-phai { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.qp-tk-vt { font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; padding: 2px 7px; border-radius: 6px; background: var(--qp-nen); color: var(--qp-mo); border: 1px solid var(--qp-vien2); }
.qp-tk-da { font-size: .66rem; font-weight: 700; color: #b45309; }
.qp-tk-chon { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid #a5f3fc; background: linear-gradient(90deg, #ecfeff, var(--qp-the)); }
.qp-tk-chon.loi { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }
.qp-tk-chon-ten { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.qp-tk-chon-ten small { font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #0e7490; }
.qp-tk-chon-ten b { font-size: .92rem; color: var(--qp-chu); }
.qp-tk-chon-ten span { font-size: .74rem; color: var(--qp-mo); overflow-wrap: anywhere; }
.qp-tk-chon-ten em { color: #b45309; font-style: normal; }
[data-theme="dark"] .qp-tk-chon { border-color: rgba(34,211,238,.35); background: linear-gradient(90deg, rgba(8,145,178,.14), transparent); }
[data-theme="dark"] .qp-tk-chon-ten small { color: #67e8f9; }
.qp-tk-box.qp-loi { outline: 2px solid #ef4444; outline-offset: 2px; border-radius: 12px; }
.qp-form .form-control.qp-vua-dien { border-color: #22d3ee; box-shadow: 0 0 0 3px rgba(34,211,238,.18); transition: none; }
@media (max-width: 480px) {
  .qp-nguon-seg button { font-size: .74rem; padding: 0 6px; }
  .qp-tk-d-phai .qp-tk-vt { display: none; }
}

/* (17/10 d) popup xoá: khối cảnh báo một dòng chữ · nút nguồn xuống dòng trên điện thoại */
.qp-xn-canh > span { flex: 1; min-width: 0; }
.qp-xn-canh > i { margin-top: 3px; }
.qp-tb-nd .qp-xn p { text-align: center; color: var(--qp-mo); font-size: .82rem; }
.qp-nguon-seg button { white-space: normal; line-height: 1.25; height: auto !important; min-height: 38px; padding: 6px 8px; text-align: center; }
