/* ZENTEA · Zalo AI Tổng Hợp — trang quản trị duy nhất của zenteaqlch.io.vn (từ 06/11/2026) */
:root {
  --bg: #f4f6f3;
  --card: #ffffff;
  --ink: #1d2420;
  --muted: #66716b;
  --line: #e2e7e3;
  --brand: #1f6b47;
  --brand-2: #2f8a5f;
  --brand-soft: #e6f2ea;
  --warn: #b25e09;
  --warn-soft: #fdf1e2;
  --bad: #b3261e;
  --bad-soft: #fbe9e7;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 20, .06), 0 4px 16px rgba(16, 24, 20, .05);
  font-family: "Be Vietnam Pro", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
svg.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hidden { display: none !important; }

/* ── Nút ── */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--card); padding: 8px 14px; border-radius: 9px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: #f1f4f2; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { padding: 5px 10px; font-size: 13.5px; }

/* ── Trang chủ: chọn Zalo AI / Quán ảo (25/11) ── */
.chon-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.chon-in { width: 100%; max-width: 760px; text-align: center; }
.chon-logo { font-weight: 800; font-size: 28px; letter-spacing: 2px; color: var(--brand); }
.chon-sub { color: var(--muted); margin: 4px 0 24px; }
.chon-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.chon-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 24px 22px; cursor: pointer; font: inherit; color: var(--ink); transition: border-color .15s, transform .15s; }
.chon-card:hover, .chon-card:focus-visible { border-color: var(--brand); transform: translateY(-2px); outline: none; }
.chon-card b { font-size: 18px; color: var(--brand); }
.chon-card > span:last-child { color: var(--muted); font-size: 14px; }
.chon-ic { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.chon-ic .ic { width: 26px; height: 26px; }
/* chế độ chỉ Quán ảo: ẩn thanh tab / chip / banner Zalo, hiện nút Trang chủ */
.btn-home { display: none; }
body.chi-quan-ao .btn-home { display: inline-flex; margin-left: auto; }
body.chi-quan-ao #tabs, body.chi-quan-ao #chips, body.chi-quan-ao #zaloBanner { display: none !important; }

/* ── Đăng nhập ── */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 32px 28px; }
.login-card .logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--brand); margin-bottom: 4px; }
.login-card p.sub { color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; background: #fff; }
.field input:focus, .field textarea:focus, .field select:focus, .search:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand-2); }
.login-card .btn-primary { width: 100%; justify-content: center; padding: 10px; }
.err { color: var(--bad); font-size: 13.5px; min-height: 20px; margin-top: 10px; }
.err.ok { color: var(--ok, #2d7a2d); }
.login-card .link-btn { display: block; margin: 6px auto 0; background: none; border: 0; padding: 4px 6px; color: var(--brand); font-size: 13.5px; cursor: pointer; text-decoration: underline; }

/* ── Khung chính ── */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--card); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1180px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--brand); font-size: 16.5px; }
.brand small { font-weight: 500; color: var(--muted); font-size: 13px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 4px 10px; border-radius: 999px; background: #f0f3f1; color: var(--muted); }
.chip b { color: var(--ink); font-weight: 600; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: #a8b2ac; }
.chip.ok .dot { background: #2f9e62; }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.bad .dot { background: var(--bad); }
.tabs { max-width: 1180px; margin: 0 auto; padding: 0 20px; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: none; padding: 10px 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
main { max-width: 1180px; margin: 0 auto; padding: 20px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.card + .card { margin-top: 16px; }
.card h2 { font-size: 16px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.note { font-size: 13.5px; color: var(--muted); }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.bad { background: var(--bad-soft); color: var(--bad); }
.banner.ok { background: var(--brand-soft); color: var(--brand); }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: sp 0.8s linear infinite; vertical-align: -3px; }
@keyframes sp { to { transform: rotate(360deg); } }

/* ── Bản tổng hợp ── */
.rp-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.rp-list { padding: 8px; }
.rp-list .rp-tools { padding: 8px 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; display: grid; gap: 8px; }
.rp-list .rp-tools .row { display: flex; gap: 6px; }
.rp-list .rp-tools input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; }
.rp-item { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.rp-item:hover { background: #f2f5f3; }
.rp-item.on { background: var(--brand-soft); }
.rp-item .d { font-weight: 600; }
.rp-item .m { font-size: 12.5px; color: var(--muted); }
.rp-item .m.bad { color: var(--bad); }
.rp-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 6px; }
.rp-head h1 { font-size: 19px; margin: 0; }
.rp-head .meta { font-size: 13px; color: var(--muted); margin-top: 3px; }
.md { overflow-wrap: anywhere; }
.md h2 { font-size: 16.5px; margin: 20px 0 8px; color: var(--brand); }
.md h3 { font-size: 15px; margin: 16px 0 6px; }
.md ul { margin: 4px 0 8px; padding-left: 22px; }
.md li { margin: 3px 0; }
.md p { margin: 6px 0; }
.md strong { font-weight: 650; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.pill { font-size: 12.5px; background: #f0f3f1; padding: 3px 9px; border-radius: 999px; color: var(--muted); }
.pill.zero { background: var(--warn-soft); color: var(--warn); }

/* ── Chọn group ── */
.gr-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.search { flex: 1; min-width: 200px; border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 7px 12px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.gr-list { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.gr-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); cursor: pointer; }
.gr-row:first-child { border-top: 0; }
.gr-row:hover { background: #f7f9f8; }
.gr-row input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.gr-row .n { flex: 1; min-width: 0; }
.gr-row .n .t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gr-row .n .s { font-size: 12.5px; color: var(--muted); }
.gr-row .c { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.gr-row.sel { background: #f3f9f5; }
.savebar { position: sticky; bottom: 0; display: flex; gap: 12px; align-items: center; justify-content: flex-end; background: var(--card); border-top: 1px solid var(--line); padding: 12px 0 2px; margin-top: 12px; }

/* ── Tin nhắn ── */
.msg-tools { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.msg-tools input, .msg-tools select { border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; background: #fff; max-width: 100%; }
.msg-group { margin-top: 18px; }
.msg-group h3 { font-size: 14.5px; margin: 0 0 8px; color: var(--brand); }
.msg { display: grid; grid-template-columns: 52px 1fr; gap: 8px; padding: 6px 0; border-top: 1px dashed var(--line); font-size: 14px; }
.msg .tm { color: var(--muted); font-size: 12.5px; padding-top: 1px; }
.msg .who { font-weight: 600; }
.msg .who.me { color: var(--brand); }
.msg .tx { white-space: pre-wrap; word-break: break-word; }
.msg.recalled .tx { text-decoration: line-through; color: var(--muted); }
.msg img { max-width: 220px; max-height: 220px; border-radius: 8px; display: block; margin-top: 4px; border: 1px solid var(--line); }

/* ── Cài đặt ── */
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--brand); }
.qr { margin-top: 12px; text-align: center; }
.qr img { width: 240px; height: 240px; border: 1px solid var(--line); border-radius: 10px; }

/* ── Chat trực tuyến ── */
.badge { background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 0 6px; line-height: 17px; min-width: 17px; text-align: center; }
.ibtn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; flex: none; }
.ibtn:hover { background: #eef2ef; color: var(--ink); }
.ibtn.on { color: var(--brand); background: var(--brand-soft); }
.ibtn:disabled { opacity: .5; cursor: default; }
svg.ic.big { width: 34px; height: 34px; stroke-width: 1.6; color: #b8c4bd; }
.av { position: relative; width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; overflow: hidden; color: #fff; font-weight: 700; font-size: 14px; letter-spacing: .2px; user-select: none; }
.av i { font-style: normal; }
.av > svg.ic { width: 55%; height: 55%; stroke-width: 1.8; }
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.av.sm { width: 30px; height: 30px; font-size: 11.5px; }
.av.xs { width: 24px; height: 24px; font-size: 10px; }
.av.lg { width: 42px; height: 42px; }
.av .gr { position: absolute; right: -1px; bottom: -1px; width: 15px; height: 15px; border-radius: 50%; background: #fff; display: grid; place-items: center; color: var(--brand); }
.av .gr svg { width: 11px; height: 11px; }

.chat-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; height: calc(100vh - 175px); min-height: 480px; }
.chat-list { padding: 0; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.cl-head { display: flex; gap: 4px; align-items: center; padding: 12px 10px 8px 12px; }
.cl-head .search { min-width: 0; flex: 1; padding: 7px 12px; border-radius: 999px; background: #f2f5f3; border-color: transparent; }
.cl-filter { display: flex; gap: 4px; padding: 0 10px 10px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); flex: none; }
.cl-filter::-webkit-scrollbar { display: none; }
.cl-filter button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 8px; font-size: 12.5px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.cl-filter button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
#chatList { overflow-y: auto; overflow-x: hidden; flex: 1; min-height: 0; padding: 6px; }
.ci { position: relative; display: flex; gap: 11px; width: 100%; text-align: left; border: 0; background: none; padding: 9px 8px; border-radius: 11px; cursor: pointer; align-items: center; }
.ci:hover { background: #f2f5f3; }
.ci.on { background: var(--brand-soft); }
.ci .bd { flex: 1; min-width: 0; }
.ci .nm { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
.ci .nm b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; }
.ci .nm span { font-size: 11.5px; color: var(--muted); flex: none; }
.ci .lt { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); margin-top: 1px; }
.ci .lt .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci .lt svg { width: 13px; height: 13px; flex: none; }
.ci.unread .nm b, .ci.unread .lt .t { color: var(--ink); font-weight: 650; }
.ci .more { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: none; background: #fff; box-shadow: var(--shadow); width: 28px; height: 28px; }
.ci:hover .more { display: inline-grid; }
.ci.dim { opacity: .6; }

.chat-pane { padding: 0; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.chat-pane > .empty { margin: auto; }
#chatBox { display: flex; flex-direction: column; height: 100%; min-height: 0; }
#chatBox.hidden { display: none; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.chat-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.chat-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15.5px; }
.chat-back { display: none; }
.pop-wrap { position: relative; }
.menu { position: absolute; z-index: 30; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 28px rgba(16,24,20,.16); padding: 5px; min-width: 190px; }
.pop-wrap .menu { right: 0; top: calc(100% + 6px); }
.menu button { display: flex; gap: 9px; align-items: center; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 14px; }
.menu button:hover { background: #f2f5f3; }
.menu button svg { width: 16px; height: 16px; color: var(--muted); }
.menu.ctx { position: fixed; }
.chat-sum { margin: 10px 14px 0; padding: 10px 14px; background: #fffaf0; border: 1px solid #f1e3c4; border-radius: 10px; font-size: 14px; max-height: 38%; overflow-y: auto; position: relative; }
.chat-sum .x { position: absolute; right: 6px; top: 6px; }
.chat-sum h4 { margin: 0 0 4px; font-size: 13.5px; color: var(--warn); display: flex; gap: 6px; align-items: center; }
.chat-body { position: relative; flex: 1; min-height: 0; display: flex; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 12px 18px 16px; background: #eef2f0; min-height: 0; }
.drop-hint { position: absolute; inset: 8px; border: 2px dashed var(--brand-2); border-radius: 14px; background: rgba(230,242,234,.92); display: grid; place-content: center; text-align: center; color: var(--brand); font-weight: 600; z-index: 5; }
.day-sep { text-align: center; margin: 14px 0 8px; }
.day-sep span { font-size: 12px; color: var(--muted); background: rgba(255,255,255,.75); padding: 2px 10px; border-radius: 999px; }
.cm { display: flex; gap: 8px; align-items: flex-end; margin: 2px 0; }
.cm.me { flex-direction: row-reverse; }
.cm .avc { width: 30px; flex: none; }
.cm .col { display: flex; flex-direction: column; align-items: flex-start; max-width: min(760px, 72%); min-width: 0; }
.cm.me .col { align-items: flex-end; }
.cm .sn { font-size: 12px; color: var(--muted); margin: 8px 0 2px 10px; }
.cm .bb { position: relative; background: #fff; border-radius: 16px; padding: 7px 12px; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 1px 1px rgba(0,0,0,.05); max-width: 100%; }
.cm.me .bb { background: #d7efe0; }
.cm.first:not(.me) .bb { border-top-left-radius: 6px; }
.cm.first.me .bb { border-top-right-radius: 6px; }
.cm.pending .bb { opacity: .6; }
.cm.recalled .bb { color: var(--muted); font-style: italic; background: transparent; border: 1px dashed #c9d3cd; box-shadow: none; }
.cm .bb.img { padding: 4px; }
.cm .bb img.ph { display: block; max-width: 280px; max-height: 300px; border-radius: 12px; cursor: zoom-in; }
.cm .bb .cap { padding: 4px 8px 2px; }
.cm .bb a.file, .cm .bb span.file { display: inline-flex; gap: 8px; align-items: center; color: var(--brand); font-weight: 500; }
.cm .bb .mt { color: #1a63c4; font-weight: 600; }
.cm .qt { border-left: 3px solid var(--brand-2); padding: 3px 8px; margin-bottom: 5px; font-size: 13px; color: var(--muted); background: rgba(0,0,0,.035); border-radius: 6px; white-space: normal; }
.cm .qt b { color: var(--ink); font-weight: 600; }
.cm .tm { font-size: 11px; color: var(--muted); margin: 2px 8px 0; }
.cm .th { position: absolute; right: 6px; bottom: -11px; background: #fff; border-radius: 999px; font-size: 12px; padding: 0 5px; box-shadow: 0 1px 3px rgba(0,0,0,.15); line-height: 18px; }
.cm .th + * { margin-top: 0; }
.cm.has-th .tm { margin-top: 12px; }
.cm .acts { display: flex; gap: 2px; align-self: center; opacity: 0; transition: opacity .12s; position: relative; }
.cm:hover .acts, .cm.act .acts { opacity: 1; }
.cm .acts .ibtn { width: 28px; height: 28px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.cm .acts .ibtn svg { width: 15px; height: 15px; }
.react-pop { position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%); background: #fff; border-radius: 999px; box-shadow: 0 6px 20px rgba(0,0,0,.18); padding: 4px 6px; display: flex; gap: 2px; z-index: 20; }
.react-pop button { border: 0; background: none; font-size: 20px; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; transition: transform .1s; }
.react-pop button:hover { transform: scale(1.25); background: #f2f5f3; }
.older { display: block; margin: 0 auto 10px; }
.chat-reply { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--line); background: #f6faf7; font-size: 13px; color: var(--brand); }
.chat-reply > div { flex: 1; min-width: 0; color: var(--ink); }
.chat-reply .note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-compose { position: relative; display: flex; gap: 4px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--line); }
.chat-compose textarea { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 18px; padding: 8px 14px; max-height: 160px; min-height: 38px; line-height: 1.4; }
.chat-compose textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand-2); }
.chat-compose .btn-primary { border-radius: 999px; width: 40px; height: 38px; padding: 0; justify-content: center; }
.mention-pop, .emoji-pop { position: absolute; left: 12px; bottom: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 28px rgba(16,24,20,.16); z-index: 25; }
.mention-pop { width: min(340px, calc(100% - 24px)); max-height: 280px; overflow-y: auto; padding: 4px; }
.mention-pop button { display: flex; gap: 10px; align-items: center; width: 100%; border: 0; background: none; padding: 6px 8px; border-radius: 8px; cursor: pointer; text-align: left; }
.mention-pop button.on, .mention-pop button:hover { background: var(--brand-soft); }
.emoji-pop { left: 52px; width: 300px; padding: 8px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emoji-pop button { border: 0; background: none; font-size: 21px; height: 34px; border-radius: 8px; cursor: pointer; }
.emoji-pop button:hover { background: #f2f5f3; }

.modal { position: fixed; inset: 0; background: rgba(15,22,18,.45); z-index: 60; display: grid; place-items: center; padding: 16px; }
.modal-card { background: #fff; border-radius: 16px; width: min(520px, 100%); max-height: min(720px, 92vh); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); overflow: hidden; }
.modal-card.sm { width: min(420px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 8px; font-size: 16px; }
.modal-tools { display: flex; gap: 8px; padding: 4px 16px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.modal-tools .search { min-width: 180px; }
.modal-list { overflow-y: auto; padding: 6px; min-height: 200px; }
.modal-list .ci .tag { font-size: 11.5px; color: var(--brand); background: var(--brand-soft); border-radius: 999px; padding: 1px 8px; flex: none; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px 14px; }
.tep-preview { margin: 4px 16px 0; padding: 12px; background: #f4f6f3; border-radius: 12px; text-align: center; }
.tep-preview img { max-width: 100%; max-height: 300px; border-radius: 8px; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 70; display: grid; place-items: center; cursor: zoom-out; padding: 20px; }
.lightbox img { max-width: 94vw; max-height: 86vh; border-radius: 8px; }
.lightbox a { position: absolute; top: 16px; right: 16px; }

/* Tab Chat: tràn hết màn hình (rộng + cao), không cuộn cả trang, ẩn chân trang */
body.tab-chat { overflow: hidden; }
body.tab-chat #vApp { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
body.tab-chat .topbar-in, body.tab-chat .tabs { max-width: none; }
body.tab-chat main { flex: 1; min-height: 0; max-width: none; width: 100%; padding: 12px 16px; display: flex; flex-direction: column; }
body.tab-chat #tab-chat { flex: 1; min-height: 0; }
body.tab-chat .chat-layout { height: 100%; min-height: 0; grid-template-columns: clamp(300px, 24vw, 400px) minmax(0, 1fr); gap: 12px; }
body.tab-chat .foot { display: none; }
.chat-layout > .card + .card, .set-grid > .card + .card, .rp-layout > .card + .card { margin-top: 0; }
.set-grid { align-items: start; }
.acc-sel { border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; background: #fff; max-width: 260px; }
.acc-list { display: grid; gap: 8px; margin: 12px 0 14px; }
.acc-row { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.acc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.acc-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-btns { display: flex; gap: 6px; align-items: center; flex: none; }
.st { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; }
.st-ok { background: var(--brand-soft); color: var(--brand); }
.st-warn { background: var(--warn-soft); color: var(--warn); }
.st-bad { background: var(--bad-soft); color: var(--bad); }
.acc-qr { display: flex; gap: 14px; align-items: center; padding: 12px; background: #f4f6f3; border-radius: 12px; margin-top: -2px; }
.acc-qr img { width: 200px; height: 200px; border-radius: 10px; background: #fff; flex: none; }
.cl-acc { display: flex; gap: 4px; padding: 0 10px 8px; overflow-x: auto; scrollbar-width: none; flex: none; }
.cl-acc::-webkit-scrollbar { display: none; }
.cl-acc button { display: inline-flex; gap: 5px; align-items: center; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 2px 9px 2px 3px; font-size: 12.5px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.cl-acc button:first-child { padding-left: 9px; }
.cl-acc button.on { border-color: var(--brand-2); background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.avw { position: relative; flex: none; display: inline-flex; }
.accb { position: absolute; left: -3px; bottom: -3px; border: 2px solid #fff; border-radius: 50%; display: inline-flex; }
.av.xxs { width: 18px; height: 18px; font-size: 8px; }
@media (max-width: 820px) { .acc-qr { flex-direction: column; text-align: center; } }
body.tab-chat #zaloBanner .banner { margin-bottom: 10px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1d2420; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 50; box-shadow: var(--shadow); max-width: 90vw; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 0 30px; }

@media (max-width: 820px) {
  .rp-layout, .set-grid { grid-template-columns: minmax(0, 1fr); }
  .topbar-in { padding: 10px 14px; gap: 10px; }
  .chips { order: 3; width: 100%; margin-left: 0; }
  #btnOut { margin-left: auto; }
  .tabs { padding: 0 8px; }
  .tab { padding: 10px 10px; }
  .rp-head h1 { font-size: 17px; }
  .chat-layout { grid-template-columns: minmax(0, 1fr); height: calc(100vh - 170px); }
  body.tab-chat .chat-layout { grid-template-columns: minmax(0, 1fr); }
  body.tab-chat main { padding: 8px; }
  .hide-sm { display: none; }
  .cm .col { max-width: 86%; }
  .emoji-pop { left: 8px; width: calc(100% - 16px); }
  .chat-layout .chat-pane { display: none; }
  .chat-layout.mo .chat-pane { display: flex; }
  .chat-layout.mo .chat-list { display: none; }
  .chat-back { display: inline-flex; }
  main { padding: 14px; }
  .card { padding: 14px; }
}

/* ── Lịch Vệ Sinh (15/11/2026, js/ve-sinh.js) ── */
.vs .card + .card { margin-top: 12px; }
.vs-head { display: grid; grid-template-columns: 1fr auto auto; gap: 10px 16px; align-items: center; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
.vs-head h2 { margin: 2px 0 0; font-size: 20px; }
.vs-sub { font-size: 11.5px; letter-spacing: 1.5px; text-transform: uppercase; opacity: .75; font-weight: 600; }
.vs-thang { display: flex; gap: 6px; align-items: center; }
.vs-thang .btn { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); color: #fff; }
.vs-thang .btn:hover { background: rgba(255,255,255,.26); }
.vs-thang .ibtn { color: #fff; }
.vs-thang .ibtn:hover { background: rgba(255,255,255,.18); color: #fff; }
.vs-pct { text-align: center; background: rgba(255,255,255,.14); border-radius: 12px; padding: 6px 14px; line-height: 1.2; }
.vs-pct b { display: block; font-size: 24px; }
.vs-pct span { font-size: 11.5px; opacity: .85; }
.vs-bar { grid-column: 1 / -1; height: 7px; border-radius: 99px; background: rgba(255,255,255,.22); overflow: hidden; }
.vs-bar i { display: block; height: 100%; background: #c8f0d4; border-radius: 99px; transition: width .4s; }
.vs-auto { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.vs-auto .note { flex-basis: 100%; margin: 0; }
.vs-ct { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; background: #f0f3f1; color: var(--muted); font-size: 13.5px; cursor: pointer; }
.vs-ct.on { background: var(--brand-soft); color: var(--brand); }
.vs-ct input { accent-color: var(--brand); width: 16px; height: 16px; }
.vs-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0 10px; }
.vs-gian { flex: 1; }
.vs-them { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.vs-them input, .vs-them select { border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; background: #fff; font: inherit; font-size: 14px; }
.vs-them #vsTViec { flex: 1; min-width: 200px; }
.vs-nguoi { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; }
.vs-ng { flex: none; display: grid; grid-template-columns: auto auto; gap: 2px 10px; align-items: center; min-width: 118px; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 7px 10px; cursor: pointer; font: inherit; }
.vs-ng span { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.vs-ng b { font-size: 12px; color: var(--muted); text-align: right; }
.vs-ng i { grid-column: 1 / -1; height: 4px; border-radius: 9px; background: #edf1ee; overflow: hidden; }
.vs-ng i u { display: block; height: 100%; background: var(--brand-2); }
.vs-ng.on { border-color: var(--brand); background: var(--brand-soft); }
.vs-bang { padding: 0; overflow-x: auto; }
.vs-bang table { width: 100%; border-collapse: collapse; min-width: 900px; font-size: 13.5px; }
.vs-bang th { position: sticky; top: 0; background: #f1f6f2; color: var(--brand); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); }
.vs-bang td { padding: 4px 6px; border-bottom: 1px solid #edf1ee; vertical-align: middle; }
.vs-bang tr.is-cuoi td { border-bottom: 2px solid #b9dcc4; }
.vs-bang select, .vs-bang input { width: 100%; border: 1px solid transparent; background: transparent; border-radius: 7px; padding: 5px 6px; font: inherit; font-size: 13.5px; color: inherit; cursor: pointer; }
.vs-bang select:hover, .vs-bang input:hover, .vs-bang input:focus, .vs-bang select:focus { border-color: var(--line); background: #fff; outline: none; }
.vs-bang input { cursor: text; }
.vs-bang .vs-doi { color: #166534; font-weight: 600; }
.vs-c-ngay { width: 92px; text-align: center !important; background: #f8fcf9; border-right: 2px solid #b9dcc4; }
td.vs-c-ngay b { display: block; color: var(--brand); font-size: 13px; }
td.vs-c-ngay span { font-size: 12px; color: var(--muted); }
td.vs-c-ngay em { display: block; font-style: normal; font-size: 11px; font-weight: 700; color: #fff; background: var(--brand); border-radius: 99px; margin: 3px auto 0; width: max-content; padding: 0 8px; }
.vs-c-ca { width: 82px; }
.vs-c-ca select { font-weight: 700; color: var(--brand); }
.vs-c-ca select.vs-ca-CA3 { color: #6a3fa0; }
.vs-c-xong { width: 96px; text-align: center !important; }
.vs-c-x { width: 40px; }
.vs-chk { width: 28px; height: 28px; border-radius: 8px; border: 2px solid #c9d3cc; background: #fff; cursor: pointer; display: inline-grid; place-items: center; color: #fff; padding: 0; }
.vs-chk.on { background: var(--brand); border-color: var(--brand); }
.vs-chk .ic { width: 16px; height: 16px; }
.vs-ng-xong { font-size: 10.5px; color: var(--muted); line-height: 1.2; margin-top: 2px; }
tr.vs-dong.is-xong td:not(.vs-c-ngay) select, tr.vs-dong.is-xong td:not(.vs-c-ngay) input { color: #8a948e; }
tr.vs-dong.is-xong .vs-c-viec select { text-decoration: line-through; }
tr.vs-dong.is-nay td:not(.vs-c-ngay) { background: #fffbea; }
.vs-md { padding: 4px 16px 6px; font-size: 14px; color: var(--ink); }
@media (max-width: 820px) {
  .vs-head { grid-template-columns: 1fr auto; }
  .vs-thang { grid-column: 1 / -1; order: 3; }
  .vs-head h2 { font-size: 17px; }
}
/* chân trang theo chế độ (25/11): chỉ Quán ảo thì ghi "Quán ảo" */
.foot-qa { display: none; }
body.chi-quan-ao .foot-ten { display: none; }
body.chi-quan-ao .foot-qa { display: inline; }

/* 01/12/2026: người dùng tự đăng ký (role zalo) — ẩn các phần chỉ quản trị dùng (Quán ảo, Vệ Sinh, Video AI, lịch tổng hợp quán, thêm TK quán, người dùng) */
body.nguoi-thuong .chi-quan-tri { display: none !important; }
