/* ============================================================
   tuong-lai.css — GIAO DIỆN "TƯƠNG LAI" cho panel — BẢN 3.0 nền tối, chữ sáng hơn bản 1 (chủ shop yêu cầu 06/10/2026 — tự sửa, xem SUA-CODE.md)
   Nạp SAU acc.css + <style> của dashboard.html: chỉ ĐỔI MÀU / HIỆU ỨNG, không đổi bố cục hay chức năng.
   Gỡ = xoá 1 dòng <link href="tuong-lai.css"> trong dashboard.html là về giao diện cũ.
   ============================================================ */
:root {
  --brand: #22d3ee;                     /* cyan điện */
  --brand-d: #06b6d4;
  --brand-l: rgba(34, 211, 238, .12);
  --brand-bd: rgba(34, 211, 238, .42);
  --violet: #8b5cf6;
  --ok: #3ee6a1;  --ok-l: rgba(62, 230, 161, .11);
  --bad: #ff5c7a; --bad-l: rgba(255, 92, 122, .11);
  --warn: #ffc24b; --warn-l: rgba(255, 194, 75, .11);
  --bg: #050816;
  --card: #0b1130;                      /* đặc — tiêu đề bảng dính dùng màu này */
  --card-2: #0f173b;
  --zebra: #0d1435;
  --line: rgba(120, 160, 255, .12);
  --line2: rgba(120, 160, 255, .22);
  --text: #f4f8ff;
  --body: #cdd7f3;
  --muted: #93a1cc;
  --side-bg: rgba(6, 10, 28, .78);
  --side-color: #9fb0d8;
  --header: rgba(8, 13, 34, .66);
  --active-bg: rgba(34, 211, 238, .075);
  --radius: 9px;
  --radius-lg: 16px;
  --shadow: 0 14px 34px -18px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .035);
  --glass: linear-gradient(180deg, rgba(22, 32, 74, .82), rgba(11, 16, 42, .86));
  --neon: linear-gradient(120deg, #22d3ee, #8b5cf6 55%, #ec4899);
}
html { color-scheme: dark; background: var(--bg); }
body { color-scheme: dark; background: transparent; } /* nền nằm ở html để lớp cực quang (z-index -1) hiện dưới nội dung */

/* ---- Nền vũ trụ: cực quang trôi chậm + lưới mờ ---- */
body::before {
  content: ""; position: fixed; inset: -20%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 35% at 15% 10%, rgba(34, 211, 238, .16), transparent 70%),
    radial-gradient(38% 34% at 88% 8%, rgba(139, 92, 246, .2), transparent 70%),
    radial-gradient(45% 40% at 70% 95%, rgba(236, 72, 153, .09), transparent 70%),
    radial-gradient(35% 30% at 5% 90%, rgba(62, 230, 161, .07), transparent 70%);
  animation: tlTroi 38s ease-in-out infinite alternate;
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(120, 160, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(120, 160, 255, .05) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 10%, transparent 75%); mask-image: radial-gradient(ellipse at 50% 0%, #000 10%, transparent 75%);
}
@keyframes tlTroi { 0% { transform: translate3d(0, 0, 0) scale(1); } 100% { transform: translate3d(3%, 2%, 0) scale(1.08); } }

