/* BIZ: hội thoại, CRM, sản phẩm, đơn hàng, báo cáo (tiền tố cb-) */
.cb-seg { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; } .cb-seg button { white-space: nowrap; }

/* ---- hộp thư ---- */
.cb-inbox { display: grid; grid-template-columns: 320px minmax(0, 1fr) 300px; height: calc(100vh - 250px); min-height: 560px; overflow: hidden; padding: 0; }
.cb-col { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.cb-list { border-right: 1px solid var(--line); } .cb-info { border-left: 1px solid var(--line); overflow: auto; }
.cb-search { padding: 12px; border-bottom: 1px solid var(--line); } .cb-search .input { width: 100%; } .cb-search .ic { left: 24px; top: 24px; }
.cb-items { overflow: auto; flex: 1; min-height: 0; }
.cb-ci { display: flex; gap: 10px; width: 100%; text-align: left; padding: 12px; border: 0; border-bottom: 1px solid #f1f5f9; background: #fff; cursor: pointer; position: relative; align-items: flex-start; }
.cb-ci:hover { background: #f8fafc; } .cb-ci.on { background: var(--brand-50); box-shadow: inset 3px 0 0 var(--brand); }
.cb-ci-m { min-width: 0; flex: 1; display: grid; gap: 3px; } .cb-ci-top { display: flex; justify-content: space-between; gap: 8px; } .cb-ci-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; } .cb-ci-top time { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.cb-ci-last { font-size: 13px; color: #475569; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .cb-ci-bot { display: flex; gap: 4px; flex-wrap: wrap; }
.cb-ci-bot .badge { font-size: 11px; padding: 1px 8px; }
.cb-unread { min-width: 20px; height: 20px; border-radius: 10px; background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; padding: 0 6px; flex: none; }
.cb-chat-h, .cb-info-h { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); } .cb-info-h { gap: 8px; }
.cb-botstate { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; } .cb-botstate .ic { width: 14px; height: 14px; }
.cb-back, .cb-infobtn { display: none; }
.cb-actions { display: flex; gap: 8px; padding: 10px 16px; border-bottom: 1px solid #f1f5f9; flex-wrap: wrap; background: #fafbfd; }
.cb-msgs { flex: 1; min-height: 0; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: #f7f9fc; }
.cb-m { display: flex; flex-direction: column; max-width: 78%; gap: 2px; } .cb-m.cust { align-self: flex-start; } .cb-m.bot { align-self: flex-end; align-items: flex-end; } .cb-m.staff { align-self: flex-end; align-items: flex-end; }
.cb-b { padding: 9px 13px; border-radius: 16px; font-size: 14px; line-height: 1.5; word-break: break-word; white-space: pre-wrap; }
.cb-m.cust .cb-b { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 5px; } .cb-m.bot .cb-b { background: #e8f0ff; color: #0b3d91; border-bottom-right-radius: 5px; } .cb-m.staff .cb-b { background: var(--brand); color: #fff; border-bottom-right-radius: 5px; }
.cb-mt { font-size: 11px; color: var(--muted); }
.cb-compose { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: #fff; } .cb-compose .input { flex: 1; min-width: 0; }
.cb-simnote { padding: 0 16px 10px; background: #fff; display: flex; gap: 5px; align-items: center; } .cb-simnote .ic { width: 13px; height: 13px; }
.cb-info-b { padding: 16px; display: grid; gap: 12px; align-content: start; }
.cb-prof { display: grid; justify-items: center; gap: 4px; text-align: center; }
.cb-dl { display: grid; grid-template-columns: 1fr; gap: 2px; margin: 0; font-size: 13.5px; } .cb-dl dt { color: var(--muted); font-size: 12px; margin-top: 8px; } .cb-dl dd { margin: 0; word-break: break-word; }
.cb-dl2 { grid-template-columns: 200px 1fr; gap: 10px 16px; } .cb-dl2 dt { margin: 0; font-size: 13.5px; }
.cb-h4 { font-size: 13px; margin-top: 6px; color: var(--navy); } .cb-h3 { font-size: 15.5px; margin-bottom: 12px; }
.cb-mini { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; } .cb-mini:hover { background: var(--brand-50); } .cb-mini em { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); } .cb-mini > span:last-child { text-align: right; display: grid; gap: 2px; justify-items: end; }
.cb-noteform { display: grid; gap: 8px; justify-items: start; } .cb-noteform .textarea { min-height: 72px; }
.cb-note { padding: 10px 12px; background: #fffbea; border: 1px solid #f3e6a6; border-radius: 10px; font-size: 13.5px; margin-top: 8px; } .cb-note p { white-space: pre-wrap; word-break: break-word; }

/* ---- bảng / chung ---- */
.cb-th { border: 0; background: none; font: inherit; text-transform: inherit; letter-spacing: inherit; color: inherit; cursor: pointer; padding: 0; font-weight: 700; } .cb-th:hover { color: var(--brand); }
.cb-who { display: flex; gap: 10px; align-items: center; min-width: 0; } .cb-who > span { min-width: 0; display: grid; gap: 2px; } .cb-who em { font-style: normal; font-size: 12px; color: var(--muted); display: flex; gap: 4px; flex-wrap: wrap; } .cb-who em .badge { font-size: 11px; padding: 0 7px; } .cb-who:hover b { color: var(--brand); }
.cb-lnk { color: var(--brand-d); font-weight: 600; } .cb-lnk:hover { text-decoration: underline; }
.cb-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #f1f5f9; } .cb-row:last-child { border-bottom: 0; } .cb-done b { text-decoration: line-through; color: var(--muted); }
.cb-tl { display: flex; gap: 12px; padding: 0 0 14px; position: relative; } .cb-tl i { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); margin-top: 6px; flex: none; position: relative; z-index: 1; } .cb-tl::before { content: ""; position: absolute; left: 4px; top: 14px; bottom: -2px; width: 2px; background: #e2e8f0; } .cb-tl:last-child::before { display: none; } .cb-tl b { font-weight: 600; font-size: 14px; }
.cb-taskform { display: grid; grid-template-columns: 1fr 150px auto; gap: 8px; margin-bottom: 12px; }
.cb-usage { display: grid; gap: 8px; padding: 14px 18px; }
.cb-thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; display: inline-block; border: 1px solid var(--line); background: #f1f5f9; vertical-align: middle; } .cb-thumb-lg { width: 72px; height: 72px; }
.cb-thumb-l { display: inline-grid; place-items: center; font-weight: 800; font-size: 18px; color: #fff; border: 0; background: linear-gradient(135deg, hsl(var(--h) 70% 55%), hsl(calc(var(--h) + 40) 66% 45%)); }
.cb-line { display: grid; grid-template-columns: minmax(0, 1fr) 90px 130px 38px; gap: 8px; align-items: center; } .cb-lt { text-align: right; }
.cb-sum { margin-top: 12px; max-width: 360px; margin-left: auto; }
.cb-crm .toolbar .searchbox { min-width: 200px; }

/* ---- responsive ---- */
@media (max-width: 1100px) {
  .cb-inbox { grid-template-columns: 280px minmax(0, 1fr); } .cb-info { display: none; } .cb-infobtn { display: grid; }
  .cb-inbox[data-v="info"] { grid-template-columns: 1fr; } .cb-inbox[data-v="info"] .cb-list, .cb-inbox[data-v="info"] .cb-chat { display: none; } .cb-inbox[data-v="info"] .cb-info { display: flex; border-left: 0; } .cb-inbox[data-v="info"] .cb-info .cb-back { display: grid; }
}
@media (max-width: 760px) {
  .cb-inbox { grid-template-columns: 1fr; height: calc(100vh - 260px); min-height: 480px; } .cb-inbox .cb-list { border-right: 0; } .cb-inbox .cb-chat, .cb-inbox .cb-info { display: none; }
  .cb-inbox[data-v="list"] .cb-list { display: flex; } .cb-inbox[data-v="chat"] .cb-list, .cb-inbox[data-v="info"] .cb-list { display: none; } .cb-inbox[data-v="chat"] .cb-chat { display: flex; } .cb-inbox[data-v="info"] .cb-info { display: flex; }
  .cb-chat-h .cb-back { display: grid; } .cb-m { max-width: 90%; } .cb-dl2 { grid-template-columns: 1fr; gap: 2px; } .cb-dl2 dt { margin-top: 8px; font-size: 12px; }
  .cb-taskform { grid-template-columns: 1fr; } .cb-line { grid-template-columns: minmax(0, 1fr) 70px 38px; } .cb-line .cb-lt { grid-column: 1 / 3; text-align: left; order: 3; } .cb-line .iconbtn { grid-row: 1; grid-column: 3; }
  .cb-sum { max-width: none; }
}
.cb-crm td:nth-child(4), .cb-crm td:nth-child(5), .cb-crm td:nth-child(7), .cb-crm td:nth-child(9) { white-space: nowrap; }
@media (max-width: 760px) { .cb-crm td { white-space: normal !important; } }
.dcontent { grid-template-columns: minmax(0, 1fr); } .dcontent > .card, .dcontent > .stack, .dcontent > .two, .dcontent > .eq { min-width: 0; }
