:root {
  --nen: #eef0f1; --mat: #fff; --mat-2: #f3f5f7; --chu: #081c36; --mo: #7589a3; --vien: #e1e4ea;
  --chinh: #0068ff; --chinh-dam: #005ae0; --chinh-chu: #fff; --ray: #0068ff; --ray-chon: #0053cc;
  --minh: #e5efff; --khach: #fff; --chon: #e5efff; --re: #f3f5f7;
  --loi: #d93025; --cho: #e8590c; --xanh: #22c55e; --xam: #aab4c3;
}
@media (prefers-color-scheme: dark) {
  :root {
    --nen: #0e1116; --mat: #171b22; --mat-2: #1d232c; --chu: #e6ebf2; --mo: #8b9bb0; --vien: #262d37;
    --chinh: #3d8bff; --chinh-dam: #2f7af0; --chinh-chu: #06101f; --ray: #0b3a80; --ray-chon: #0a2f68;
    --minh: #183258; --khach: #222a35; --chon: #1b2d48; --re: #1f2630;
    --loi: #ff7b72; --cho: #ffa94d; --xanh: #34d399; --xam: #5d6b7e;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--nen); color: var(--chu); font: 14px/1.45 system-ui, "Segoe UI", Roboto, sans-serif; }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
input, textarea { background: var(--mat); border: 1px solid var(--vien); border-radius: 6px; padding: 7px 10px; }
:focus-visible { outline: 2px solid var(--chinh); outline-offset: 1px; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nho { font-size: 12px; }
.mo-chu { color: var(--mo); }
.loi { color: var(--loi); margin: 0; font-size: 12px; overflow-wrap: anywhere; }
.trong { color: var(--mo); padding: 16px; margin: 0; text-align: center; }
.an-chu { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.nut-chinh { padding: 7px 16px; border: 0; border-radius: 6px; background: var(--chinh); color: var(--chinh-chu); cursor: pointer; font-weight: 600; }
.nut-chinh:hover { background: var(--chinh-dam); }
.nut-phu { padding: 6px 12px; border: 1px solid var(--vien); border-radius: 6px; background: var(--mat); cursor: pointer; }
.nut-phu:hover { background: var(--mat-2); }
.nut-icon { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 6px; background: none; color: var(--mo); cursor: pointer; position: relative; }
.nut-icon:hover { background: var(--mat-2); color: var(--chu); }
.nut-icon[aria-pressed="true"] { color: var(--chinh); background: var(--chon); }
.nut-icon.nho { width: 24px; height: 24px; }
button:disabled { opacity: .5; cursor: default; }

/* Dang nhap */
.man-dn { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.hop-dn { width: min(360px, 100%); background: var(--mat); border: 1px solid var(--vien); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.hop-dn h1 { margin: 0; font-size: 20px; color: var(--chinh); }
.hop-dn p { margin: 0; }
label { display: flex; flex-direction: column; gap: 4px; color: var(--mo); font-size: 13px; }
label input { color: var(--chu); font-size: 14px; }

/* Bo cuc 4 cot */
.khung { height: 100%; display: grid; grid-template-columns: 64px 340px minmax(0, 1fr) 320px; }
.khung.an-tt { grid-template-columns: 64px 340px minmax(0, 1fr) 0; }
.khung.an-tt .cot-tt { display: none; }

/* Cot nick */
.ray { background: var(--ray); display: flex; flex-direction: column; align-items: center; padding: 12px 0; gap: 8px; min-height: 0; }
.ray-nick { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; align-items: center; width: 100%; padding: 2px 0; }
.ray-mot { position: relative; border: 0; padding: 0; background: none; border-radius: 50%; cursor: pointer; }
.ray-mot .avt { box-shadow: 0 0 0 2px transparent; }
.ray-mot[aria-current="true"] .avt { box-shadow: 0 0 0 3px #fff; }
.ray-mot:hover .avt { box-shadow: 0 0 0 3px rgb(255 255 255 / .55); }
.cham { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ray); background: var(--xam); }
.cham.dang-nghe { background: var(--xanh); }
.cham.loi { background: var(--loi); }
.ray-nut { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 10px; background: none; color: #fff; cursor: pointer; }
.ray-nut:hover { background: var(--ray-chon); }
.ray-duoi { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ray-duoi .ray-nut { width: 60px; height: auto; min-height: 44px; padding: 5px 0 4px; gap: 2px; grid-template-rows: 22px auto; }
.ray-chu { font-size: 9.5px; line-height: 1.1; opacity: .9; white-space: nowrap; }
.ray-ten { color: #fff; font-size: 10px; max-width: 60px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .85; }

/* Avatar */
.avt { display: inline-grid; place-items: center; flex: none; border-radius: 50%; overflow: hidden; color: #fff; font-weight: 600; background: var(--xam); user-select: none; }
.avt img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Cot danh sach */
.cot-ds { background: var(--mat); border-right: 1px solid var(--vien); display: flex; flex-direction: column; min-height: 0; }
.dau-ds { padding: 12px 12px 0; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--vien); }
.nick-hien { display: flex; flex-direction: column; }
.nick-hien strong { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o-tim { display: flex; align-items: center; gap: 6px; background: var(--re); border-radius: 8px; padding: 0 10px; color: var(--mo); }
.o-tim svg { width: 18px; height: 18px; }
.o-tim input { border: 0; background: none; flex: 1; min-width: 0; padding: 8px 0; }
.o-tim input:focus-visible { outline: none; }
.loc { display: flex; gap: 16px; }
.loc-nut { border: 0; background: none; padding: 6px 0 8px; color: var(--mo); cursor: pointer; border-bottom: 2px solid transparent; font-weight: 600; }
.loc-nut[aria-pressed="true"] { color: var(--chinh); border-bottom-color: var(--chinh); }
#soCho:not(:empty) { background: var(--loi); color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11px; }
.hop-qr { padding: 16px; text-align: center; border-bottom: 1px solid var(--vien); }
.hop-qr p { margin: 0 0 10px; }
.hop-qr img { display: block; margin: 0 auto 12px; background: #fff; padding: 6px; border-radius: 8px; }
.ds-ht { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.ht { display: flex; gap: 12px; align-items: center; width: 100%; padding: 10px 12px; border: 0; background: none; text-align: left; cursor: pointer; }
.ht:hover { background: var(--mat-2); }
.ht[aria-current="true"] { background: var(--chon); }
.ht-giua { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ht-dong { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ht-ten { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ht.dang-cho .ht-ten { font-weight: 700; }
.ht-gio { color: var(--mo); font-size: 12px; white-space: nowrap; }
.ht-tin { color: var(--mo); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ht.dang-cho .ht-tin { color: var(--chu); }
.cham-moi { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--loi); align-self: center; }
.the-cho.da-xem { background: transparent; color: var(--mo, #8a93a6); border: 1px solid currentColor; font-weight: 500; }
.the-cho { flex: none; background: var(--loi); color: #fff; font-size: 11px; font-weight: 600; border-radius: 9px; padding: 0 6px; white-space: nowrap; }

/* Cot chat */
.cot-chat { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--nen); }
.dau-chat { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--mat); border-bottom: 1px solid var(--vien); min-height: 64px; }
.ten-chat { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ten-chat strong { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.khung-tin { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 4px; }
.chao { margin: auto; text-align: center; color: var(--mo); max-width: 360px; }
.chao h2 { color: var(--chu); font-weight: 600; }
.moc-ngay { align-self: center; margin: 12px 0 6px; background: rgb(0 0 0 / .32); color: #fff; font-size: 12px; padding: 2px 12px; border-radius: 12px; }
@media (prefers-color-scheme: dark) { .moc-ngay { background: rgb(255 255 255 / .12); } }
.dong-tin { display: flex; gap: 8px; align-items: flex-start; max-width: 100%; }
.dong-tin.minh { flex-direction: row-reverse; }
.cho-avt { width: 32px; flex: none; }
.cot-bong { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; max-width: min(70%, 600px); min-width: 0; }
.dong-tin.minh .cot-bong { align-items: flex-end; }
.tin { padding: 8px 12px; border-radius: 10px; background: var(--khach); white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 1px 1px rgb(0 0 0 / .06); max-width: 100%; }
.minh .tin { background: var(--minh); }
.tin.thu-hoi { opacity: .65; font-style: italic; }
.tin small { display: block; margin-top: 3px; color: var(--mo); font-size: 11px; }
.tin a { color: var(--chinh); }
.tin img { display: block; max-width: 100%; max-height: 300px; border-radius: 6px; margin: 2px 0; cursor: zoom-in; background: var(--mat-2); }
.trich { border-left: 3px solid var(--chinh); padding: 2px 8px; margin-bottom: 4px; font-size: 12px; color: var(--mo); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; }
/* Cam xuc kieu Zalo */
.tin { position: relative; }
.tin.co-cx { margin-bottom: 10px; }
.cx-tom { position: absolute; right: 26px; bottom: -11px; background: var(--mat); border: 1px solid var(--vien); border-radius: 10px; padding: 0 6px; font-size: 12px; line-height: 18px; white-space: nowrap; box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.boc-thich { position: absolute; right: -6px; bottom: -10px; }
.nut-thich { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--vien); background: var(--mat); font-size: 12px; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0; opacity: 0; transition: opacity .12s; box-shadow: 0 1px 2px rgb(0 0 0 / .1); }
.nut-thich.co { opacity: 1; }
.dong-tin:hover .nut-thich, .nut-thich:focus-visible { opacity: 1; }
@media (hover: none) { .nut-thich { opacity: .55; } }
.thanh-cx { position: absolute; bottom: 26px; right: -4px; display: none; flex-wrap: wrap; width: max-content; max-width: 220px; gap: 2px; padding: 4px 6px; background: var(--mat); border: 1px solid var(--vien); border-radius: 16px; box-shadow: 0 4px 14px rgb(0 0 0 / .15); z-index: 15; }
.boc-thich:hover .thanh-cx, .boc-thich:focus-within .thanh-cx, .boc-thich.mo .thanh-cx { display: flex; }
.thanh-cx::after { content: ""; position: absolute; left: 0; right: 0; bottom: -10px; height: 10px; }
.thanh-cx button { border: 0; background: none; font-size: 20px; line-height: 1; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; transition: transform .1s; padding: 0; }
.thanh-cx button:hover { transform: scale(1.25); background: var(--mat-2); }
.thanh-cx button.da-chon { background: var(--chon); }
.dong-tin.minh .boc-thich { right: auto; left: -6px; }
.dong-tin.minh .thanh-cx { right: auto; left: -4px; }
.dong-tin.minh .cx-tom { right: auto; left: 26px; }
.hanh-dong { position: absolute; top: 50%; transform: translateY(-50%); left: calc(100% + 6px); display: flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.dong-tin.minh .hanh-dong { left: auto; right: calc(100% + 6px); }
.dong-tin:hover .hanh-dong, .hanh-dong:focus-within { opacity: 1; }
@media (hover: none) { .hanh-dong { opacity: .6; } }
.hanh-dong button { width: 26px; height: 26px; border: 1px solid var(--vien); background: var(--mat); border-radius: 50%; font-size: 13px; line-height: 1; cursor: pointer; padding: 0; color: var(--mo); }
.hanh-dong button:hover { background: var(--chon); color: var(--chu); }

/* Soan tin */
.soan { background: var(--mat); border-top: 1px solid var(--vien); position: relative; }
.hop-mau { position: absolute; left: 10px; right: 10px; bottom: 100%; margin-bottom: 6px; max-height: 320px; display: flex; flex-direction: column;
  background: var(--mat); border: 1px solid var(--vien); border-radius: 10px; box-shadow: 0 8px 24px rgb(0 0 0 / .14); z-index: 5; }
.dau-mau { display: flex; gap: 8px; padding: 8px; border-bottom: 1px solid var(--vien); }
.dau-mau input { flex: 1; min-width: 0; }
.ds-mau { list-style: none; margin: 0; padding: 4px; overflow-y: auto; }
.mot-mau { display: flex; flex-direction: column; padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.mot-mau span { color: var(--mo); font-size: 13px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: pre-line; }
.mot-mau[aria-selected="true"], .mot-mau:hover { background: var(--chon); }
.ds-mau .rong-muc { padding: 10px; }
.hop-ql-mau { width: min(560px, calc(100% - 32px)); }
.hop-ql-mau > p { margin: 6px 0 12px; }
.form-mau label { display: flex; flex-direction: column; gap: 4px; }
.form-mau textarea { resize: vertical; }
.ds-ql-mau { list-style: none; margin: 16px 0; padding: 0; max-height: 40vh; overflow-y: auto; border-top: 1px solid var(--vien); }
.ds-ql-mau li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--vien); }
.ql-mau-chu { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ql-mau-chu span { white-space: pre-line; overflow-wrap: anywhere; color: var(--mo); font-size: 13px; }
.nick-hien .cong-tac { display: inline-flex; flex-direction: row; align-self: flex-start; align-items: center; gap: 6px; margin-top: 4px; color: var(--mo); cursor: pointer; }
.cong-tac input { margin: 0; }
.nhan-nhom { font-size: 10px; font-weight: 600; padding: 0 5px; border-radius: 4px; background: var(--re); color: var(--mo); margin-right: 5px; vertical-align: 1px; }
.thanh-cong-cu { display: flex; align-items: center; gap: 2px; padding: 4px 10px; border-bottom: 1px solid var(--vien); }
.thanh-cong-cu .loi { margin-left: 8px; }
.dang-tra-loi { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 16px; border-left: 3px solid var(--chinh); background: var(--mat-2); font-size: 12px; }
.dang-tra-loi > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dong-nhap { display: flex; align-items: flex-end; gap: 8px; padding: 8px 12px 10px 16px; }
.dong-nhap textarea { flex: 1; border: 0; resize: none; max-height: 160px; padding: 8px 0; background: none; }
.dong-nhap textarea:focus-visible { outline: none; }
.nut-gui { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 8px; background: none; color: var(--chinh); cursor: pointer; }
.nut-gui:hover { background: var(--chon); }

/* Cot thong tin */
.cot-tt { background: var(--mat); border-left: 1px solid var(--vien); display: flex; flex-direction: column; min-height: 0; }
.dau-tt { margin: 0; padding: 0 16px; min-height: 64px; display: flex; align-items: center; justify-content: center; font-size: 16px; border-bottom: 1px solid var(--vien); }
.noi-dung-tt { overflow-y: auto; flex: 1; }
.tt-dau { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px; border-bottom: 6px solid var(--nen); text-align: center; }
.tt-dau strong { font-size: 16px; overflow-wrap: anywhere; }
details { border-bottom: 6px solid var(--nen); }
summary { padding: 12px 16px; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "▾"; color: var(--mo); }
details:not([open]) summary::after { content: "▸"; }
.luoi-anh { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 0 16px 12px; }
.luoi-anh a { aspect-ratio: 1; border-radius: 4px; overflow: hidden; background: var(--mat-2); }
.luoi-anh img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ds-tep { list-style: none; margin: 0; padding: 0 8px 12px; }
.ds-tep a { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 6px; color: inherit; text-decoration: none; }
.ds-tep a:hover { background: var(--mat-2); }
.bieu-tep { flex: none; width: 36px; height: 36px; border-radius: 6px; display: grid; place-items: center; color: #fff; font-size: 10px; font-weight: 700; background: #7c5cff; }
.bieu-tep.link { background: var(--chinh); }
.tep-chu { min-width: 0; display: flex; flex-direction: column; }
.tep-chu span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rong-muc { padding: 0 16px 12px; color: var(--mo); margin: 0; font-size: 13px; }

/* Quan ly nhan vien */
.vung-nv { grid-column: 3 / 5; overflow: auto; padding: 0 20px 20px; background: var(--mat); }
.dau-nv { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 64px; }
.dau-nv h2 { margin: 0; font-size: 16px; }
.dong-them { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.dong-them input { flex: 1 1 200px; min-width: 0; }
.bang-cuon { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 560px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--vien); vertical-align: top; }
th { color: var(--mo); font-weight: 600; font-size: 12px; }
.chon-nick { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.chon-nick label { flex-direction: row; align-items: center; gap: 6px; color: var(--chu); font-size: 14px; }
.thao-tac { display: flex; flex-wrap: wrap; gap: 6px; }
.thao-tac input { width: 150px; }
.nhan { font-size: 11px; padding: 1px 6px; border-radius: 8px; background: var(--chon); margin-left: 6px; }
.nhan.khoa { color: var(--loi); }
.khung.dang-nv .cot-chat, .khung.dang-nv .cot-tt { display: none; }

dialog { border: 1px solid var(--vien); border-radius: 12px; background: var(--mat); color: var(--chu); width: min(380px, calc(100% - 32px)); padding: 20px; }
dialog form { display: flex; flex-direction: column; gap: 12px; }
dialog h2 { margin: 0; font-size: 16px; }
dialog::backdrop { background: rgb(0 0 0 / .4); }
.dong-nut { display: flex; justify-content: flex-end; gap: 8px; }

/* Man hinh hep */
@media (max-width: 1180px) {
  .khung, .khung.an-tt { grid-template-columns: 64px 300px minmax(0, 1fr); }
  .cot-tt { position: fixed; right: 0; top: 0; bottom: 0; width: min(320px, 90vw); z-index: 5; box-shadow: -4px 0 16px rgb(0 0 0 / .15); }
  .vung-nv { grid-column: 3 / 4; }
}
@media (max-width: 760px) {
  .khung, .khung.an-tt { grid-template-columns: 56px minmax(0, 1fr); grid-template-rows: auto; }
  .ray { grid-row: 1 / 3; }
  .cot-ds { max-height: 45vh; border-right: 0; border-bottom: 1px solid var(--vien); }
  .cot-chat { grid-column: 2; min-height: 55vh; }
  .vung-nv { grid-column: 2; }
  .ray-nut { width: 40px; height: 40px; }
}
.hop-xac-nhan p { margin: 0 0 16px; white-space: pre-line; }
/* Gui hang loat */
.hl-luu-y { margin: 0 0 12px; max-width: 900px; }
.hl-luoi { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.hl-tao, .hl-dot { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.hl-tao h3, .hl-dot h3 { margin: 0; font-size: 15px; }
.hl-tao label { display: flex; flex-direction: column; gap: 4px; }
.hl-tao select { background: var(--mat); border: 1px solid var(--vien); border-radius: 6px; padding: 6px 8px; font: inherit; color: inherit; }
.hl-tao textarea { resize: vertical; }
.hl-hang { display: flex; gap: 12px; flex-wrap: wrap; }
.hl-hang > label { flex: 1 1 160px; min-width: 0; }
.hl-tao fieldset { border: 1px solid var(--vien); border-radius: 8px; padding: 10px 12px; margin: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.hl-tao legend { padding: 0 4px; font-weight: 600; }
.hl-tao .hl-chon-het { flex-direction: row; align-items: center; gap: 6px; }
.hl-ds-khach { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; border-top: 1px solid var(--vien); }
.hl-ds-khach label { flex-direction: row; align-items: center; gap: 8px; padding: 5px 2px; cursor: pointer; }
.hl-ds-khach .hl-ten { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hl-ds-khach .rong-muc { padding: 10px 0; }
.hl-phanh { flex-direction: row !important; flex-wrap: wrap; }
.hl-phanh label { flex: 1 1 110px; font-size: 13px; }
.hl-phanh input { width: 100%; }
.hl-ds-dot { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hl-mot { border: 1px solid var(--vien); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.hl-dong { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.hl-dong strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hl-thanh { height: 6px; border-radius: 3px; background: var(--re); overflow: hidden; }
.hl-thanh span { display: block; height: 100%; background: var(--chinh); }
.nhan.tt-dang-chay { background: var(--chinh); color: var(--chinh-chu); }
.nhan.tt-tam-dung { background: var(--cho); color: #fff; }
.hl-chi-tiet ul { list-style: none; margin: 6px 0 0; padding: 0; max-height: 220px; overflow-y: auto; }
.hl-nguoi { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-bottom: 1px solid var(--vien); }
.hl-nguoi.loi { color: var(--loi); }
.hl-nguoi.da-gui .nho { color: var(--xanh); }
@media (max-width: 1180px) { .hl-luoi { grid-template-columns: minmax(0, 1fr); } }

/* Trang thai va nhan khach */
.mau-xam { --m: #8a96a8; } .mau-xanh { --m: #0068ff; } .mau-tim { --m: #7c3aed; } .mau-la { --m: #16a34a; } .mau-cam { --m: #ea580c; }
.mau-do { --m: #dc2626; } .mau-vang { --m: #ca8a04; } .mau-hong { --m: #db2777; } .mau-nau { --m: #92400e; }
.the { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; line-height: 16px; padding: 0 6px; border-radius: 8px; color: var(--m); background: color-mix(in srgb, var(--m) 14%, transparent); border: 1px solid color-mix(in srgb, var(--m) 35%, transparent); white-space: nowrap; }
.the.dac { color: #fff; background: var(--m); border-color: var(--m); }
.ht-the { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.loc-the { display: flex; gap: 6px; padding-bottom: 10px; }
.loc-the select { flex: 1; min-width: 0; font-size: 12px; padding: 4px 6px; border: 1px solid var(--vien); border-radius: 6px; background: var(--mat); color: var(--chu); }
.the-khach { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 16px; border-bottom: 1px solid var(--vien); background: var(--mat); }
.the-khach select, .the-khach input { font-size: 12px; padding: 3px 6px; border: 1px solid var(--vien); border-radius: 6px; background: var(--mat); color: var(--chu); }
.the-khach .o-ghi-chu { flex: 1 1 160px; min-width: 120px; }
.the-khach .chon-nhan { position: relative; }
.the-khach .chon-nhan > button { font-size: 12px; padding: 2px 8px; border: 1px dashed var(--vien); border-radius: 8px; background: none; color: var(--mo); cursor: pointer; }
.hop-nhan { position: absolute; top: calc(100% + 4px); left: 0; z-index: 20; min-width: 180px; background: var(--mat); border: 1px solid var(--vien); border-radius: 8px; padding: 6px; box-shadow: 0 6px 20px rgb(0 0 0 / .15); display: flex; flex-direction: column; gap: 2px; }
.hop-nhan label { flex-direction: row; align-items: center; gap: 6px; padding: 3px 4px; border-radius: 4px; cursor: pointer; }
.hop-nhan label:hover { background: var(--mat-2); }
.the-khach .lich-su-the { font-size: 11px; }
.ql-the { margin-top: 28px; border-top: 1px solid var(--vien); padding-top: 8px; }
.ql-the h2 { font-size: 16px; }
.ql-the h3 { font-size: 13px; margin: 8px 0 4px; }
.ql-the-cot { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ds-the-ql { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ds-the-ql li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ds-the-ql li.an .the { opacity: .45; text-decoration: line-through; }
.ds-the-ql select { font-size: 12px; padding: 2px 4px; }
.ds-the-ql label { flex-direction: row; align-items: center; gap: 4px; font-size: 12px; }

/* Hieu suat */
.hs-loc { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }
.hs-tong { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 8px; }
.hs-o { border: 1px solid var(--vien); border-radius: 10px; padding: 10px 12px; background: var(--mat-2); }
.hs-o .so { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hs-o .ten-o { font-size: 12px; color: var(--mo); }
.hs-o.canh .so { color: var(--cho); }
.vung-hs h3 { font-size: 14px; margin: 18px 0 6px; }
.hs-bang { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.hs-bang th, .hs-bang td { text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--vien); white-space: nowrap; font-size: 13px; }
.hs-bang th:first-child, .hs-bang td:first-child { text-align: left; }
.hs-bang th { font-size: 12px; color: var(--mo); font-weight: 600; }
.hs-thanh { display: inline-block; vertical-align: middle; height: 6px; border-radius: 3px; background: var(--chinh); margin-left: 6px; opacity: .7; }
.hs-cham { color: var(--cho); font-weight: 600; }
@media (max-width: 700px) { .ql-the-cot { grid-template-columns: 1fr; } }
.hs-loc .cong-tac { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; }

/* Nut gui nhanh tin mau */
.mau-nhanh { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 6px; }
.nut-mau-nhanh { font-size: 12px; padding: 3px 10px; border: 1px solid var(--chinh); color: var(--chinh); background: var(--mat); border-radius: 14px; cursor: pointer; }
.nut-mau-nhanh:hover { background: var(--chon); }
.nut-mau-nhanh:disabled { opacity: .5; cursor: default; }
.vung-the .ql-the { margin-top: 0; border-top: 0; padding-top: 0; }
#formMau .cong-tac { flex-direction: row; align-items: center; gap: 6px; }
#baoGui.xong { color: var(--xanh); }
.vung-the .ql-the-cot { grid-template-columns: 1fr; max-width: 640px; } .vung-the .ds-the-ql li { flex-wrap: nowrap; } .vung-the .ds-the-ql .the { min-width: 110px; justify-content: center; }

/* AI truc */
.goi-y-ai { border: 1px solid var(--chinh); border-radius: 8px; background: var(--chon); padding: 8px; margin-bottom: 6px; display: flex; flex-direction: column; gap: 6px; }
.goi-y-ai .goi-y-dau { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; font-size: 13px; }
.goi-y-ai textarea { width: 100%; resize: vertical; font: inherit; }
.goi-y-ai .thao-tac { display: flex; gap: 6px; }
.the-ai { font-size: 11px; padding: 0 8px; line-height: 18px; border-radius: 9px; background: var(--chon); color: var(--chinh); white-space: nowrap; }
.the-ai.tat { color: var(--mo); background: var(--mat-2); }
.the-khach .cong-tac-ai { flex-direction: row; align-items: center; gap: 4px; font-size: 12px; }
.form-ai { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 16px; max-width: 960px; }
.form-ai .rong { grid-column: 1 / -1; }
.form-ai textarea { width: 100%; font: 13px/1.5 inherit; }
.form-ai .thao-tac { display: flex; gap: 8px; }
.ai-nhat-ky td.ai-chu { white-space: normal; text-align: left; min-width: 220px; max-width: 420px; }
.ai-nhat-ky tr.ai-loi td { color: var(--loi); }
.ai-bang-nick td { text-align: left; }

/* Dao tao AI */
.dt-tab { margin-bottom: 8px; }
.dt-hai-cot { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dt-ds { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.dt-ds li.thieu { color: var(--cho); }
.form-kt { display: grid; grid-template-columns: 220px 1fr; gap: 8px 12px; max-width: 900px; margin-bottom: 12px; }
.form-kt .rong { grid-column: 1 / -1; }
.form-kt textarea { width: 100%; font: inherit; }
.form-kt .thao-tac { display: flex; gap: 8px; }
.vung-dt details { border: 1px solid var(--vien); border-radius: 8px; padding: 6px 10px; margin-bottom: 8px; max-width: 900px; }
.vung-dt summary { cursor: pointer; font-weight: 600; }
.dt-kt { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.dt-kt li { border-top: 1px solid var(--vien); padding-top: 6px; }
.dt-kt li.tat { opacity: .5; }
.dt-kt .kt-dau { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dt-kt .kt-dau .cong-tac { flex-direction: row; align-items: center; gap: 6px; }
.dt-kt .kt-chu { white-space: pre-wrap; font-size: 13px; color: var(--chu); margin: 4px 0 0 22px; }
.dt-chat { border: 1px solid var(--vien); border-radius: 8px; background: var(--nen); padding: 12px; height: 380px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; max-width: 760px; }
.dt-tin { display: flex; flex-direction: column; gap: 2px; max-width: 80%; }
.dt-tin.khach { align-self: flex-end; align-items: flex-end; }
.dt-tin.khach .tin { background: var(--minh); }
.dt-tin.shop { align-self: flex-start; }
.dt-tin .nut-phu { align-self: flex-start; }
.dt-nhap { display: flex; gap: 8px; max-width: 760px; margin-top: 8px; align-items: flex-end; }
.dt-nhap textarea { flex: 1; font: inherit; }
.hop-gop { width: min(560px, 92vw); }
.hop-gop label { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.hop-gop label.cong-tac { flex-direction: row; align-items: center; gap: 6px; }
.hop-gop textarea, .hop-gop select { font: inherit; width: 100%; }
.hop-gop .thao-tac { display: flex; gap: 8px; margin-top: 10px; }
@media (max-width: 800px) { .dt-hai-cot, .form-kt { grid-template-columns: 1fr; } }

/* Anh kem tin mau */
.mau-anh-khung { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--mo); }
.mau-anh-ds { display: flex; flex-wrap: wrap; gap: 6px; }
.mau-anh-o { position: relative; width: 72px; height: 72px; border: 1px solid var(--vien); border-radius: 6px; overflow: hidden; background: var(--mat-2); }
.mau-anh-o img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mau-anh-o.cho { opacity: .7; outline: 2px dashed var(--chinh); outline-offset: -2px; }
.mau-anh-o button { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: 12px; line-height: 20px; }
.mau-anh-them { align-self: flex-start; cursor: pointer; }
.mau-kem { border-left-color: #2e7d32; }
.mot-mau .co-anh, .ql-mau-chu .co-anh { color: var(--chinh); font-weight: 600; }

/* Chuyen tiep tin */
.hop-ct #ctTim { width: 100%; margin: 8px 0; }
.ct-xem { margin: 0; padding: 8px 10px; border-left: 3px solid var(--chinh); background: var(--mat-2); font-size: 13px; white-space: pre-line; max-height: 80px; overflow: hidden; }
.ds-ct { list-style: none; margin: 0; padding: 0; max-height: 45vh; overflow-y: auto; border-top: 1px solid var(--vien); }
.ds-ct label { display: flex; flex-direction: row; color: var(--chu); font-size: 14px; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px solid var(--vien); cursor: pointer; }
.ds-ct label:hover { background: var(--chon); }
.ds-ct .ten { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Danh ba */
.danh-ba-dong { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 2px 12px 6px; font-size: 12px; color: var(--mo); }
.nut-chu { white-space: nowrap; flex: none; background: none; border: 0; padding: 0; color: var(--chinh); cursor: pointer; font-size: 12px; }
.nut-chu:disabled { color: var(--mo); cursor: default; }
.ds-ht .tieu-de-db { padding: 10px 12px 4px; font-size: 12px; font-weight: 600; color: var(--mo); text-transform: uppercase; letter-spacing: .03em; }
.ht.ht-db .ht-tin { color: var(--chinh); }

/* Trang Danh ba */
.db-loc { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 8px 0; }
.db-loc label { font-size: 12px; color: var(--mo); }
.db-loc select, .db-loc input { display: block; margin-top: 3px; font-size: 13px; padding: 5px 8px; border: 1px solid var(--vien); border-radius: 6px; background: var(--mat); color: var(--chu); }
.db-loc .db-tim { flex: 1 1 220px; }
.db-loc .db-tim input { width: 100%; }
.db-thao-tac { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.db-thao-tac #dbDem { margin-right: auto; }
.db-bang td:nth-child(2), .db-bang th:nth-child(2), .db-bang td:nth-child(3), .db-bang th:nth-child(3) { text-align: left; }
.db-bang td:first-child { width: 28px; }
.db-ten { display: flex !important; flex-direction: row !important; align-items: center; gap: 8px; color: var(--chu); font-size: 13px; }
.db-bang .ht-the { margin-top: 0; }

/* Trang Cham soc */
.cs-dau { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 8px 0 12px; }
.cs-ds { display: grid; gap: 10px; margin-bottom: 16px; }
.cs-the { border: 1px solid var(--vien); border-radius: 8px; padding: 10px 12px; background: var(--mat); display: grid; gap: 8px; }
.cs-the.cs-cho-duyet { border-color: var(--chinh); }
.cs-the .hl-dong { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.cs-noi-dung { width: 100%; font: inherit; font-size: 13px; padding: 8px; border: 1px solid var(--vien); border-radius: 6px; background: var(--mat); color: var(--chu); resize: vertical; }
.cs-xem { margin: 0; white-space: pre-wrap; font: inherit; font-size: 13px; color: var(--chu); background: var(--mat-2); border-radius: 6px; padding: 8px; }
.cs-nick { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.cs-nick-o { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 4px; font-size: 13px; color: var(--chu); }
.cs-the .thao-tac { display: flex; flex-wrap: wrap; gap: 8px; }
.tt-cs-cho-duyet { color: var(--chinh); } .tt-cs-dang-chay { color: #16a34a; } .tt-cs-het-han { color: var(--loi); }

/* So tay TGH Ai Agent (Dao tao AI) */
.st-hai-cot { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 16px; align-items: start; }
.st-ds { max-height: 60vh; overflow: auto; }
.st-ds li.chon { background: var(--nen-chon, rgba(0, 104, 255, .08)); border-radius: 6px; }
.st-ds li.thieu .nut-chu strong { font-weight: 400; }
.st-ds .nut-chu { background: none; border: 0; padding: 4px 2px; text-align: left; cursor: pointer; width: 100%; font: inherit; color: inherit; }
#stNoiDung { width: 100%; box-sizing: border-box; font: 14px/1.5 ui-monospace, Consolas, monospace; }
#stTim { width: 100%; box-sizing: border-box; }
@media (max-width: 760px) { .st-hai-cot { grid-template-columns: 1fr; } }