/* ---- Thanh cuộn mảnh ---- */
* { scrollbar-width: thin; scrollbar-color: rgba(120, 160, 255, .25) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(120, 160, 255, .22); border-radius: 9px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(34, 211, 238, .45); }
::-webkit-scrollbar-track { background: transparent; }
::selection { background: rgba(34, 211, 238, .3); color: #fff; }

/* ---- Menu dọc: kính mờ + vạch sáng ---- */
.sidebar { background: transparent; } /* KHÔNG đặt position ở đây: điện thoại dùng position:fixed (menu trượt) của acc.css */
.side-menu {
  background: var(--side-bg); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-right: 1px solid transparent; position: relative;
}
.side-menu::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 1px; background: linear-gradient(180deg, transparent, rgba(34, 211, 238, .5), rgba(139, 92, 246, .45), transparent); }
.side-brand-txt b { font-size: 16px; background: var(--neon); -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: .01em; }
.side-brand-txt span { color: var(--muted); }
.side-brand::before {
  content: ""; width: 26px; height: 26px; flex: none; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0 8%, #67e8f9 18%, #8b5cf6 62%, transparent 70%);
  box-shadow: 0 0 16px rgba(34, 211, 238, .55); animation: tlTho 4s ease-in-out infinite;
}
body.side-mini .side-brand::before { display: none; }
.side-menu-label { color: #7f93c9; opacity: .75; }
.side-item { border-left: 0; position: relative; transition: background .2s, color .2s, box-shadow .2s; }
.side-item:hover, a.side-item:hover { background: rgba(120, 160, 255, .07); }
.side-item.active {
  color: #fff; background: linear-gradient(90deg, rgba(34, 211, 238, .16), rgba(139, 92, 246, .08) 70%, transparent);
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, .18);
}
.side-item.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--neon); box-shadow: 0 0 12px rgba(34, 211, 238, .8); }
.side-item.active .si-ico { color: #67e8f9; filter: drop-shadow(0 0 6px rgba(34, 211, 238, .7)); }
.side-foot { border-top-color: rgba(120, 160, 255, .12); }
.side-mini-btn { border-color: rgba(120, 160, 255, .2); }

/* ---- Thanh trên: kính + vạch neon đáy ---- */
.topbar {
  background: var(--header); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid transparent; position: relative;
}
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, rgba(34, 211, 238, .45), rgba(139, 92, 246, .4), transparent); }
.page-title { font-size: 17px; background: linear-gradient(90deg, #e0faff, #a5f3fc 40%, #c4b5fd); -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: .005em; }

/* ---- Hộp / thẻ: kính mờ, viền sáng ---- */
.token-box, .cb-card, .cn-card, .acc-card, .table-wrap {
  background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line2); box-shadow: var(--shadow);
}
.token-box:hover, .cb-card:hover, .cn-card:hover { border-color: rgba(34, 211, 238, .28); }
.token-box, .cb-card, .cn-card { transition: border-color .25s, box-shadow .25s; }

/* ---- Bảng ---- */
thead th { background: var(--card); color: #8fb4e8; border-bottom-color: rgba(34, 211, 238, .22); }
tbody td { border-bottom-color: var(--line); }
tbody tr:nth-child(even) { background: rgba(120, 160, 255, .025); }
tbody tr:hover { background: rgba(34, 211, 238, .06); }
th.stick-r, td.stick-r { box-shadow: -10px 0 12px -10px rgba(0, 0, 0, .8); }
.cell-name { color: var(--text); }

/* ---- Nút ---- */
.btn { background: rgba(255, 255, 255, .035); border-color: var(--line2); color: var(--body); }
.btn:hover { background: rgba(34, 211, 238, .08); border-color: rgba(34, 211, 238, .45); color: #fff; box-shadow: 0 0 18px -6px rgba(34, 211, 238, .6); }
.btn-primary, .btn-primary:hover {
  background: linear-gradient(135deg, #0891b2, #7c3aed); border-color: rgba(167, 139, 250, .5); color: #fff;
  box-shadow: 0 6px 22px -8px rgba(124, 58, 237, .8), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-primary:hover { filter: brightness(1.15); }
.btn-danger { color: var(--bad); border-color: rgba(255, 92, 122, .35); }
.btn-danger:hover { background: rgba(255, 92, 122, .9); border-color: transparent; color: #fff; box-shadow: 0 0 18px -6px rgba(255, 92, 122, .9); }
.btn-success { color: var(--ok); border-color: rgba(62, 230, 161, .35); }
.btn-success:hover { background: rgba(62, 230, 161, .85); border-color: transparent; color: #04121c; }
.btn:disabled:hover { background: rgba(255, 255, 255, .035); color: var(--body); box-shadow: none; }

/* ---- Tab viên thuốc ---- */
.mgr-tab:hover { background: rgba(120, 160, 255, .08); }
.mgr-tab.active { background: linear-gradient(135deg, rgba(8, 145, 178, .9), rgba(124, 58, 237, .9)); border-color: rgba(167, 139, 250, .45); box-shadow: 0 0 22px -8px rgba(34, 211, 238, .9); }

/* ---- Ô nhập ---- */
.search, .cfg-input, .pos-field input, .pw-field input, input[type="text"], input[type="password"], input[type="number"], input[type="search"], input[type="date"], input[type="time"], input:not([type]), select, textarea {
  background-color: rgba(4, 8, 24, .55); color: var(--text); border-color: var(--line2);
}
.search:focus, .cfg-input:focus, .pos-field input:focus, .pw-field input:focus, input:focus, select:focus, textarea:focus {
  border-color: rgba(34, 211, 238, .7); box-shadow: 0 0 0 3px rgba(34, 211, 238, .14), 0 0 18px -6px rgba(34, 211, 238, .7); outline: none;
}
input::placeholder, textarea::placeholder { color: #5f6f99; }
select option { background: #0b1130; color: var(--text); }

/* ---- Huy hiệu: viền phát sáng nhẹ ---- */
.badge { border-radius: 999px; }
.badge.ok { border-color: rgba(62, 230, 161, .4); box-shadow: 0 0 12px -6px rgba(62, 230, 161, .9); }
.badge.bad { border-color: rgba(255, 92, 122, .4); box-shadow: 0 0 12px -6px rgba(255, 92, 122, .9); }
.badge.warn { border-color: rgba(255, 194, 75, .4); }
.badge.ok::before { animation: tlChop 2.6s ease-in-out infinite; }

/* ---- Hộp thoại ---- */
.hc-backdrop { background: rgba(2, 4, 14, .66); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.hc-card { background: linear-gradient(180deg, #111a44, #0a1030); border-color: rgba(34, 211, 238, .3); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .9), 0 0 40px -20px rgba(34, 211, 238, .6); }

/* ---- Màn Tin nhắn: avatar tông neon tối ---- */
.ch-avc0 { background: rgba(34, 211, 238, .16); color: #a5f3fc; }
.ch-avc1 { background: rgba(236, 72, 153, .16); color: #f9a8d4; }
.ch-avc2 { background: rgba(62, 230, 161, .15); color: #a7f3d0; }
.ch-avc3 { background: rgba(255, 194, 75, .15); color: #fde68a; }
.ch-avc4 { background: rgba(139, 92, 246, .18); color: #c4b5fd; }
.ch-avc5 { background: rgba(251, 113, 133, .15); color: #fecdd3; }
.ch-wrap { background: transparent; }
.ch-out, .cb-m.bot { background: linear-gradient(135deg, rgba(8, 145, 178, .3), rgba(124, 58, 237, .24)); border-color: rgba(34, 211, 238, .35); }
.ch-in, .cb-m.kh { background: rgba(255, 255, 255, .045); border-color: rgba(120, 160, 255, .16); }
.ch-list { background: rgba(8, 12, 32, .72); }

/* ---- Điện thoại ---- */
@media (max-width: 600px) {
  .mobile-bar { background: rgba(6, 10, 28, .82); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid rgba(34, 211, 238, .2); }
  .mobile-bar .mb-title { background: var(--neon); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .side-menu { background: rgba(6, 10, 28, .94); }
}

/* ---- Nhịp thở dùng chung ---- */
@keyframes tlTho { 0%, 100% { transform: scale(1); filter: brightness(1); } 50% { transform: scale(1.08); filter: brightness(1.35); } }
@keyframes tlChop { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.side-brand-txt span { white-space: nowrap; font-size: 9.5px; }
body { font-size: 13.5px; }

/* ---- [06/10/2026 BẢN 3.6] Ô số liệu .cb-stat dùng chung (Chi phí AI mượn của Chatbot AI): chép sang đây để mở thẳng Chi phí AI
   từ Trung tâm bot vẫn có khung (trước đây CSS này chỉ nạp khi đã vào Chatbot AI). ---- */
.cb-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 10px; }
.cb-stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 12px 14px; text-align: left; font: inherit; color: inherit; }
.cb-stat .lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; font-family: var(--font-mono); }
.cb-stat .val { font-size: 25px; font-weight: 600; color: var(--text); margin-top: 3px; font-family: var(--font-display); letter-spacing: -0.02em; }
.cb-stat .val.warn { color: var(--warn); } .cb-stat .val.bad { color: var(--bad); } .cb-stat .val.ok { color: var(--ok); }
.cb-stat .sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
@media (max-width: 600px) { .cb-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- [06/10/2026 BẢN 3.6] Màn vừa (601–1100px, vd màn trong máy gập Honor Magic V3): bảng rộng thì cuộn ngang thay vì chồng chữ ---- */
@media (max-width: 1100px) {
  #cbPagesTbl { min-width: 900px; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
}

/* ===== BẢN 4.0 — "Bot care khách": bot BÉO (thẻ rộng gấp đôi) + đàn 10 bot con tí hon máu chiến =====
   Luật mượt (3.4): chỉ animate transform / opacity. */
#view-hub .hb-bot.beo { grid-column: span 2; }
@media (max-width: 600px) { #view-hub .hb-bot.beo { grid-column: auto; } }
#view-hub .hb-bot.beo .hb-ico.rb { width: 84px; height: 84px; }
#view-hub .hb-bot.beo .rb svg { transform: scaleX(1.18); }            /* béo ngang */
#view-hub .hb-bot.beo .hb-ten b { font-size: 1.12em; }
#view-hub .hb-bot.beo .hb-so { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 600px) { #view-hub .hb-bot.beo .hb-so { grid-template-columns: repeat(2, 1fr); } }
.rb .tainghe { fill: none; stroke: rgba(var(--c),.95); stroke-width: 2.6; stroke-linecap: round; }
.rb .tn-op { fill: rgba(var(--c),.9); }
.rb .tn-mic { fill: none; stroke: rgba(var(--c),.85); stroke-width: 1.8; stroke-linecap: round; }
.rb .tn-mic-d { fill: #fde68a; }
.off .rb .tainghe, .off .rb .tn-mic { stroke: #64748b; } .off .rb .tn-op { fill: #475569; }

/* đàn bot con */
.hb-dan { display: grid; grid-template-columns: repeat(8, 1fr); row-gap: 10px; /* [BẢN 4.2] 15 bot con: 2 hàng */ gap: 4px; margin: 12px 0 10px; padding: 10px 6px 6px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(var(--c),.10), rgba(var(--c),.03)); border: 1px dashed rgba(var(--c),.35); }
@media (max-width: 900px) { .hb-dan { grid-template-columns: repeat(5, 1fr); row-gap: 10px; } }
.hb-con { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.hb-con .so { font-size: 11px; line-height: 1; font-weight: 800; color: #fff; background: rgba(var(--c),.9); border-radius: 8px; padding: 2px 5px; margin-bottom: 2px; }
.hb-con.off .so { background: #475569; }
.hb-con .nhun { position: relative; display: block; width: 30px; height: 32px; transform-origin: 50% 100%; will-change: transform; }
.hb-con svg { width: 30px; height: 32px; overflow: visible; display: block; }
.hb-con em { font-style: normal; font-size: 9.5px; line-height: 1.2; color: rgba(226,232,240,.88); text-align: center; margin-top: 3px; max-width: 100%; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.4em; }
.hb-con .c-dau { fill: rgba(var(--c),.22); stroke: rgba(var(--c),1); stroke-width: 1.6; }
.hb-con .c-bang { stroke: #ef4444; stroke-width: 2.6; stroke-linecap: round; }              /* băng đô đỏ máu chiến */
.hb-con .c-duoi { fill: none; stroke: #ef4444; stroke-width: 1.6; stroke-linecap: round; }
.hb-con .c-may { stroke: #fff; stroke-width: 1.5; stroke-linecap: round; }                /* mày chau, mặt hăng */
.hb-con .c-mat { fill: #fff; }
.hb-con .c-mieng { fill: none; stroke: #fff; stroke-width: 1.4; stroke-linecap: round; }
.hb-con .c-than { fill: rgba(var(--c),.55); }
.hb-con .dam { position: absolute; right: -7px; top: 15px; width: 8px; height: 8px; border-radius: 50%; background: #fde68a; box-shadow: 0 0 0 1.5px rgba(var(--c),1); will-change: transform; } /* nắm đấm */
/* đang trực: nhảy tưng tưng lệch nhịp + đấm liên tục */
.hb-con.live .nhun { animation: conNhay .78s ease-in-out infinite; animation-delay: calc(var(--i) * -.11s); }
.hb-con.live .dam { animation: conDam .5s ease-in-out infinite; animation-delay: calc(var(--i) * -.07s); }
.hb-con.live .c-duoi { animation: conBay .35s linear infinite; transform-origin: 27px 12.5px; }
@keyframes conNhay { 0%,100% { transform: translateY(0) scaleY(1); } 30% { transform: translateY(-7px) scaleY(1.04) rotate(-5deg); } 55% { transform: translateY(0) scaleY(.9); } 75% { transform: translateY(-3px) rotate(4deg); } }
@keyframes conDam { 0%,100% { transform: translateX(0); } 50% { transform: translateX(6px) scale(1.25); } }
@keyframes conBay { 0%,100% { transform: rotate(0); } 50% { transform: rotate(-14deg); } }
/* ngoài giờ: ngồi thở, mắt nhắm */
.hb-con.sleep .nhun { animation: conTho 3.2s ease-in-out infinite; animation-delay: calc(var(--i) * -.3s); }
.hb-con.sleep .c-mat { transform: scaleY(.18); transform-box: fill-box; transform-origin: center; }
.hb-con.sleep .dam { opacity: .4; }
@keyframes conTho { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(.94); } }
/* tắt: xám, nằm im */
.hb-con.off { opacity: .5; } .hb-con.off .c-dau { stroke: #64748b; fill: rgba(100,116,139,.15); } .hb-con.off .c-bang, .hb-con.off .c-duoi { stroke: #64748b; }
.hb-con.off .dam { display: none; } .hb-con.off .c-mat { transform: scaleY(.18); transform-box: fill-box; transform-origin: center; }
