/* ===== Thiết lập Bot · Phân nhánh SM → HM → HP · bot riêng của HP · tắt bot từng hội thoại ===== */
.qb-tabs-dau{margin:-4px 0 14px}
.qb-chu{display:inline-block;font-size:12px;color:#0f766e;background:#ecfdf5;border-radius:999px;padding:2px 9px;margin:0 0 6px}
.av-bot.nho{width:22px;height:22px;font-size:12px;border-radius:7px}

/* bot riêng của HP */
.qb-hp{margin-top:16px}.qb-hp-ds{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:10px}
.qb-hp-o{display:flex;gap:10px;align-items:flex-start;border:1px solid var(--line);border-radius:12px;padding:10px 12px;background:#fff}
.qb-hp-o>div{flex:1;min-width:0}.qb-hp-o small{display:block;color:var(--muted);font-size:12px}
.qb-hp-o .nut{flex:none;white-space:nowrap}
.tk-av-chu{width:32px;height:32px;border-radius:50%;background:#0891b2;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;flex:none}
.qb-hp-bot{display:inline-flex;align-items:center;gap:5px;margin:5px 6px 0 0;font-size:12.5px;text-decoration:none;color:var(--ink);background:var(--paper);border-radius:8px;padding:2px 8px 2px 3px}
.tk-check-bot{display:flex;flex-wrap:wrap;align-items:center;gap:6px;font-size:13.5px;font-weight:600;margin:8px 0 2px}.tk-check-bot .small{font-weight:400}

/* Thiết lập Bot */
.tl{padding-bottom:80px}
.tl-dau{display:flex;justify-content:space-between;align-items:flex-end;gap:12px;flex-wrap:wrap;margin-bottom:12px}.tl-dau h2{margin:0;font:600 20px var(--fh)}
.tl-chu{display:flex;flex-direction:column;gap:4px;font-size:12.5px;font-weight:600;color:var(--muted)}.tl-chu select{border:1px solid var(--line);border-radius:8px;padding:7px 9px;font:13.5px var(--f);min-width:240px}
.tl-luoi{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,7fr);gap:16px;align-items:start}
.tl-cot{display:flex;flex-direction:column;gap:16px;min-width:0}
.tl-av-dong{display:flex;gap:14px;align-items:center;margin-bottom:12px}
.tl-av{width:64px;height:64px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff;font:700 26px var(--fh);overflow:hidden;flex:none}
.tl-av img{width:100%;height:100%;object-fit:cover}.tl-av.nho{width:30px;height:30px;font-size:14px}
.tl-o{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:10px}
.tl-o label,.tl-gio{display:flex;flex-direction:column;gap:5px;font-size:12.5px;font-weight:600;color:var(--muted)}
.tl input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]),.tl select,.tl textarea{border:1px solid var(--line);border-radius:9px;padding:8px 10px;font:14px var(--f);background:#fff;width:100%;color:var(--ink)}
.tl textarea{resize:vertical;margin-top:8px}.tl input[type=color]{height:38px;width:100%;padding:3px;border:1px solid var(--line);border-radius:9px;background:#fff}
.tl-gio{flex-direction:row;flex-wrap:wrap;align-items:center;background:var(--paper);border-radius:10px;padding:10px}.tl-gio input[type=time]{width:auto!important}
.tl-thu{display:flex;gap:4px;flex-wrap:wrap}.tl-thu label{border:1px solid var(--line);border-radius:7px;padding:3px 8px;background:#fff;cursor:pointer;font-weight:600;color:var(--ink)}
.tl-thu label.on{background:var(--chinh);border-color:var(--chinh);color:#fff}.tl-thu input{display:none}
.tl-muc{border-top:1px solid var(--line);padding:12px 0}.tl-muc:first-of-type{border-top:0;padding-top:4px}
.tl-muc-dau{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}.tl-muc-dau b{font-size:14.5px}.tl-muc-dau p{margin:3px 0 0}
.tl-muc-dau .cong-tac{flex:none}
.tl-chon{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}.tl-chon label{border:1px solid var(--line);border-radius:999px;padding:6px 14px;cursor:pointer;font-size:13.5px;background:#fff}
.tl-chon label.on{background:var(--chinh);border-color:var(--chinh);color:#fff;font-weight:600}.tl-chon input{display:none}
.tl-dem{text-align:right;margin-top:2px}
.tl-tick{display:grid;grid-template-columns:1fr 1fr;gap:6px 14px;margin-top:8px;font-size:13.5px}.tl-tick.mo{opacity:.55}
.tl-tick label{display:flex;gap:7px;align-items:flex-start}
.tl-khung{border:1px solid var(--line);border-radius:14px;overflow:hidden;background:#f8fafc}
.tl-khung-dau{display:flex;align-items:center;gap:9px;padding:10px 12px;background:var(--tl);color:#fff}.tl-khung-dau small{margin-left:auto;opacity:.9;font-size:12px}
.tl-khung-than{padding:12px;display:flex;flex-direction:column;gap:8px}
.tl-khung .ib-tn.bot .ib-bong{background:#fff;border:1px solid var(--line)}.tl-khung .ib-tn small{font-size:11px;color:var(--muted)}
.qb-thu .ib-tn.bot .ib-bong{border-left:3px solid var(--tl,#0a5bd3)}
.qb-thu-dau{display:flex;gap:10px;align-items:center}.qb-thu-dau h3{margin:0}
.qb-go{display:flex;gap:4px;padding:12px 14px!important}.qb-go i{width:7px;height:7px;border-radius:50%;background:#94a3b8;animation:go 1s infinite}
.qb-go i:nth-child(2){animation-delay:.15s}.qb-go i:nth-child(3){animation-delay:.3s}
@keyframes go{0%,60%,100%{opacity:.3;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}

/* Phân nhánh */
.pn-luat{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:10px}.pn-luat span{background:#fff;border:1px solid var(--line);border-radius:999px;padding:5px 12px;font-size:12.5px}
.pn-luoi{display:grid;grid-template-columns:repeat(auto-fill,minmax(380px,1fr));gap:14px;align-items:start}
.pn-sm-dau{display:flex;gap:10px;align-items:center;margin-bottom:10px}.pn-sm-dau h3{margin:0}.pn-sm-dau small{color:var(--muted);font-size:12.5px}.pn-sm-dau .nut{margin-left:auto}
.pn-av{width:34px;height:34px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff;font-weight:700;flex:none;background:#64748b}
.pn-av.sm{background:#f97316}.pn-av.hm{background:#0a5bd3}.pn-av.hp{background:#0891b2}.pn-av.admin{background:#0b1f3f}.pn-av.nho{width:26px;height:26px;font-size:12px}.pn-av.trong{background:#cbd5e1}
.pn-ds{display:flex;flex-direction:column;gap:8px}
.pn-hm{border:1px solid var(--line);border-radius:12px;padding:9px 10px;background:#fff}
.pn-hm-dau,.pn-hp{display:flex;gap:9px;align-items:center}.pn-hm-dau>div,.pn-hp>div{flex:1;min-width:0}
.pn-hm-dau small,.pn-hp small{display:block;color:var(--muted);font-size:12px}
.pn-hp{margin:7px 0 0 18px;padding:6px 0 0 12px;border-top:1px dashed var(--line);border-left:2px solid #bae6fd}
.pn-chon{border:1px solid var(--line);border-radius:8px;padding:5px 7px;font:12.5px var(--f);max-width:190px;background:#fff}.pn-chon.nho{max-width:150px}

/* Hộp thư: tắt bot từng hội thoại, đếm ngược tự bật lại, đủ thông tin */
.ib-bat-bot{border:0;background:none;cursor:pointer;font-size:14px;line-height:1;padding:2px 3px;border-radius:6px;position:relative}
.ib-bat-bot.tat{filter:grayscale(1);opacity:.55}.ib-bat-bot.tat::after{content:'';position:absolute;left:2px;right:2px;top:50%;height:2px;background:#dc2626;transform:rotate(-35deg)}
.ib-bat-bot:hover{background:var(--paper)}
.ib-dem{font-size:12.5px;color:#7a4e00;background:#fff7e6;border:1px solid #fde68a;border-radius:10px;padding:7px 10px;margin:8px 12px 0;display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.ib-dem .nut{margin-left:auto}
.ib-du{font-size:12.5px;color:#166534;background:#f0fdf4;border:1px solid #bbf7d0;border-radius:10px;padding:7px 10px;margin:8px 12px 0}
.ib-xh{font-size:12px;color:var(--muted)}

@media (max-width:1100px){.tl-luoi{grid-template-columns:1fr}}
@media (max-width:900px){.pn-luoi{grid-template-columns:1fr}.tl-o,.tl-tick{grid-template-columns:1fr}.qb-hp-ds{grid-template-columns:1fr}.pn-chon{max-width:130px}}

/* Hạn mức tin nhắn · dùng thử */
.ht-thang{border:1px solid var(--line);border-radius:9px;padding:8px 10px;font:14px var(--f);background:#fff}
.ht-luoi-the{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px;margin-bottom:14px}
.ht-the{margin:0}.ht-the small{color:var(--muted);font-weight:600;font-size:12.5px}.ht-the.thu{border-top:3px solid #7c3aed}.ht-the.gia{border-top:3px solid #0891b2}
.ht-so{display:flex;align-items:baseline;gap:6px;margin:6px 0}.ht-so b{font:700 28px var(--fh)}.ht-so span{color:var(--muted);font-size:13px}
.ht-dong{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap;font-size:12.5px;margin-top:6px;color:var(--ink)}
.ht-thanh{display:block;height:8px;border-radius:99px;background:#e2e8f0;overflow:hidden;min-width:80px;flex:1}
.ht-thanh i{display:block;height:100%;border-radius:99px;background:#16a34a}.ht-thanh.sap i{background:#e08a00}.ht-thanh.het i{background:#dc2626}.ht-thanh.kgh i{background:repeating-linear-gradient(45deg,#cbd5e1 0 6px,#e2e8f0 6px 12px)}
.ht-o-dung{display:flex;align-items:center;gap:8px;min-width:150px}.ht-o-dung b{min-width:34px;text-align:right}.ht-o-dung small{color:var(--muted);white-space:nowrap}
.ht-thanh-ngang{flex:1;height:8px;border-radius:0 4px 4px 0;background:transparent;min-width:70px}.ht-thanh-ngang i{display:block;height:100%;background:#2a78d6;border-radius:0 4px 4px 0}
.ht-nhap{display:inline-flex;align-items:center;gap:4px;margin:2px 6px 2px 0}.ht-nhap input{width:110px;border:1px solid var(--line);border-radius:8px;padding:6px 8px;font:13.5px var(--f)}.ht-nhap small{color:var(--muted)}
.ht-nhap.to input{width:140px;font-size:15px}
.ht-gia{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.ht-gia>div{flex:1;min-width:220px}.ht-gia h3{margin:0}
.ht-thu{display:flex;align-items:center;gap:8px}.ht-thu select{border:1px solid var(--line);border-radius:8px;padding:5px 6px;font:12.5px var(--f)}
.ht-ad td{vertical-align:middle}.nut.on{background:var(--chinh-nhat);border-color:var(--chinh);color:var(--chinh-dam)}
.tk-tt.thu{background:#ede9fe;color:#6d28d9}
.ht-bc{margin-top:4px}.ht-bc-dau{display:flex;justify-content:space-between;gap:10px;align-items:flex-start;flex-wrap:wrap}.ht-bc-dau h3{margin:0}
.ht-ngay{display:flex;align-items:flex-end;gap:2px;height:110px;margin:12px 0 2px;border-bottom:1px solid var(--line)}
.ht-ngay span{flex:1;height:100%;display:flex;align-items:flex-end;cursor:default}.ht-ngay span:hover{background:#f1f5f9}
.ht-ngay i{display:block;width:100%;background:#2a78d6;border-radius:4px 4px 0 0}
.ht-ngay-truc{display:flex;justify-content:space-between;font-size:11.5px;color:var(--muted);margin-bottom:12px}
.ht-bang td{white-space:nowrap}
@media (max-width:900px){.ht-luoi-the{grid-template-columns:1fr}.ht-nhap input{width:90px}}
