:root { --brand:#0E9BD6; --brand-d:#0B7DAC; --bg:#f4f8fb; --line:#e2e8ee; }
* { box-sizing:border-box; }
body { margin:0; font-family:'Segoe UI',system-ui,Arial,sans-serif; background:var(--bg); color:#1a2b3c; }
a { color:var(--brand); }
button { cursor:pointer; border:none; border-radius:8px; padding:8px 14px; font-size:14px;
  background:var(--brand); color:#fff; }
button.sec { background:#fff; color:var(--brand); border:1px solid var(--brand); }
button.warn { background:#ef6c00; }
button:hover { opacity:.92; }
input, textarea, select { padding:9px 10px; border:1px solid var(--line); border-radius:8px;
  font-size:14px; width:100%; font-family:inherit; }
label { font-size:13px; color:#5a6b7c; display:block; margin:8px 0 3px; }

/* login */
.login-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center;
  background:linear-gradient(180deg,var(--brand),#eaf6fc 45%); }
.login-card { background:#fff; padding:28px; border-radius:18px; width:360px;
  box-shadow:0 10px 30px rgba(0,0,0,.15); }
.logo { text-align:center; margin-bottom:14px; }
.logo .login-logo { height:88px; width:auto; border-radius:12px; }

/* layout */
header.top { background:var(--brand); color:#fff; padding:12px 20px; display:flex;
  align-items:center; gap:12px; }
header.top .t { font-weight:bold; font-size:18px; flex:1; display:flex; align-items:center; gap:10px; }
header.top .brand-logo { height:32px; width:32px; border-radius:7px; background:#fff; object-fit:contain; }
header.top .who { font-size:13px; opacity:.9; }
nav.tabs { display:flex; gap:4px; background:#fff; padding:0 12px; border-bottom:1px solid var(--line);
  flex-wrap:wrap; }
nav.tabs button { background:none; color:#5a6b7c; border-radius:0; border-bottom:3px solid transparent;
  padding:14px 16px; }
nav.tabs button.active { color:var(--brand); border-bottom-color:var(--brand); font-weight:600; }
main { padding:20px; max-width:1100px; margin:0 auto; }
h2 { margin:0 0 14px; font-size:20px; }
.card { background:#fff; border:1px solid var(--line); border-radius:14px; padding:16px; margin-bottom:16px; }
table { width:100%; border-collapse:collapse; font-size:14px; }
th, td { text-align:left; padding:9px 10px; border-bottom:1px solid var(--line); vertical-align:top; }
th { color:#5a6b7c; font-weight:600; background:#fafcfe; }
.muted { color:#8aa; font-size:13px; }
.row { display:flex; gap:12px; flex-wrap:wrap; }
.row > div { flex:1; min-width:140px; }
.pill { display:inline-block; background:#e3f2fd; color:var(--brand); padding:2px 8px;
  border-radius:10px; font-size:12px; }
.err { color:#c00; font-size:13px; margin-top:8px; }
code { background:#f0f4f8; padding:2px 6px; border-radius:5px; font-size:12px; word-break:break-all; }
.chips { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:10px; align-items:center; }
.chips .lbl { font-size:13px; color:#8aa; margin-right:2px; }
.chip { background:#fff; border:1px solid var(--line); color:#5a6b7c; padding:6px 12px;
  border-radius:18px; font-size:13px; cursor:pointer; user-select:none; }
.chip:hover { border-color:var(--brand); }
.chip.on { background:var(--brand); color:#fff; border-color:var(--brand); }
.chip.on.warn2 { background:#ef6c00; border-color:#ef6c00; }

/* chat */
.chat-wrap { display:flex; gap:12px; height:calc(100vh - 200px); min-height:420px; }
.chat-list { width:320px; overflow-y:auto; border:1px solid var(--line); border-radius:12px; background:#fff; }
.chat-conv { padding:10px 12px; border-bottom:1px solid var(--line); cursor:pointer; }
.chat-conv:hover { background:#f4f8fb; }
.chat-conv.on { background:#e6f4fb; }
.cc-top { display:flex; justify-content:space-between; align-items:center; gap:6px; }
.cc-prev { font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.badge-n { background:#e53935; color:#fff; border-radius:10px; padding:0 6px; font-size:11px; }
.chat-main { flex:1; display:flex; flex-direction:column; border:1px solid var(--line); border-radius:12px; background:#fff; overflow:hidden; }
.chat-head { padding:12px 16px; border-bottom:1px solid var(--line); font-weight:bold; }
.chat-msgs { flex:1; overflow-y:auto; padding:14px; display:flex; flex-direction:column; gap:6px; }
.chat-bubble { max-width:70%; align-self:flex-start; background:#eef2f5; padding:8px 12px; border-radius:12px; font-size:14px; }
.chat-bubble.mine { align-self:flex-end; background:var(--brand); color:#fff; }
.chat-bubble.mine a { color:#fff; }
.cb-name { font-size:11px; font-weight:bold; color:var(--brand-d); margin-bottom:2px; }
.chat-img { max-width:220px; border-radius:8px; display:block; }
.chat-input { display:flex; gap:8px; padding:10px; border-top:1px solid var(--line); }
.chat-input input#chatbox { flex:1; }
.chat-bubble.recalled { background:#f0f0f0; color:#999; }
.cb-recall { font-size:11px; color:#ffdede; cursor:pointer; display:none; margin-top:2px; }
.chat-bubble.mine:hover .cb-recall { display:inline; }
.mention { color:#fff; background:rgba(255,255,255,.25); padding:0 3px; border-radius:4px; }
.chat-bubble:not(.mine) .mention { color:var(--brand-d); background:#e6f4fb; }
.chat-mention-pop { position:absolute; bottom:52px; left:10px; width:280px; max-height:240px;
  overflow-y:auto; background:#fff; border:1px solid var(--line); border-radius:10px;
  box-shadow:0 6px 20px rgba(0,0,0,.15); z-index:10; }
.chat-mention-pop > div { padding:8px 12px; cursor:pointer; border-bottom:1px solid var(--line); }
.chat-mention-pop > div:hover { background:#f4f8fb; }

/* chat nâng cao */
.chat-row { display:flex; align-items:flex-start; gap:4px; }
.chat-row.r-mine { justify-content:flex-end; }
.chat-row.r-mine .cb-dots { order:2; }
.cb-dots { background:none; border:none; color:#aaa; cursor:pointer; padding:4px 6px; font-size:16px;
  visibility:hidden; align-self:center; }
.chat-row:hover .cb-dots { visibility:visible; }
.cb-quote { border-left:3px solid var(--brand); background:rgba(0,0,0,.06); padding:3px 8px;
  border-radius:4px; margin-bottom:4px; font-size:12px; }
.chat-bubble.mine .cb-quote { background:rgba(255,255,255,.2); border-left-color:#fff; }
.cb-like { margin-top:3px; font-size:12px; }
.msg-menu { position:fixed; background:#fff; border:1px solid var(--line); border-radius:10px;
  box-shadow:0 6px 24px rgba(0,0,0,.18); z-index:50; min-width:160px; overflow:hidden; }
.msg-menu > div { padding:9px 14px; cursor:pointer; font-size:14px; }
.msg-menu > div:hover { background:#f4f8fb; }
.msg-menu > div.danger { color:#c00; }
.reply-bar { padding:8px 12px; background:#eef4f8; border-top:1px solid var(--line); font-size:13px; }
.rb-x { float:right; cursor:pointer; color:#c00; font-weight:bold; }
.poll { min-width:240px; }
.poll-q { font-weight:bold; margin-bottom:6px; }
.poll-opt { position:relative; border:1px solid rgba(0,0,0,.15); border-radius:8px; padding:6px 10px;
  margin:3px 0; cursor:pointer; overflow:hidden; display:flex; align-items:center; }
.poll-opt.voted { border-color:var(--brand); }
.poll-bar { position:absolute; left:0; top:0; bottom:0; background:rgba(14,155,214,.18); z-index:0; }
.chat-bubble.mine .poll-bar { background:rgba(255,255,255,.3); }
.poll-txt { position:relative; z-index:1; flex:1; }
.poll-n { position:relative; z-index:1; font-weight:bold; }
.poll-detail { color:var(--brand-d); cursor:pointer; text-decoration:underline; }
.chat-bubble.mine .poll-detail { color:#dff; }
.modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,.4); display:none;
  align-items:center; justify-content:center; z-index:100; }
.modal-box { background:#fff; border-radius:14px; width:420px; max-width:92vw; max-height:80vh;
  overflow:hidden; display:flex; flex-direction:column; }
.modal-head { padding:14px 16px; border-bottom:1px solid var(--line); display:flex; justify-content:space-between; }
.modal-body { padding:16px; overflow-y:auto; }
.pr-opt { padding:8px 0; border-bottom:1px solid var(--line); }
.tab-dot { display:inline-block; width:8px; height:8px; background:#e53935; border-radius:50%; margin-left:6px; vertical-align:middle; }
.chat-col { width:320px; display:flex; flex-direction:column; gap:8px; }
.chat-col .chat-list { width:auto; flex:1; }
.chat-search { padding:8px 12px; border:1px solid var(--line); border-radius:10px; font-size:13px; }
.search-hd { padding:6px 12px; font-size:12px; font-weight:bold; color:#5a6b7c; background:#f4f8fb; }
.chat-head { display:flex; justify-content:space-between; align-items:center; }
.mute-btn { font-size:12px; padding:4px 10px; }
