/* =============================================================================
 * foxia-theme.css — Giao diện kiểu Foxia cho bản Vue (/index-vue.html).
 * -----------------------------------------------------------------------------
 * CHỈ được nạp bởi index-vue.html, sau /style.css → bản cũ "/" không bị ảnh hưởng.
 * Không đổi class/ID mà JS dựa vào; chỉ ghi đè hình thức + thêm class fx-*.
 * Token lấy từ báo cáo quét chat.foxia.vn (foxia-uiux-scan/BAO-CAO-UIUX-FOXIA.md).
 * Giữ màu thương hiệu Vigo (#0068ff) thay cho #1677ff của Foxia.
 * ========================================================================== */

/* ---------------------------------------------------------------- 1. TOKENS */
:root {
  --primary: #0068ff;
  --primary-hover: #0056d6;
  --primary-light: #e6f0ff;
  --bg-app: #f1f5f9;
  --bg-card: #ffffff;
  --border-color: #cbd5e1;
  --border-light: #e2e8f0;
  --text-main: #0f172a;
  --text-sub: #334155;
  --text-muted: #64748b;
  --success: #0bcb6b;
  --warning: #fa8c16;
  --danger: #f5222d;
  --radius-sm: 8px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --fx-ctrl-border: #cbd5e1;
  --fx-hover: rgba(0, 0, 0, 0.05);
  --fx-icon: #1e293b; /* màu icon menu / thanh lọc */
  --fx-active: rgba(0, 0, 0, 0.09);
  --fx-selected: #e0edff;
  --fx-out-bubble: #dbeafe;
  --fx-th-bg: #f8fafc;
  --fx-card-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  --fx-pop-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
  --fx-bubble-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(15, 23, 42, 0.06);
  --fx-drawer-shadow: -6px 0 16px rgba(15, 23, 42, 0.08);
  --fx-gap: 8px;
}

/* Font hệ thống như Zalo Web: San Francisco (Mac/iOS), Segoe UI (Windows), Roboto (Android). */
* {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
body {
  background: var(--bg-app);
  color: var(--text-main);
  font-size: 14px;
  line-height: 22px;
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
  text-rendering: optimizeLegibility;
}
button { font: inherit; color: inherit; }
b, strong { font-weight: 500; }
.ph { line-height: 1; }

/* Thanh cuộn mảnh */
.fx-shell ::-webkit-scrollbar { width: 6px; height: 6px; }
.fx-shell ::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.15); border-radius: 6px; }
.fx-shell ::-webkit-scrollbar-track { background: transparent; }

/* Tiện ích */
.fx-flex-1 { flex: 1; }
.fx-w-full { width: 100%; }
.fx-nowrap { white-space: nowrap; }
.ta-r { text-align: right !important; }
.mt-4 { margin-top: 4px; }
.mt-16 { margin-top: 16px; }
.gap-16 { gap: 16px !important; }
.w-80 { width: 80px; } .w-120 { width: 120px; } .w-160 { width: 160px; }
.w-200 { width: 200px; } .w-240 { width: 240px; }
.ellipsis { display: block; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-muted { color: var(--text-muted); }
.fx-muted-line { color: var(--text-sub); font-size: 13px; line-height: 20px; }
.fx-txt-green { color: #0bcb6b !important; }
.fx-txt-red { color: #f5222d !important; }
.fx-txt-orange { color: #fa8c16 !important; }
.fx-txt-gray { color: var(--text-muted) !important; }
.fx-pre { white-space: pre-wrap; }
.fx-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px; background: #f5f7fa; border: 1px solid var(--border-light);
  padding: 1px 6px; border-radius: 6px; color: var(--text-main); font-weight: 500;
}
.fx-spin { animation: fxSpin 0.8s linear infinite; display: inline-block; }
@keyframes fxSpin { to { transform: rotate(360deg); } }
.fx-flip { transform: scaleX(-1); display: inline-block; }
.fx-vsep { width: 1px; height: 20px; background: var(--border-color); flex-shrink: 0; }

/* ---------------------------------------------------------------- 2. CONTROLS */
.btn {
  height: 36px; padding: 0 15px; border-radius: 8px; font-size: 14px; font-weight: 400;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; line-height: 1; white-space: nowrap;
}
.btn .ph { font-size: 16px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 0 rgba(5, 145, 255, 0.1); }
.btn-primary:hover { background: #3385ff; }
.btn-primary:disabled, .btn-primary[disabled] {
  background: rgba(0, 0, 0, 0.04); color: rgba(0, 0, 0, 0.25); border-color: var(--fx-ctrl-border);
  box-shadow: none; cursor: not-allowed;
}
.btn-secondary { background: #fff; color: var(--text-main); border-color: var(--fx-ctrl-border); }
.btn-secondary:hover { background: #fff; color: var(--primary); border-color: var(--primary); }
.btn-secondary:disabled { color: rgba(0, 0, 0, 0.25); background: rgba(0, 0, 0, 0.04); cursor: not-allowed; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 14px; }
.btn-text { background: transparent; border: none; color: var(--text-main); }
.btn-text:hover { background: var(--fx-hover); }
.fx-btn-lg { height: 40px; font-size: 15px; }

.form-input, .form-textarea, .fx-select, .status-select {
  border: 1px solid var(--fx-ctrl-border); border-radius: 8px; font-size: 14px; color: var(--text-main);
  background: #fff; outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input, .fx-select { height: 36px; padding: 0 11px; }
.form-textarea { padding: 6px 11px; line-height: 22px; resize: vertical; width: 100%; }
.form-input:hover, .form-textarea:hover, .fx-select:hover { border-color: #4096ff; }
.form-input:focus, .form-textarea:focus, .fx-select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 2px rgba(0, 104, 255, 0.1);
}
.form-input:disabled, .fx-select:disabled {
  background: rgba(0, 0, 0, 0.04); color: rgba(0, 0, 0, 0.25); cursor: not-allowed; border-color: var(--fx-ctrl-border);
}
.fx-select { cursor: pointer; padding-right: 28px; appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 256 256'%3E%3Cpath fill='%2398a2b3' d='M213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32Z'/%3E%3C/svg%3E") no-repeat right 10px center;
}
.fx-select.sm { height: 32px; font-size: 13px; }
.form-group label, .fx-label { font-size: 14px; font-weight: 400; color: var(--text-main); margin-bottom: 6px; display: block; }
.fx-req { color: #ff4d4f; margin-right: 2px; }
.fx-input-count { position: relative; }
.fx-input-count .form-input { width: 100%; padding-right: 64px; }
.fx-count { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--text-muted); }
.fx-addon-input { display: flex; height: 36px; border: 1px solid var(--fx-ctrl-border); border-radius: 8px; overflow: hidden; background: #fff; }
.fx-addon-input span { background: var(--fx-th-bg); border-right: 1px solid var(--fx-ctrl-border); padding: 0 10px; display: flex; align-items: center; color: var(--text-sub); }
.fx-addon-input input { border: none; outline: none; padding: 0 10px; flex: 1; min-width: 0; font-size: 14px; }
.fx-addon-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(0, 104, 255, 0.1); }

.fx-search {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 11px; min-width: 260px;
  background: #fff; border: 1px solid var(--fx-ctrl-border); border-radius: 8px; transition: border-color 0.2s;
}
.fx-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(0, 104, 255, 0.1); }
.fx-search .ph { color: var(--text-muted); font-size: 16px; }
.fx-search input { border: none; outline: none; background: transparent; flex: 1; font-size: 14px; min-width: 0; color: var(--text-main); }
.fx-search.sm { height: 32px; min-width: 0; margin: 0 8px 8px; }

.fx-icon-btn {
  width: 32px; height: 32px; border-radius: 8px; border: none; background: transparent; color: var(--text-sub);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
  font-size: 18px; transition: background 0.15s, color 0.15s; padding: 0;
}
.fx-icon-btn:hover { background: var(--fx-hover); color: var(--text-main); }
.fx-icon-btn.on { background: var(--fx-active); color: var(--text-main); }
.fx-icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.fx-icon-btn.bordered { width: 36px; height: 36px; border: 1px solid var(--fx-ctrl-border); background: #fff; }
.fx-icon-btn.bordered:hover { border-color: var(--primary); color: var(--primary); }
.fx-icon-btn.danger:hover { color: #f5222d; background: #fff1f0; }
.fx-link {
  background: none; border: none; color: var(--primary); cursor: pointer; font-size: 14px; padding: 0;
  display: inline-flex; align-items: center; gap: 4px; text-decoration: none;
}
.fx-link:hover { color: #3385ff; }
.fx-clickable { cursor: pointer; }
.fx-dashed-btn {
  height: 32px; padding: 0 12px; border: 1px dashed var(--fx-ctrl-border); border-radius: 8px; background: #fff;
  color: var(--text-main); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 14px;
}
.fx-dashed-btn:hover { color: var(--primary); border-color: var(--primary); }

/* Switch (antd) */
.fx-switch {
  position: relative; width: 44px; height: 22px; border-radius: 100px; border: none; padding: 0; cursor: pointer;
  background: rgba(0, 0, 0, 0.25); transition: background 0.2s; flex-shrink: 0;
}
.fx-switch:hover { background: rgba(0, 0, 0, 0.45); }
.fx-switch.on { background: var(--primary); }
.fx-switch.on:hover { background: #3385ff; }
.fx-switch:disabled { opacity: 0.4; cursor: not-allowed; }
.fx-switch-knob {
  position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 4px rgba(0, 35, 11, 0.2); transition: left 0.2s;
}
.fx-switch.on .fx-switch-knob { left: 24px; }
.fx-switch.sm { width: 28px; height: 16px; }
.fx-switch.sm .fx-switch-knob { top: 2px; left: 2px; width: 12px; height: 12px; }
.fx-switch.sm.on .fx-switch-knob { left: 14px; }

/* Segmented */
.fx-seg { display: inline-flex; background: #f5f5f5; padding: 2px; border-radius: 8px; gap: 2px; }
.fx-seg button {
  border: none; background: transparent; height: 28px; padding: 0 12px; border-radius: 6px; cursor: pointer;
  color: var(--text-sub); font-size: 14px;
}
.fx-seg button.active { background: #fff; color: var(--text-main); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 1px 6px -1px rgba(0, 0, 0, 0.04); }
.fx-seg.sm button { height: 24px; font-size: 13px; padding: 0 10px; }

/* Tabs (line) */
.fx-tabs { display: flex; align-items: center; gap: 24px; border-bottom: 1px solid var(--border-color); margin-bottom: 16px; }
.fx-tabs button {
  background: none; border: none; padding: 10px 0; cursor: pointer; color: var(--text-main); font-size: 14px;
  position: relative; display: inline-flex; align-items: center; gap: 6px;
}
.fx-tabs button:hover { color: var(--primary); }
.fx-tabs button.active { color: var(--primary); }
.fx-tabs button.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--primary); }
.fx-tab-count { background: #f0f2f5; color: var(--text-sub); font-size: 12px; line-height: 18px; padding: 0 7px; border-radius: 100px; }
.fx-tabs button.active .fx-tab-count { background: var(--primary-light); color: var(--primary); }
.fx-tabs-note { font-size: 13px; }

/* Tag */
.fx-tag {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; line-height: 20px; padding: 0 8px;
  border-radius: 6px; border: 1px solid; white-space: nowrap;
}
.fx-tag-blue { color: #0958d9; background: #e6f4ff; border-color: #91caff; }
.fx-tag-cyan { color: #08979c; background: #e6fffb; border-color: #87e8de; }
.fx-tag-orange { color: #d46b08; background: #fff7e6; border-color: #ffd591; }
.fx-tag-purple { color: #531dab; background: #f9f0ff; border-color: #d3adf7; }
.fx-tag-green { color: #389e0d; background: #f6ffed; border-color: #b7eb8f; }
.fx-tag-red { color: #cf1322; background: #fff1f0; border-color: #ffa39e; }
.fx-tag-gray { color: var(--text-sub); background: #fafafa; border-color: var(--fx-ctrl-border); }
.fx-tag.solid.fx-tag-green { background: #0bcb6b; color: #fff; border-color: #0bcb6b; }
/* Cài đặt › Thẻ: 3 thẻ trạng thái khách là thẻ hệ thống — nhãn "Thẻ hệ thống", ô tên khoá (chỉ đổi màu) */
.fx-sys-tag { margin-left: 6px; vertical-align: 1px; }
.fx-sys-tag .ph { font-size: 12px; }
.fx-sys-tag-note { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.fx-tag-modal .form-input[readonly] { background: #f5f5f5; color: var(--text-sub); cursor: not-allowed; }
.tag-pill {
  font-size: 12px; line-height: 20px; padding: 0 8px; border-radius: 6px; background: #f5f5f5;
  color: var(--text-main); border: 1px solid #e8e8e8; font-weight: 400; display: inline-flex; align-items: center; gap: 4px;
}
.tag-pill .ph { cursor: pointer; font-size: 11px; color: var(--text-muted); }
.fx-tag-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.fx-swatch { display: inline-block; width: 16px; height: 16px; border-radius: 4px; vertical-align: -3px; margin-right: 4px; }
.fx-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.fx-swatch.lg { width: 28px; height: 28px; border-radius: 8px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border-color); cursor: pointer; margin: 0; }
.fx-swatch.lg.active { box-shadow: 0 0 0 2px var(--primary); }

.fx-count-badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 100px; background: #ff4d4f; color: #fff;
  font-size: 12px; line-height: 20px; text-align: center; font-weight: 400; flex-shrink: 0;
}
.fx-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #98a2b3; border: 1.5px solid #fff; flex-shrink: 0;
}
.fx-dot.connected, .fx-dot.green { background: #0bcb6b; }
.fx-dot.awaiting_qr { background: #fa8c16; }
.fx-dot.disconnected { background: #f5222d; }
.fx-dot.gray { background: #98a2b3; }
.fx-status { display: inline-flex; align-items: center; gap: 6px; }
.fx-status .fx-dot { border: none; }

.fx-soon {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; line-height: 20px; padding: 0 8px;
  border-radius: 100px; background: #fff7e6; color: #d46b08; border: 1px dashed #ffd591; font-weight: 400;
  margin-left: 8px; vertical-align: middle; white-space: nowrap; cursor: help;
}

/* Kênh: ô vuông chữ cái */
.fx-ch-ico {
  position: relative; width: 32px; height: 32px; border-radius: 8px; color: #fff; font-size: 12px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: #0068ff;
}
.fx-ch-ico.fb { background: #1877f2; }
.fx-ch-ico.oa { background: #0088ff; }
.fx-ch-ico.zalo { background: #0068ff; }
.fx-ch-ico.zalo-adv { background: #0284c7; }
.fx-ch-ico.lg { width: 36px; height: 36px; font-size: 13px; }
.fx-ch-ico.xs { width: 18px; height: 18px; font-size: 9px; border-radius: 5px; vertical-align: -4px; margin-right: 4px; }
.fx-ch-ico .fx-dot { position: absolute; right: -3px; bottom: -3px; }
.fx-ch-ico.corner { position: absolute; right: -4px; bottom: -4px; border: 1.5px solid #fff; margin: 0; }
.fx-brand-ico {
  width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, #ff8a65, #ff5c8a);
  display: inline-flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0;
}
.fx-brand-ico.sm { width: 32px; height: 32px; font-size: 16px; background: #f0f5ff; }
.fx-avatar-letter {
  position: relative; width: 32px; height: 32px; border-radius: 50%; background: #e6f0ff; color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 500; font-size: 14px; flex-shrink: 0;
}
.fx-avatar-letter .fx-dot { position: absolute; right: -1px; bottom: -1px; }
.fx-avatar-letter.xl { width: 72px; height: 72px; font-size: 28px; }
.fx-avatar-wrap { position: relative; display: inline-flex; }
.fx-avatar-wrap .fx-dot { position: absolute; right: -1px; bottom: -1px; }

/* Popover / menu */
.fx-popover {
  position: absolute; z-index: 1050; background: #fff; border-radius: 8px; box-shadow: var(--fx-pop-shadow);
  padding: 4px; min-width: 200px; animation: fxPopIn 0.12s ease-out;
}
@keyframes fxPopIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.fx-pop-title { padding: 8px 12px 6px; font-weight: 500; font-size: 14px; display: flex; align-items: baseline; gap: 8px; }
.fx-pop-title small { color: var(--text-muted); font-size: 12px; font-weight: 400; }
.fx-pop-group { padding: 8px 12px 4px; font-size: 12px; color: var(--text-muted); }
.fx-pop-item {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 12px; border: none; background: none;
  border-radius: 6px; cursor: pointer; font-size: 14px; color: var(--text-main); text-align: left; white-space: nowrap;
}
.fx-pop-item .ph { font-size: 18px; color: var(--text-sub); flex-shrink: 0; }
.fx-pop-item:hover:not(.static) { background: var(--fx-hover); }
.fx-pop-item.active { background: var(--primary-light); color: var(--primary); }
.fx-pop-item.active .ph { color: var(--primary); }
.fx-pop-item.danger, .fx-pop-item.danger .ph { color: #f5222d; }
.fx-pop-item.static { cursor: default; }
.fx-pop-item:disabled { opacity: 0.45; cursor: not-allowed; }
.fx-pop-right { margin-left: auto; font-size: 13px; color: var(--text-sub); display: inline-flex; align-items: center; gap: 4px; }
.fx-pop-sep { height: 1px; background: var(--border-light); margin: 4px 0; }
.fx-pop-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 8px; border-top: 1px solid var(--border-light); margin-top: 4px; }
.fx-popover-wrap { position: relative; }

/* ---------------------------------------------------------------- 3. SHELL */
.fx-shell {
  display: flex; height: 100vh; width: 100vw; overflow: hidden; background: var(--bg-app);
}
.fx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 8px 8px 8px 0; }
.fx-main.is-chat { padding: 0; }
.fx-page-host { flex: 1; min-height: 0; overflow: auto; }

/* Sidebar */
.fx-nav {
  width: 240px; flex-shrink: 0; display: flex; flex-direction: column; background: var(--bg-app);
  padding: 8px 8px 8px 8px; transition: width 0.2s; position: relative; z-index: 30;
  border-right: 1px solid var(--border-color);
}
.fx-nav.collapsed { width: 56px; }
.fx-nav-top { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.fx-nav.collapsed .fx-nav-top { flex-direction: column; }
.fx-switcher-wrap { position: relative; flex: 1; min-width: 0; }
.fx-switcher {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px; border: none; background: transparent;
  border-radius: 10px; cursor: pointer; text-align: left; position: relative; color: var(--text-main);
}
.fx-switcher:hover { background: rgba(0, 0, 0, 0.05); }
.fx-switcher-text { display: flex; flex-direction: column; min-width: 0; line-height: 18px; }
.fx-switcher-text b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-main); }
.fx-switcher-text small { font-size: 12px; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-switcher-av { position: relative; display: inline-flex; flex-shrink: 0; }
.fx-switcher-alert {
  position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: #fa8c16; border: 2px solid var(--bg-app);
}
.fx-switcher-pop { top: calc(100% + 6px); left: 0; width: 300px; padding: 4px 0 0; }
.fx-ch-list { max-height: 360px; overflow-y: auto; padding: 0 4px; }
.fx-ch-row {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: none; background: none;
  border-radius: 8px; cursor: pointer; text-align: left;
}
.fx-ch-row:hover { background: var(--fx-hover); }
.fx-ch-row.active { background: var(--primary-light); }
.fx-ch-row-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 18px; }
.fx-ch-row-text b { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-ch-row-text small { font-size: 12px; color: var(--text-sub); }
.fx-nav-toggle { color: var(--text-muted); }
.fx-nav-toggle:hover { color: var(--text-main); }

.fx-nav-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 4px; }
.fx-nav-group { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); padding: 8px 8px 4px; white-space: nowrap; }
.fx-nav.collapsed .fx-nav-group { padding: 4px 0; text-align: center; overflow: hidden; text-overflow: ellipsis; }
.fx-nav-divider { height: 1px; background: var(--border-color); margin: 8px 4px; }
.fx-nav-item {
  display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border: 1px solid transparent; background: transparent;
  border-radius: 8px; cursor: pointer; color: var(--text-sub); font-size: 14px; font-weight: 500; width: 100%; text-align: left;
  position: relative; flex-shrink: 0; transition: background-color 0.15s, color 0.15s;
}
.fx-nav-item > .ph:first-child { font-size: 20px; color: var(--text-sub); flex-shrink: 0; }
.fx-nav-item:hover { background: rgba(0, 0, 0, 0.05); color: var(--text-main); }
.fx-nav-item:hover > .ph:first-child { color: var(--text-main); }
.fx-nav-item:focus-visible, .fx-fp-opt:focus-visible, .fx-fp-row:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.fx-nav-item.active { background: #ffffff; color: var(--primary); font-weight: 600; border-color: rgba(0, 0, 0, 0.06); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); }
.fx-nav-item.active > .ph:first-child, .fx-nav-item.has-active > .ph:first-child { color: var(--primary); }
.fx-nav-item.has-active { color: var(--primary); }
.fx-nav-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-caret { font-size: 12px; color: var(--text-muted); }
.fx-nav-sub { display: flex; flex-direction: column; gap: 2px; }
.fx-nav-item.sub { height: 32px; padding-left: 40px; }
.fx-nav.collapsed .fx-nav-item { justify-content: center; padding: 0; width: 40px; height: 40px; align-self: center; border-radius: 8px; }
.fx-nav.collapsed .fx-nav-item > .ph:first-child { font-size: 22px; }
/* Thu gọn: mục đang mở */
.fx-nav.collapsed .fx-nav-item.active { background: #ffffff; color: var(--primary); border: 1px solid rgba(0, 0, 0, 0.06); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); }
.fx-nav.collapsed .fx-nav-label, .fx-nav.collapsed .fx-caret { display: none; }
.fx-nav.collapsed .fx-nav-item .fx-count-badge { position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; line-height: 18px; font-size: 10px; padding: 0 4px; border: 2px solid var(--bg-app); }
.fx-nav.collapsed .fx-switcher { justify-content: center; padding: 4px 0; }
.fx-nav-toggle-bottom { align-self: center; margin-top: 8px; flex-shrink: 0; color: var(--text-muted); }
.fx-nav-toggle-bottom:hover { color: var(--text-main); }

/* Tầng tài khoản: logo thương hiệu ở đầu sidebar (Foxia: chữ FOXIACHAT; Vizio: /brand/vizio-logo.png) */
.fx-nav-logo {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px; border: none; background: transparent;
  border-radius: 10px; cursor: pointer; text-align: left;
}
.fx-nav-logo:hover { background: rgba(0, 0, 0, 0.05); }
.fx-nav-logo-img { display: block; height: 36px; width: auto; max-width: 100%; object-fit: contain; }
.fx-nav.account-tier .fx-nav-top { margin-bottom: 12px; }

/* Avatar kênh (ChannelAvatar): tròn trong danh sách, bo vuông ở đầu sidebar */
.fx-chav { position: relative; display: inline-flex; flex-shrink: 0; width: 36px; height: 36px; }
.fx-chav.sm { width: 32px; height: 32px; }
.fx-chav.xl { width: 64px; height: 64px; }
.fx-chav > img, .fx-chav-letter { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.fx-chav-letter {
  display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 500; font-size: 14px; background: #0068ff;
}
.fx-chav-letter.fb { background: #1877f2; }
.fx-chav-letter.oa { background: #0088ff; }
.fx-chav-letter.zalo { background: #0068ff; }
.fx-chav-letter.zalo-adv { background: #0284c7; }
.fx-chav-letter.all { background: #e6f0ff; color: var(--primary); font-size: 18px; }
.fx-chav.xl .fx-chav-letter { font-size: 26px; }
.fx-chav.xl .fx-chav-letter.all { font-size: 30px; }
.fx-chav.square > img, .fx-chav.square .fx-chav-letter { border-radius: 10px; }
.fx-chav.sm.square > img, .fx-chav.sm.square .fx-chav-letter { border-radius: 8px; }
.fx-chav .fx-dot { position: absolute; right: -1px; bottom: -1px; }
.fx-chav.xl .fx-ch-ico.corner { width: 24px; height: 24px; font-size: 10px; border-radius: 6px; border-width: 2px; right: -2px; bottom: -2px; }

.fx-nav-bottom { position: relative; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border-color); }
.fx-user-card {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px; border: none; background: transparent;
  border-radius: 10px; cursor: pointer; text-align: left;
}
.fx-user-card:hover { background: rgba(0, 0, 0, 0.05); }
.fx-user-card > .ph { color: var(--text-muted); margin-left: auto; }
.fx-user-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 18px; }
.fx-user-text b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-user-text small { font-size: 12px; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-nav.collapsed .fx-user-card { justify-content: center; }
.fx-user-pop { bottom: calc(100% + 6px); left: 0; width: 260px; }
.fx-pop-user { display: flex; align-items: center; gap: 10px; padding: 8px 8px 6px; }

/* ---------------------------------------------------------------- 4. CARD / PAGE */
.fx-card { background: #fff; border-radius: 16px; box-shadow: var(--fx-card-shadow); }
.fx-page-card { padding: 24px; min-height: 100%; flex: 1; min-width: 0; }
.fx-page-card.fx-flush { padding: 0; }
.fx-page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.fx-page-head-text { flex: 1; min-width: 0; }
.fx-page-title { font-size: 18px; font-weight: 500; line-height: 26px; color: var(--text-main); display: flex; align-items: center; flex-wrap: wrap; }
.fx-page-sub { color: var(--text-sub); font-size: 14px; margin-top: 2px; }
.fx-page-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.fx-h2 { font-size: 16px; font-weight: 500; line-height: 24px; display: flex; align-items: center; gap: 8px; }
.fx-h2 .ph { color: var(--text-sub); }
.fx-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.fx-section-block { margin-top: 24px; }
.fx-section-block .fx-page-sub { margin-bottom: 16px; }
.fx-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.fx-inline { display: flex; gap: 8px; align-items: center; }
.fx-inline-form {
  display: flex; gap: 8px; align-items: center; padding: 16px; background: var(--fx-th-bg); border: 1px solid var(--border-light);
  border-radius: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.fx-inline-form .form-input:not([class*="w-"]) { flex: 1; min-width: 180px; }
.fx-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fx-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.fx-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; }
.fx-form-grid .form-input { width: 100%; }
.fx-form-actions { display: flex; justify-content: flex-end; margin-top: 24px; }
.fx-link-row { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }

/* Split: nav cấp 2 trái + card nội dung */
.fx-split { display: flex; gap: 8px; min-height: 100%; align-items: stretch; }
.fx-split > .fx-page-card { min-height: auto; }
.fx-subnav { width: 240px; flex-shrink: 0; padding: 16px 8px; align-self: stretch; }
.fx-subnav-title { font-size: 16px; font-weight: 500; padding: 0 12px 12px; }
.fx-subnav-group { font-size: 12px; color: var(--text-muted); padding: 12px 12px 4px; }
.fx-subnav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 12px; border: none;
  background: none; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--text-main); text-align: left;
}
.fx-subnav-item .ph { font-size: 18px; color: var(--text-sub); }
.fx-subnav-item:hover { background: var(--fx-hover); }
.fx-subnav-item.active { background: var(--primary-light); color: var(--primary); }
.fx-subnav-item.active .ph { color: var(--primary); }
.fx-side-stats { width: 300px; flex-shrink: 0; padding: 20px; align-self: flex-start; }
.fx-stat-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border-light); }
.fx-stat-row.head b { font-size: 16px; font-weight: 500; }
.fx-stat-row i { font-style: normal; color: var(--text-sub); font-size: 13px; }
.fx-stat-tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--border-light); }

/* Bảng */
.fx-table-wrap, .qr-manage-table-wrap { border: 1px solid var(--border-light); border-radius: 12px; overflow: auto; }
.fx-table, .qr-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.fx-table th, .qr-table th {
  background: var(--fx-th-bg); font-weight: 500; color: var(--text-main); text-align: left; padding: 12px 16px;
  border-bottom: 1px solid var(--border-light); white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
.fx-table td, .qr-table td { padding: 12px 16px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.fx-table tbody tr:last-child td { border-bottom: none; }
.fx-table tbody tr:hover td { background: #fafafa; }
.fx-table tr.clickable { cursor: pointer; }
.fx-table tfoot td { background: var(--fx-th-bg); font-weight: 500; border-top: 1px solid var(--border-light); }
.fx-table .w-check { width: 44px; }
.fx-td-center { text-align: center; color: var(--text-sub); padding: 32px !important; }
/* Bảng kẻ ô kiểu Foxia (Khách hàng): không xuống dòng, cuộn ngang, cột đầu ghim trái */
.fx-table-grid th { background: #fafafa; padding: 16px 8px; height: 55px; }
.fx-table-grid td { padding: 8px; height: 64px; white-space: nowrap; }
.fx-table-grid th, .fx-table-grid td { border-right: 1px solid var(--border-light); }
.fx-table-grid th:last-child, .fx-table-grid td:last-child { border-right: none; }
.fx-table-grid .w-check { width: 44px; min-width: 44px; max-width: 44px; padding: 0; text-align: center; }
.fx-table-grid .tag-pill + .tag-pill { margin-left: 4px; }
.fx-table-grid .fx-cell-ch { display: flex; align-items: center; gap: 6px; }
.fx-table-grid .fx-cell-user > span { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.fx-table-grid .fx-pin { position: sticky; left: 0; z-index: 2; background: #fff; }
.fx-table-grid th.fx-pin { z-index: 3; background: #fafafa; }
.fx-table-grid .fx-pin-2 { left: 44px; min-width: 200px; box-shadow: 4px 0 6px -4px rgba(0, 0, 0, 0.12); }
.fx-cell-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fx-cell-user > img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #f0f2f5; flex-shrink: 0; }
.fx-cell-2 { display: flex; flex-direction: column; min-width: 0; line-height: 20px; }
.fx-cell-2 small { font-size: 12px; color: var(--text-sub); }
.fx-thumb { width: 36px; height: 36px; border-radius: 8px; background: #fff0f6; color: #eb2f96; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.fx-ch-avatar { position: relative; width: 36px; height: 36px; flex-shrink: 0; display: inline-flex; }
.fx-ch-avatar > img, .fx-ch-avatar > .fx-avatar-letter { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.fx-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 16px; }
.fx-pagination .fx-muted { margin-right: auto; font-size: 13px; }
.fx-page-btn {
  min-width: 32px; height: 32px; border-radius: 6px; border: 1px solid transparent; background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 6px;
}
.fx-page-btn:hover:not(:disabled) { background: var(--fx-hover); }
.fx-page-btn.active { border-color: var(--primary); color: var(--primary); background: #fff; }
.fx-page-btn:disabled { color: rgba(0, 0, 0, 0.25); cursor: not-allowed; }

/* Trạng thái rỗng */
.fx-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 48px 16px; gap: 6px; }
.fx-empty-compact { padding: 24px 16px; }
.fx-empty-art {
  width: 72px; height: 72px; border-radius: 50%; background: #f5f7fa; color: #c4cad4; display: flex;
  align-items: center; justify-content: center; font-size: 34px; margin-bottom: 6px;
}
.fx-empty-compact .fx-empty-art { width: 52px; height: 52px; font-size: 26px; }
.fx-empty-title { font-weight: 500; color: var(--text-main); }
.fx-empty-desc { color: var(--text-sub); font-size: 13px; max-width: 420px; line-height: 20px; }
.fx-empty-cta { margin-top: 10px; display: flex; gap: 8px; }
.fx-empty .fx-soon { margin: 6px 0 0; }
.empty-state { color: var(--text-muted); text-align: center; padding: 40px 16px; font-size: 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-state .ph { font-size: 28px; }

/* Hàng cài đặt */
.fx-setting-row { display: flex; align-items: center; gap: 24px; padding: 16px 0; border-bottom: 1px solid var(--border-color); }
.fx-setting-text { flex: 1; min-width: 0; }
.fx-setting-label { font-weight: 500; }
.fx-setting-desc { color: var(--text-sub); font-size: 14px; margin-top: 2px; }
.fx-setting-control { flex-shrink: 0; display: flex; align-items: center; gap: 8px; }
.fx-setting-control .fx-select { min-width: 220px; }
.fx-radio-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.fx-radio-card {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 16px; text-align: left;
  background: #fff; border: 1px solid var(--border-color); border-radius: 12px; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s;
}
.fx-radio-card:hover { border-color: #91caff; }
.fx-radio-card.active { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); background: #f7fbff; }
.fx-radio-card small { color: var(--text-sub); font-size: 13px; line-height: 20px; }
.fx-radio-dot { position: absolute; top: 16px; right: 16px; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--fx-ctrl-border); background: #fff; }
.fx-radio-card.active .fx-radio-dot { border: 5px solid var(--primary); }

/* Tile icon */
.fx-tile {
  width: 40px; height: 40px; border-radius: 10px; background: #f0f5ff; color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; font-weight: 500;
}
.fx-tile.brand-zalo { background: #0068ff; color: #fff; font-size: 12px; }
.fx-tile.brand-fb { background: #1877f2; color: #fff; }

/* Card cài đặt tổng quan */
.fx-set-card {
  display: flex; align-items: flex-start; gap: 12px; padding: 16px; background: #fff; border: 1px solid var(--border-color);
  border-radius: 12px; cursor: pointer; text-align: left; transition: box-shadow 0.15s, border-color 0.15s;
}
.fx-set-card:hover { border-color: #91caff; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06); }
.fx-set-card-text { display: flex; flex-direction: column; line-height: 20px; gap: 2px; }
.fx-set-card-text b { font-weight: 500; }
.fx-set-card-text small { color: var(--text-sub); font-size: 13px; }

/* Hàng tích hợp */
.fx-int-row { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border-color); }
.fx-int-text { flex: 1; display: flex; flex-direction: column; line-height: 20px; }
.fx-int-text b { font-weight: 500; }
.fx-int-text small { color: var(--text-sub); font-size: 13px; }

/* KPI */
.fx-kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.fx-kpi {
  display: flex; align-items: center; gap: 12px; padding: 16px; background: #fff; border: 1px solid var(--border-color);
  border-radius: 12px; text-align: left; cursor: pointer; transition: box-shadow 0.15s, border-color 0.15s;
}
.fx-kpi:hover:not(.static) { border-color: #91caff; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06); }
.fx-kpi.static { cursor: default; }
.fx-kpi-ico {
  width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px; background: #f0f5ff; color: var(--primary); flex-shrink: 0;
}
.fx-kpi-ico.blue { background: #e6f4ff; color: #1677ff; }
.fx-kpi-ico.green { background: #f6ffed; color: #52c41a; }
.fx-kpi-ico.orange { background: #fff7e6; color: #fa8c16; }
.fx-kpi-ico.purple { background: #f9f0ff; color: #722ed1; }
.fx-kpi-ico.cyan { background: #e6fffb; color: #13c2c2; }
.fx-kpi-ico.red { background: #fff1f0; color: #f5222d; }
.fx-kpi-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.fx-kpi-text b { font-size: 20px; font-weight: 500; }
.fx-kpi-text small { color: var(--text-sub); font-size: 13px; }

/* Trang chủ */
.fx-home-hero { display: flex; align-items: center; gap: 16px; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--border-light); }
.fx-home-logo {
  width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(135deg, #ffe0e9, #fff1e6);
  display: flex; align-items: center; justify-content: center; font-size: 32px; flex-shrink: 0;
}
.fx-home-logo.sm { width: 32px; height: 32px; font-size: 18px; display: inline-flex; }
.fx-home-info { flex: 1; }
.fx-home-name { font-size: 20px; font-weight: 500; line-height: 28px; }
.fx-home-cols { display: flex; gap: 32px; margin-top: 4px; }
.fx-home-cols div { display: flex; flex-direction: column; line-height: 20px; }
.fx-home-cols small { color: var(--text-sub); font-size: 12px; }
.fx-list-card { border: 1px solid var(--border-color); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.fx-list-card-head { display: flex; align-items: center; gap: 8px; font-weight: 500; padding: 0 4px 8px; }
.fx-list-card-head .ph { color: var(--primary); font-size: 18px; }
.fx-list-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 8px; border: none; background: none; border-radius: 10px;
  text-align: left; cursor: pointer; width: 100%;
}
.fx-list-row:hover { background: #f5f7fa; }
.fx-list-row-text { flex: 1; display: flex; flex-direction: column; line-height: 20px; min-width: 0; }
.fx-list-row-text b { font-weight: 500; }
.fx-list-row-text small { color: var(--text-sub); font-size: 13px; }
.fx-chev { font-size: 22px; color: var(--text-muted); }
.fx-list-row:hover .fx-chev { color: var(--primary); }
.fx-check-line { display: flex; align-items: center; gap: 8px; padding: 4px; }

/* Báo cáo */
.fx-chart-box { position: relative; border: 1px solid var(--border-color); border-radius: 12px; padding: 16px; margin-bottom: 16px; min-height: 220px; }
.fx-chart-box.sm { min-height: 200px; margin-bottom: 0; }
.fx-chart-title { font-weight: 500; margin-bottom: 8px; }
.fx-chart-legend { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-sub); }
.fx-chart-legend .lg { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-left: 8px; }
.fx-chart-legend .lg.teal { background: #13c2c2; }
.fx-chart-legend .lg.blue { background: #1677ff; }
.fx-chart-empty { width: 100%; height: 180px; display: block; }
.fx-chart-box > .fx-empty { position: absolute; inset: 40px 0 0; background: transparent; }

/* Drawer */
.fx-drawer-mask { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 1000; display: flex; justify-content: flex-end; }
.fx-drawer { width: 420px; max-width: 100vw; height: 100%; background: #fff; box-shadow: var(--fx-drawer-shadow); overflow-y: auto; animation: fxDrawerIn 0.2s ease-out; }
@keyframes fxDrawerIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.fx-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; border-bottom: 1px solid var(--border-light); font-size: 16px; }
.fx-drawer .crm-section { padding: 16px 24px; }
.fx-drawer .fx-crm-hero { padding: 24px; }
.fx-drawer .fx-crm-name { justify-content: center; text-align: center; }
.fx-drawer .fx-crm-name .fx-icon-btn { width: 24px; height: 24px; font-size: 14px; }

/* Automation — từ khoá */
.fx-kw-list { display: flex; flex-direction: column; gap: 12px; }
.fx-kw-card { border: 1px solid var(--border-color); border-radius: 12px; padding: 12px 16px; background: #fff; }
.fx-kw-card.off { background: #fafafa; }
.fx-kw-head { display: flex; align-items: center; gap: 12px; }
.fx-kw-keys { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 32px; }
.fx-kw-input { border: none; outline: none; min-width: 180px; font-size: 14px; height: 28px; background: transparent; }
.fx-kw-body { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border-color); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.fx-kw-body .form-textarea { width: 100%; }
.fx-kw-cond { display: flex; gap: 8px; width: 100%; }
.fx-kw-cond .form-input { flex: 1; }
.fx-kw-preview { margin-top: 8px; color: var(--text-sub); font-size: 13px; display: flex; gap: 6px; }

/* Flow editor */
.fx-flow-editor { display: flex; flex-direction: column; height: 100%; min-height: 560px; overflow: hidden; }
.fx-flow-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border-light); }
.fx-breadcrumb { display: flex; align-items: center; gap: 6px; color: var(--text-sub); }
.fx-breadcrumb b { color: var(--text-main); font-weight: 500; }
.fx-flow-body { flex: 1; display: flex; min-height: 0; }
.fx-flow-inspector { width: 340px; border-right: 1px solid var(--border-light); padding: 16px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.fx-flow-step-title { font-weight: 500; display: flex; align-items: center; gap: 6px; }
.fx-flow-step-title .ph { color: var(--text-muted); }
.fx-flow-block { border: 1px solid var(--border-color); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; color: var(--text-sub); }
.fx-flow-add-blocks { display: flex; gap: 8px; flex-wrap: wrap; }
.fx-step-pop { bottom: calc(100% + 6px); left: 0; right: 0; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.fx-step-type {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--border-color); border-radius: 10px;
  background: #fff; cursor: pointer; text-align: left;
}
.fx-step-type:hover { border-color: var(--primary); }
.fx-step-type .fx-kpi-ico { width: 32px; height: 32px; font-size: 16px; }
.fx-flow-canvas {
  flex: 1; position: relative; background-color: #f7f8fa; overflow: hidden;
  background-image: radial-gradient(#d0d5dd 1px, transparent 1px); background-size: 16px 16px;
}
.fx-flow-node {
  position: absolute; top: 60px; left: 80px; width: 320px; background: #fff; border-radius: 16px; padding: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08); border: 2px solid transparent;
}
.fx-flow-node.selected { border-color: #0bcb6b; }
.fx-flow-start {
  position: absolute; top: -12px; left: 16px; background: var(--primary); color: #fff; font-size: 12px; line-height: 22px;
  padding: 0 10px; border-radius: 100px; display: inline-flex; align-items: center; gap: 4px;
}
.fx-flow-node-title { font-weight: 500; display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; }
.fx-flow-node-title .ph { color: var(--primary); font-size: 18px; }
.fx-flow-node-bubble { background: #f5f7fa; border-radius: 12px; padding: 10px 12px; font-size: 13px; color: var(--text-sub); }
.fx-flow-node-next { margin-top: 12px; text-align: right; font-size: 13px; color: var(--text-sub); display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.fx-flow-handle { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--primary); background: #fff; margin-right: -24px; }
.fx-flow-tools { position: absolute; right: 16px; top: 16px; display: flex; flex-direction: column; gap: 4px; background: #fff; border-radius: 10px; padding: 4px; box-shadow: var(--fx-card-shadow); }

/* AI Agents */
.fx-welcome { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 56px 16px; gap: 12px; }
.fx-welcome-art {
  width: 120px; height: 120px; border-radius: 32px; background: linear-gradient(135deg, #e6f0ff, #f3e8ff);
  display: flex; align-items: center; justify-content: center; font-size: 56px; color: #722ed1;
}
.fx-welcome h2 { font-size: 20px; font-weight: 500; }
.fx-welcome p { color: var(--text-sub); max-width: 480px; }
.fx-kb-block { border: 1px solid var(--border-color); border-radius: 12px; padding: 12px 16px; }
.fx-kb-head { font-weight: 500; display: flex; align-items: center; gap: 6px; }
.fx-kb-head .ph { color: var(--text-muted); }

/* Phát tin */
.fx-bc-section { margin-bottom: 24px; }

/* Quyền truy cập */
.fx-modal-xl { max-width: 1040px !important; width: 94vw; }
.fx-perm-body { display: flex; gap: 16px; background: var(--bg-app); max-height: 70vh; overflow-y: auto; }
.fx-perm-main { flex: 1; background: #fff; border-radius: 12px; padding: 16px; }
.fx-perm-main > .form-input { width: 100%; }
.fx-perm-side { width: 280px; background: #fff; border-radius: 12px; padding: 16px; align-self: flex-start; }
.fx-perm-table td:not(:first-child), .fx-perm-table th:not(:first-child) { text-align: center; width: 90px; }
.fx-perm-group td { background: var(--fx-th-bg); font-weight: 500; }
.fx-perm-child { padding-left: 36px !important; }
.fx-profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }

/* ---------------------------------------------------------------- 5. MODAL / TOAST */
.modal-overlay { background: rgba(0, 0, 0, 0.45); z-index: 1000; }
.modal-card { border-radius: 12px; box-shadow: var(--fx-pop-shadow); }
.modal-header { padding: 16px 24px; border-bottom: 1px solid var(--border-light); }
.modal-header h3 { font-size: 16px; font-weight: 500; }
.modal-body { padding: 20px 24px; }
.btn-close { width: 32px; height: 32px; border-radius: 8px; font-size: 22px; color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; }
.btn-close:hover { background: var(--fx-hover); }
.modal-body > .form-row, .modal-body > .form-group { margin-bottom: 12px; }
.modal-body .form-row > .form-input, .modal-body .form-group > .form-input { width: 100%; min-width: 0; }
/* Bảng sản phẩm trong modal đơn hàng: ô nhập co theo cột, không tràn modal */
.modal-body .qr-table th, .modal-body .qr-table td { padding: 8px; position: static; }
.modal-body .qr-table .form-input { width: 100%; min-width: 0; height: 32px; }
.modal-body .qr-table select {
  width: 100%; height: 32px; border: 1px solid var(--fx-ctrl-border); border-radius: 8px; padding: 0 8px;
  background: #fff; font-size: 13px; color: var(--text-main); outline: none;
}
.fx-modal-sm { max-width: 480px !important; }
.fx-modal-md { max-width: 640px !important; }
.fx-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 24px 20px; }
.qr-add-form h4 { font-weight: 500; font-size: 14px; }
.form-row input { height: 36px; border-radius: 8px; border-color: var(--fx-ctrl-border); font-size: 14px; }
.channel-tab-btn { font-weight: 400; border-radius: 8px; }
.choice-card { border-radius: 12px; }
.choice-info h4 { font-weight: 500; }
.status-badge-inline { font-weight: 400; font-size: 12px; border-radius: 6px; }
/* Badge loại kênh (modal Quản lý kênh): style.css thiếu nền → chữ trắng trên nền trắng */
.tab-badge.zalo-bg { background: #0068ff; }
.tab-badge.oa-bg { background: #0088ff; }
.tab-badge.fb-bg { background: #1877f2; }
.tab-badge { font-weight: 500; flex-shrink: 0; }

.toast-container { bottom: 24px; right: 24px; z-index: 10050; }
.toast {
  background: #fff; color: var(--text-main); border-radius: 8px; padding: 10px 16px 10px 14px; font-size: 14px;
  box-shadow: var(--fx-pop-shadow); border-left: 4px solid var(--primary); max-width: 420px; line-height: 20px;
}
.toast.toast-success { border-left-color: #0bcb6b; }
.toast.toast-error { border-left-color: #f5222d; }
.toast.toast-warning { border-left-color: #fa8c16; }
.toast.toast-info { border-left-color: var(--primary); }

.inbound-toast { border-radius: 12px; border-color: var(--border-light); box-shadow: var(--fx-pop-shadow); bottom: 24px; right: 24px; }
.inbound-toast-title { font-weight: 500; color: var(--text-main); font-size: 14px; }
.inbound-toast-msg { color: var(--text-sub); font-size: 13px; }
.inbound-toast-badge { font-weight: 400; border-radius: 100px; padding: 0 6px; }
.fx-inbound-ico { width: 40px; height: 40px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }

/* Softphone: header sáng */
.softphone-widget { border-radius: 16px; box-shadow: var(--fx-pop-shadow); }
.softphone-header { background: #fff; color: var(--text-main); border-bottom: 1px solid var(--border-light); }
.softphone-title { font-weight: 500; }
.btn-softphone-head { color: var(--text-sub); }
.btn-softphone-head:hover { color: var(--text-main); background: var(--fx-hover); }

/* ---------------------------------------------------------------- 6. LIVE CHAT */
/* Bố cục theo tỷ lệ Zalo Web: các cột phẳng tràn màn, ngăn bằng 1 đường kẻ
   mảnh, nền vùng tin xám xanh #ebecf0, chữ 15–16px. Token riêng cho màn này. */
.app-container.fx-livechat {
  --zl-line: #d6d9dc; --zl-bg: #ebecf0; --zl-hover: #f3f5f8; --zl-selected: #e5efff; --zl-icon: #475569;
  --text-main: #081c36; --text-sub: #334155; --text-muted: #64748b;
  height: 100%; width: auto; flex: 1; min-height: 0; gap: 0; background: #fff; overflow: hidden;
  border-left: 1px solid var(--zl-line); color: var(--text-main);
}
.fx-lc-card { background: #fff; border-radius: 0; box-shadow: none; overflow: hidden; display: flex; min-height: 0; }
.fx-lc-list { flex-shrink: 0; }
.fx-lc-chat { flex: 1; min-width: 0; border-left: 1px solid var(--zl-line); }
.fx-lc-crm { flex-shrink: 0; border-left: 1px solid var(--zl-line); }

/* Bộ lọc (màn lớn): KHÔNG còn cột icon riêng — nút phễu trên thanh công cụ danh sách mở bảng thả xuống. */
.fx-lc-list { position: relative; }
.fx-filter-btn { position: relative; }
.fx-filter-btn.has-filter { color: var(--primary); }
.fx-filter-badge {
  position: absolute; top: 1px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: #ef4444; color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; border: 1.5px solid #fff;
}
.fx-filter-pop {
  position: absolute; z-index: 60; top: 54px; left: 10px; right: 10px; max-height: calc(100% - 64px);
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--zl-line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(8, 28, 54, 0.16), 0 2px 6px rgba(8, 28, 54, 0.08); outline: none;
  animation: fx-pop-in 0.14s ease-out;
}
@keyframes fx-pop-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.fx-fp-head { display: flex; align-items: center; gap: 8px; padding: 10px 8px 6px 16px; }
.fx-fp-head b { flex: 1; font-size: 15px; font-weight: 600; color: var(--text-main); }
.fx-fp-head .fx-icon-btn { width: 30px; height: 30px; color: var(--zl-icon); }
.fx-fp-link { border: none; background: none; color: var(--primary); font-size: 13px; font-weight: 500; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.fx-fp-link:hover { background: var(--primary-light); }
.fx-fp-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 10px 8px; }
.fx-fp-sec { display: flex; align-items: center; gap: 6px; margin: 10px 4px 6px; font-size: 12px; font-weight: 600; color: var(--text-sub); text-transform: uppercase; letter-spacing: 0.3px; }
.fx-fp-soon { font-size: 10px; font-weight: 600; text-transform: none; letter-spacing: 0; color: #d46b08; background: #fff7e6; border-radius: 4px; padding: 1px 6px; }
.fx-fp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.fx-fp-opt {
  position: relative; display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 9px; border-radius: 8px;
  border: 1px solid var(--zl-line); background: #fff; color: var(--text-main); font-size: 13px; cursor: pointer; text-align: left;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.fx-fp-opt .ph { font-size: 18px; color: var(--zl-icon); flex-shrink: 0; }
.fx-fp-opt span:not(.fx-rail-dot) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-fp-opt:hover { background: var(--zl-hover); }
.fx-fp-opt.active { background: var(--zl-selected); border-color: var(--primary); color: var(--primary); font-weight: 500; }
.fx-fp-opt.active .ph { color: var(--primary); }
.fx-fp-opt .fx-rail-dot { top: 6px; right: 6px; }
.fx-rail-dot { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #ff4d4f; border: 1.5px solid #fff; }
.fx-fp-list { display: flex; flex-direction: column; }
.fx-fp-row {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 6px 8px; border: none; border-radius: 8px;
  background: none; color: var(--text-main); font-size: 13px; text-align: left; cursor: pointer; transition: background-color 0.15s;
}
.fx-fp-row:hover { background: var(--zl-hover); }
.fx-fp-row > .ph { font-size: 18px; color: var(--zl-icon); flex-shrink: 0; }
.fx-fp-row.is-stub { color: var(--text-sub); }
.fx-fp-row.is-stub > .ph { color: var(--text-muted); }
.fx-fp-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fx-fp-row-text small { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-fp-row kbd { font: 11px/1 inherit; color: var(--text-muted); background: var(--zl-bg); border-radius: 4px; padding: 3px 5px; }
.fx-fp-foot { border-top: 1px solid var(--zl-line); padding: 6px 12px 10px; }
.fx-fp-live { display: flex; align-items: center; gap: 8px; padding: 6px 8px 0; font-size: 12px; color: var(--text-sub); }
.fx-filter-pop .fx-live-dot { margin: 0 2px; }
/* Hàng tab: chấm đỏ "có tin chưa đọc" + trạng thái realtime (trước ở cột icon) */
.fx-tab-dot { display: inline-block; width: 7px; height: 7px; margin-left: 5px; vertical-align: 5px; border-radius: 50%; background: #ff4d4f; }
.fx-conv-live { margin-left: auto; align-self: center; display: inline-flex; align-items: center; gap: 6px; padding-right: 2px; font-size: 12px; color: #cf1322; cursor: default; }
.fx-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #0bcb6b; box-shadow: 0 0 0 3px rgba(11, 203, 107, 0.18); }
.fx-live-dot.off { background: #f5222d; box-shadow: 0 0 0 3px rgba(245, 34, 45, 0.15); }

/* Thanh kênh (màn lớn): avatar kênh ngang phía trên ô tìm kiếm — ChannelStrip.js */
.fx-chstrip { position: relative; display: flex; align-items: center; margin: -4px -6px 0; min-width: 0; }
.fx-chs-scroll {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 4px 6px; overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; scroll-behavior: auto;
}
.fx-chs-scroll::-webkit-scrollbar { display: none; }
.fx-chs-scroll.fade-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
.fx-chs-scroll.fade-l { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent); }
.fx-chs-scroll.fade-l.fade-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent); }
.fx-chs-item, .fx-chs-add {
  position: relative; flex-shrink: 0; width: 40px; height: 40px; padding: 0; border: none; border-radius: 50%; background: none;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background-color 0.15s, box-shadow 0.15s;
}
.fx-chs-item:hover { background: var(--zl-hover); }
.fx-chs-item.active { box-shadow: inset 0 0 0 2px var(--primary); background: var(--zl-selected); }
.fx-chs-item.off .fx-chav > img, .fx-chs-item.off .fx-chav-letter { filter: grayscale(1); opacity: 0.55; }
.fx-chs-item .fx-ch-ico.corner { right: -3px; bottom: -3px; }
.fx-chs-count {
  position: absolute; top: -1px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; border: 2px solid #fff;
  background: #f5222d; color: #fff; font-size: 10px; font-weight: 700; line-height: 14px; text-align: center; box-sizing: border-box;
}
.fx-chs-warn { position: absolute; top: 1px; left: 1px; width: 10px; height: 10px; border-radius: 50%; background: #fa8c16; border: 2px solid #fff; }
.fx-chs-sep { flex-shrink: 0; width: 1px; height: 22px; margin: 0 1px; background: var(--zl-line); }
.fx-chs-add { width: 32px; height: 32px; margin-left: 2px; border: 1.5px dashed #b8c2cf; color: var(--text-sub); font-size: 16px; }
.fx-chs-add:hover, .fx-chs-add.on { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.fx-chs-nav {
  position: absolute; top: 50%; z-index: 2; width: 24px; height: 24px; margin-top: -12px; border-radius: 50%; border: 1px solid var(--zl-line);
  background: #fff; color: var(--zl-icon); font-size: 12px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 0 1px 4px rgba(8, 28, 54, 0.12);
}
.fx-chs-nav:hover { color: var(--primary); border-color: var(--primary); }
.fx-chs-nav.prev { left: 0; }
.fx-chs-nav.next { right: 0; }
.fx-chs-menu {
  position: absolute; z-index: 61; top: calc(100% + 4px); right: 4px; width: 232px; padding: 6px; background: #fff;
  border: 1px solid var(--zl-line); border-radius: 12px; box-shadow: 0 12px 32px rgba(8, 28, 54, 0.16), 0 2px 6px rgba(8, 28, 54, 0.08);
  animation: fx-pop-in 0.14s ease-out;
}
.fx-chs-menu-title { padding: 6px 8px 4px; font-size: 12px; font-weight: 600; color: var(--text-sub); text-transform: uppercase; letter-spacing: 0.3px; }
.fx-chs-menu-row {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 8px; border: none; border-radius: 8px;
  background: none; color: var(--text-main); font-size: 13px; text-align: left; cursor: pointer;
}
.fx-chs-menu-row:hover { background: var(--zl-hover); }
.fx-chs-menu-row .fx-ch-ico { width: 22px; height: 22px; font-size: 10px; border-radius: 6px; margin: 0; flex-shrink: 0; }
.fx-chs-menu-row > .ph { width: 22px; text-align: center; font-size: 18px; color: var(--zl-icon); }
.fx-chs-menu-row.is-stub { color: var(--text-sub); }
.fx-chs-menu-row.is-stub .fx-ch-ico { opacity: 0.6; }
.fx-chs-menu-text { flex: 1; min-width: 0; }
.fx-chs-menu-sep { height: 1px; margin: 4px 2px; background: var(--zl-line); }
.fx-chs-item:focus-visible, .fx-chs-add:focus-visible, .fx-chs-menu-row:focus-visible { outline: 2px solid #91caff; outline-offset: 1px; }
/* Màu nền tảng mới (chờ IT nối TikTok / Shopee) */
.fx-ch-ico.tt, .fx-chav-letter.tt, .conv-channel-badge.tt { background: #111; color: #fff; }
.fx-ch-ico.sp, .fx-chav-letter.sp, .conv-channel-badge.sp { background: #ee4d2d; color: #fff; }

/* Danh sách hội thoại */
.col-conversations { width: 360px; border-right: none; background: #fff; }
.conv-header { padding: 16px 16px 0; border-bottom: 1px solid var(--zl-line); gap: 8px; }
.fx-conv-toolbar { display: flex; align-items: center; gap: 4px; }
.fx-conv-toolbar .fx-icon-btn { width: 32px; height: 32px; color: var(--zl-icon); }
.fx-check { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 32px; cursor: pointer; }
.fx-check input { width: 16px; height: 16px; cursor: pointer; }
.search-box { flex: 1; height: 32px; padding: 0 10px; background: #eaedf0; border-radius: 8px; border: 1px solid transparent; transition: background-color 0.15s, border-color 0.15s; }
.search-box:focus-within { background: #fff; border-color: var(--primary); }
.search-box input { font-size: 14px; color: var(--text-main); }
.search-box input::placeholder { color: var(--text-muted); }
.search-icon { font-size: 16px; color: var(--text-sub); }
.fx-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fx-chip {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 6px;
  background: var(--primary-light); color: var(--primary); font-size: 12px;
}
.fx-chip .ph { cursor: pointer; font-size: 12px; }
/* Tab "Tất cả | Chưa đọc" gạch chân xanh như Zalo */
.fx-conv-tabs { display: flex; align-items: center; gap: 12px; margin-top: 2px; }
.fx-conv-tabs button {
  position: relative; height: 36px; padding: 0; border: none; background: none; cursor: pointer;
  font-size: 13.5px; font-weight: 500; color: var(--text-sub); transition: color 0.15s;
  white-space: nowrap; flex-shrink: 0;
}
.fx-conv-tabs button:hover { color: var(--text-main); }
.fx-conv-tabs button.active { color: var(--primary); font-weight: 600; }
.fx-conv-tabs button.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--primary);
}
.conversation-list { padding: 8px 0; }
/* Item bo 8 khi rê / chọn, cách mép 8px */
.conv-item {
  margin: 0 8px; padding: 12px 10px; gap: 12px; border: none !important; border-radius: 8px;
  min-height: 72px; align-items: center; transition: background-color 0.12s;
}
.conv-item:hover { background: #f8fafc; }
.conv-item.active, .conv-item.active:hover {
  background: #eff6ff !important;
  border-left: 3px solid var(--primary) !important;
  border-top-left-radius: 2px !important;
  border-bottom-left-radius: 2px !important;
  box-shadow: none !important;
}
.conv-item.unread { background: transparent; }
.conv-item.unread:hover { background: #f8fafc; }
.conv-item.unread.active {
  background: #eff6ff !important;
  border-left: 3px solid var(--primary) !important;
  border-top-left-radius: 2px !important;
  border-bottom-left-radius: 2px !important;
  box-shadow: none !important;
}
.conv-avatar { width: 48px; height: 48px; background: #f0f2f5; }
.conv-channel-badge { width: 18px; height: 18px; font-size: 9px; font-weight: 600; border: 2px solid #fff; bottom: -2px; right: -2px; }
/* Badge = ảnh đại diện của kênh (ConversationList.js) */
.conv-channel-badge.is-av { object-fit: cover; background: #fff; padding: 0; }
.conv-info { gap: 2px; min-width: 0; }
.conv-top-row { align-items: center; gap: 8px; }
.conv-name { font-size: 15px; font-weight: 600; line-height: 22px; color: var(--text-main); }
.conv-time { font-size: 12px; color: var(--text-muted); flex-shrink: 0; font-weight: 500; }
.conv-msg-row { align-items: center; gap: 6px; }
.conv-last-msg { font-size: 13px; color: var(--text-sub); line-height: 20px; font-weight: 450; }
.conv-item.unread .conv-name { font-weight: 700; color: var(--text-main); }
.conv-item.unread .conv-last-msg { font-weight: 600; color: var(--text-main); }
.conv-item.unread .conv-time { color: var(--primary); font-weight: 600; }
.conv-unread { min-width: 18px; height: 18px; border-radius: 100px; font-size: 11px; font-weight: 700; background: #ef4040; box-shadow: none; padding: 0 5px; flex-shrink: 0; }
.fx-ic-phone { color: #0bcb6b; font-size: 14px; flex-shrink: 0; }
.conv-tags-row { align-items: center; margin-top: 4px; gap: 4px; }
.conv-account-badge {
  font-size: 12px; font-weight: 500; line-height: 18px; padding: 0 6px; border-radius: 4px; background: #e2e8f0; color: var(--text-sub); max-width: 150px;
}
.conv-staff-badge {
  font-size: 11px; font-weight: 400; line-height: 18px; padding: 0 4px; color: #72808e; white-space: nowrap; flex-shrink: 0;
}
.conv-tags-row .tag-pill { font-size: 12px; line-height: 18px; padding: 0 6px; border-radius: 4px; }
.fx-conv-more-trigger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 16px;
  color: var(--text-muted);
  border-radius: 4px;
  line-height: 1;
  flex-shrink: 0;
  transition: all 0.15s;
}
.fx-conv-more-trigger:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.08);
}
.conv-item:hover .fx-conv-more-trigger {
  display: inline-flex;
  align-items: center;
}
.conv-item:hover .conv-time {
  display: none;
}
/* Thẻ trạng thái khách (contact-status.js) — cùng màu với app: "Đã chốt đơn" cam nhạt, "Khách hủy đơn" đỏ nhạt.
   "Khách mới" (chỉ có .fx-st) và thẻ khác giữ kiểu xám ở trên. */
.tag-pill.fx-st-closed { background: #fff7e6; color: #d46b08; border-color: #ffd591; }
.tag-pill.fx-st-cancelled { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
/* "AI" ngay sau chip "Đã chốt đơn" khi AI chốt đơn: dùng lại nhãn AI của tin nhắn AI (.fx-ai-tag), bỏ lề trên của bong bóng */
.conv-tags-row .conv-ai-closed { margin: 0 0 0 -2px; line-height: 18px; flex-shrink: 0; }
/* Chip + "AI" là một khối không xuống dòng: badge kênh rộng hơn thì cả khối sang dòng dưới, "AI" không đứng lẻ */
.conv-tags-row .conv-st-ai { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; white-space: nowrap; }

/* Khung chat */
.col-chat { background: #fff; container-type: inline-size; container-name: fxchat; }
.chat-header { height: 68px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--zl-line); gap: 12px; background: #fff; }
.chat-header-user { flex: 1 1 auto; min-width: 0; gap: 12px; }
.avatar-wrap { flex-shrink: 0; }
.user-avatar { width: 48px; height: 48px; }
.user-meta { min-width: 0; flex: 1; }
.user-name-row { min-width: 0; }
.user-meta h2 { font-size: 18px; font-weight: 600; line-height: 24px; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.phone-chip { flex-shrink: 0; }
.channel-name-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Khung chat hẹp (màn 1366–1440 khi mở panel khách): gọn nút header,
   2 nút trùng với menu "…" (đọc/chưa đọc, kéo lịch sử) được ẩn. */
@container fxchat (max-width: 720px) {
  .chat-header { padding-left: 16px; }
  .btn-zalo-call-pill span { display: none; }
  .btn-zalo-call-pill { padding: 0 8px; }
  .chat-header .fx-hide-narrow { display: none; }
  .chat-header .fx-menu .fx-show-narrow { display: flex; }
  .chat-header-actions .fx-vsep { display: none; }
  .status-select { max-width: 132px; }
  .fx-hint { display: none; }
}
@container fxchat (max-width: 460px) {
  .user-meta .phone-chip { display: none; }
}
.phone-chip { font-weight: 400; font-size: 12px; border-radius: 6px; padding: 0 6px; line-height: 20px; }
.channel-name-sub { font-size: 13px; line-height: 18px; color: var(--text-sub); }
.chat-header-actions { gap: 4px; flex-shrink: 0; }
.chat-header .fx-icon-btn { color: var(--zl-icon); }
.status-select { height: 32px; padding: 0 8px; font-size: 13px; margin-right: 4px; }
.btn-zalo-call-pill { height: 32px; padding: 0 12px; border-radius: 8px; font-weight: 500; font-size: 13px; margin-right: 4px; }
.btn-zalo-call-pill .ph { font-size: 16px; }
/* Nút "Kết bạn" / "Đồng ý kết bạn" Zalo trên đầu khung chat (điện thoại: nằm trong menu ⋮) */
.btn-zalo-friend-pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 8px; font-weight: 500;
  font-size: 13px; margin-right: 4px; background: #ecfdf3; color: #15803d; border: 1px solid #bbf7d0; cursor: pointer; transition: all .2s; }
.btn-zalo-friend-pill .ph { font-size: 16px; }
.btn-zalo-friend-pill:hover:not(:disabled) { background: #15803d; color: #fff; border-color: #15803d; box-shadow: 0 4px 12px rgba(21, 128, 61, 0.25); }
.chat-header .btn-icon { border: none; padding: 0; }
.chat-header .btn-icon.is-unread { color: var(--primary); background: rgba(0, 104, 255, 0.1); }
.fx-more-wrap { position: relative; }
.fx-pop-item.fx-show-narrow { display: none; }
.fx-menu { top: calc(100% + 6px); right: 0; width: 240px; }

/* Vùng tin: nền #ebecf0 như Zalo; khoảng cách do từng dòng tự đặt
   (4px trong nhóm, 16px giữa các nhóm). */
.chat-body {
  background: var(--zl-bg, #ebecf0); padding: 0 16px 20px; gap: 0; overflow-x: hidden;
  scrollbar-width: thin; scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}
.conversation-list { scrollbar-width: thin; scrollbar-color: rgba(0, 0, 0, 0.15) transparent; }
.chat-welcome .welcome-icon { font-size: 56px; color: #c4cad4; }
.chat-welcome h3 { font-weight: 600; font-size: 18px; }
.chat-welcome p { font-size: 14px; }
/* Nhãn ngày dạng pill xám, chữ trắng */
.fx-day-sep { display: flex; align-items: center; justify-content: center; margin: 16px 0 0; flex-shrink: 0; }
.fx-day-sep span {
  font-size: 12px; line-height: 20px; padding: 0 10px; border-radius: 10px; color: #fff; background: rgba(8, 28, 54, 0.25);
}
.message-row { max-width: 68%; gap: 8px; align-items: flex-start; margin-top: 3px; flex-shrink: 0; }
.message-row.grp-start { margin-top: 14px; }
.msg-avatar { width: 36px; height: 36px; margin: 0; object-fit: cover; flex-shrink: 0; border-radius: 50%; }
.msg-avatar-gap { width: 36px; flex-shrink: 0; }
.msg-bubble-wrap { min-width: 0; }
.message-row.inbound .msg-bubble-wrap { align-items: flex-start; }
.message-row.outbound .msg-bubble-wrap { align-items: flex-end; }
.msg-bubble-box { position: relative; max-width: 100%; }
.msg-bubble { border-radius: 8px; padding: 9px 12px; font-size: 14px; line-height: 20px; font-weight: 400; word-break: break-word; }
.message-row.inbound .msg-bubble {
  background: #ffffff;
  color: #081c36;
  border: 1px solid #e4e7eb;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.message-row.outbound .msg-bubble {
  background: #e5efff;
  color: #081c36;
  border: 1px solid #cce0ff;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.message-row.outbound .msg-bubble,
.message-row.outbound .msg-bubble p,
.message-row.outbound .msg-bubble span:not(.msg-mention):not(.zemo) {
  color: #081c36;
}
.message-row.outbound .msg-bubble .msg-mention {
  color: #0068ff;
  background: rgba(0, 104, 255, 0.1);
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
}
.message-row.outbound .msg-bubble a {
  color: #0068ff;
  text-decoration: underline;
  font-weight: 500;
}
/* Giờ gửi nằm trong bong bóng cuối nhóm */
.msg-time { font-size: 11.5px; line-height: 16px; color: #72808e; font-weight: 400; margin-top: 4px; white-space: nowrap; }
.message-row.outbound .msg-time { color: #72808e; }
/* Pill trạng thái dưới tin đi cuối cùng (tinh tế kiểu Zalo, chữ mờ không khung xám cồng kềnh) */
.msg-status {
  margin-top: 2px; font-size: 11px; line-height: 16px; padding: 0 2px; border-radius: 4px; color: #72808e;
  background: transparent; font-weight: 400; white-space: nowrap;
}
.msg-status.failed { background: #fde8e8; color: #d91b1b; padding: 0 6px; }
/* Nút Trả lời / Sao chép / Chuyển tiếp + thả cảm xúc: hiện khi rê chuột.
   Vùng đón chuột (hitbox) mở rộng cả chiều dọc lẫn chiều ngang + đệm ăn khớp mép bong bóng (overlap 4px)
   kèm độ trễ 250ms khi rời chuột để không bị gián đoạn hay biến mất đột ngột khi di chuyển lệch. */
.msg-actions {
  position: absolute; top: -8px; bottom: -8px; min-height: 44px; margin: auto 0;
  display: flex; align-items: center; gap: 5px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.15s ease 0.25s; z-index: 2;
}
.message-row.inbound .msg-actions { left: 100%; margin-left: -4px; padding-left: 12px; padding-right: 18px; }
.message-row.outbound .msg-actions { right: 100%; margin-right: -4px; padding-right: 12px; padding-left: 18px; }
.msg-actions button, .msg-react {
  width: 26px; height: 26px; border-radius: 50%; border: none; background: #fff; color: var(--text-sub); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px;
  box-shadow: 0 1px 3px rgba(8, 28, 54, 0.18); transition: color 0.12s, transform 0.12s;
}
.msg-actions button:hover, .msg-react:hover { color: var(--primary); transform: scale(1.1); }
.msg-react {
  position: absolute; right: -10px; bottom: -10px; width: 22px; height: 22px; font-size: 13px; z-index: 2;
  opacity: 0; pointer-events: none; transition: opacity 0.15s ease 0.25s, color 0.12s;
}
.message-row:hover .msg-actions, .message-row:hover .msg-react, .msg-actions:hover {
  opacity: 1; pointer-events: auto; transition-delay: 0s;
}
/* THẢ CẢM XÚC (Zalo cá nhân) — nút góc bong bóng: đã thả = hiện cảm xúc của mình (bấm = gỡ); đang gửi lên Zalo =
   vòng quay; tin chưa thả được (đang gửi / lỗi / chưa có mã Zalo) = mờ, bấm báo lý do. Phím Tab tới nút → nút hiện.
   Màn nhỏ: foxia-mobile.css (ẩn nút + bảng chọn, chip sát góc). */
.msg-react.on { color: var(--primary); }
.msg-react-mine { font-size: 13px; line-height: 1; }
.message-row .msg-react:focus-visible { opacity: 1; pointer-events: auto; }
.message-row:hover .msg-react.is-off, .message-row .msg-react.is-off:focus-visible { opacity: 0.45; cursor: not-allowed; }
.msg-react.is-off:hover { color: var(--text-sub); }
.msg-react:disabled { cursor: progress; }
/* Chip cảm xúc vắt qua mép dưới bong bóng (chừa góc phải cho nút thả cảm xúc); bong bóng có chip rộng tối thiểu
   đủ chứa chip (tin rất ngắn) → chip không lấn sang ảnh đại diện */
.msg-bubble-box.has-reacts { margin-bottom: 12px; }
.msg-bubble-box.has-reacts > .msg-bubble { min-width: 96px; }
.msg-reacts {
  position: absolute; right: 16px; bottom: -12px; z-index: 1; height: 20px; padding: 0 6px; border-radius: 10px; box-sizing: border-box;
  display: inline-flex; align-items: center; gap: 1px; background: #fff; color: var(--text-sub); font-size: 13px; line-height: 1;
  white-space: nowrap; box-shadow: 0 1px 3px rgba(8, 28, 54, 0.18); user-select: none; cursor: default;
}
.msg-reacts-n { margin-left: 3px; font-size: 12px; font-variant-numeric: tabular-nums; }
.msg-reacts.mine .msg-reacts-n { color: var(--primary); }
/* Bảng chọn cảm xúc ngay trên nút (góc phải bong bóng), mở về phía giữa khung chat (.chat-body cắt ngang). Tin đến:
   bong bóng hẹp hơn bảng (222px; có nút × 258px) → bám mép trái bong bóng, mở sang phải thay vì lấn ra ngoài. */
.msg-react-pop {
  position: absolute; bottom: 14px; z-index: 4; display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 22px;
  background: #fff; box-shadow: var(--fx-pop-shadow); white-space: nowrap; animation: fxPopIn 0.12s ease-out;
}
.message-row.inbound .msg-react-pop { right: min(0px, calc(100% - 222px)); }
.message-row.inbound .msg-react-pop.has-clear { right: min(0px, calc(100% - 258px)); }
.message-row.outbound .msg-react-pop { right: 0; }
.msg-react-pop button {
  width: 34px; height: 34px; padding: 0; border: none; border-radius: 50%; background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 22px; line-height: 1; transition: transform 0.12s;
}
.msg-react-pop button:hover:not(:disabled) { transform: scale(1.2); }
.msg-react-pop button.on { background: var(--zl-selected, #e5efff); }
.msg-react-pop button:disabled { opacity: 0.45; cursor: progress; }
.msg-react-pop .msg-react-clear { font-size: 16px; color: var(--text-sub); }
.msg-react-pop .msg-react-clear:hover:not(:disabled) { color: var(--danger); }
@media (prefers-reduced-motion: reduce) {
  .msg-react-pop { animation: none; }
  .msg-react-pop button { transition: none; }
  .msg-react-pop button:hover:not(:disabled) { transform: none; }
}
.msg-img-preview {
  max-width: 280px;
  max-height: 420px;
  width: auto;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
  object-position: top;
  display: block;
}
/* Tin CHỈ CÓ ẢNH (.msg-bubble.is-media: không chữ / trích dẫn / thẻ): ảnh nằm thẳng trên nền khung chat — không khung
   trắng / xanh, không đệm (kiểu Zalo); giờ gửi đè góc dưới phải ảnh, nền tối mờ. Tin có chữ kèm ảnh giữ bong bóng. */
.message-row .msg-bubble-box > .msg-bubble.is-media { position: relative; padding: 0; background: transparent; box-shadow: none; }
.message-row .msg-bubble.is-media > .msg-attachments { margin-top: 0; }
/* Ảnh đang tải: ô giữ chỗ xám nhạt, giờ nằm trong ô — không lơ lửng. Cỡ tối thiểu 64×40 = đúng ngưỡng ảnh được bỏ khung
   (imgFitsTime trong ChatWindow.js): ảnh đã biết cỡ không bao giờ nhỏ hơn ô → không bị kéo giãn, tải xong không nhảy. */
.message-row .msg-bubble-box > .msg-bubble.is-media.is-loading { min-width: 64px; min-height: 40px; border-radius: 8px; background: rgba(8, 28, 54, 0.06); }
.message-row .msg-bubble.is-media > .msg-time {
  position: absolute; right: 8px; bottom: 8px; margin: 0; padding: 0 6px; border-radius: 9px;
  font-size: 12px; line-height: 18px; color: #fff; background: rgba(0, 0, 0, 0.5); pointer-events: none; z-index: 2;
}
/* Lưới nhiều ảnh kiểu Zalo (Album Grid): 2 hoặc 4 ảnh → 2 cột; 3 hoặc ≥ 5 ảnh → 3 cột */
.msg-attachments.is-img-grid {
  display: grid;
  gap: 4px;
  border-radius: 8px;
}
.msg-attachments.is-img-grid.is-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(284px, 68vw);
}
.msg-attachments.is-img-grid.is-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(306px, 72vw);
}
.msg-attachments.is-img-grid .msg-img-preview,
.fx-shell.is-mobile .msg-attachments.is-img-grid .msg-img-preview {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center;
  border-radius: 6px;
}
.msg-attachments.is-img-grid .msg-img-broken {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: none;
  padding: 6px;
  font-size: 11px;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  border-radius: 6px;
}
.msg-attachments.is-img-grid > :not(.msg-img-preview):not(.msg-img-broken) {
  grid-column: 1 / -1;
}
/* ================= GALLERY LIGHTBOX (XEM ẢNH SLIDE / VUỐT NGANG KIỂU ZALO) ================= */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 25, 0.92);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  user-select: none;
}
.lightbox-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent);
  z-index: 3;
}
.lightbox-counter {
  color: #f8fafc;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.12);
  padding: 4px 12px;
  border-radius: 999px;
}
.lightbox-counter:empty {
  display: none;
}
.lightbox-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.lightbox-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
}
.lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.24);
  transform: scale(1.05);
}
.lightbox-stage {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 64px 86px;
  overflow: hidden;
}
.lightbox-main-img {
  max-width: min(88vw, 1200px);
  max-height: calc(100dvh - 150px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  transition: transform 0.2s ease-out;
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(15, 23, 42, 0.65);
  color: #fff;
  font-size: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  transition: background 0.15s, transform 0.15s;
}
.lightbox-nav:hover {
  background: rgba(30, 41, 59, 0.9);
  transform: translateY(-50%) scale(1.08);
}
.lightbox-nav.is-prev { left: 18px; }
.lightbox-nav.is-next { right: 18px; }
.lightbox-thumbs {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 92vw;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow-x: auto;
  z-index: 3;
}
.lightbox-thumb-btn {
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 6px;
  border: 2px solid transparent;
  background: transparent;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.55;
  transition: opacity 0.15s, border-color 0.15s, transform 0.15s;
}
.lightbox-thumb-btn:hover {
  opacity: 0.85;
}
.lightbox-thumb-btn.active {
  opacity: 1;
  border-color: #38bdf8;
  transform: scale(1.06);
}
.lightbox-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
@media (max-width: 767px) {
  .lightbox-stage {
    padding: 56px 12px 84px;
  }
  .lightbox-main-img {
    max-width: 96vw;
  }
  .lightbox-nav {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }
  .lightbox-nav.is-prev { left: 8px; }
  .lightbox-nav.is-next { right: 8px; }
}
.msg-video-preview { border-radius: 8px; }
.msg-file-download { color: var(--primary); display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.fx-phone-chip {
  display: inline-block; background: rgba(0, 104, 255, 0.1); color: var(--primary); padding: 0 6px; border-radius: 6px;
  cursor: pointer; font-weight: 500;
}
.fx-phone-chip:hover { background: rgba(0, 104, 255, 0.18); }
.call-log-bubble { border-radius: 8px; border: none; box-shadow: 0 1px 2px rgba(8, 28, 54, 0.12); }
.call-log-title { font-weight: 600; }

.quick-reply-bar { border-top: 1px solid var(--zl-line); padding: 6px 16px; }
.qr-label { font-weight: 400; font-size: 12px; }
.qr-toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; flex-shrink: 0; user-select: none; }
.quick-reply-bar.is-off { padding-top: 4px; padding-bottom: 4px; }
.quick-reply-bar.is-off .qr-label { color: var(--text-muted); }
.qr-pill-btn { border-radius: 100px; padding: 2px 10px; font-size: 12px; background: #fff; border-color: var(--border-color); }
.qr-shortcut { font-weight: 500; }

/* Composer kiểu Zalo: thanh công cụ 48px kẻ dưới, ô nhập tự giãn + nút GỬI bên phải */
.chat-input-area { position: relative; border-top: 1px solid var(--zl-line); padding: 0; gap: 0; background: #fff; }
.input-actions-bar { min-height: 47px; padding: 4px 8px; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--zl-line); }
.fx-tool-btn {
  width: 32px; height: 32px; border-radius: 4px; border: none; background: transparent; color: var(--zl-icon, var(--text-sub));
  display: inline-flex; align-items: center; justify-content: center; font-size: 22px; cursor: pointer; flex-shrink: 0;
  transition: background-color 0.12s;
}
.fx-tool-btn:hover { background: var(--zl-hover, var(--fx-hover)); color: var(--text-main); }
.fx-tool-btn.on { background: var(--zl-selected, var(--fx-active)); color: var(--primary); }
.input-actions-bar .fx-vsep { margin: 0 4px; height: 16px; }
.file-chip { border-radius: 6px; font-size: 12px; padding: 2px 8px; background: #f5f5f5; display: inline-flex; align-items: center; gap: 5px; }
.file-chip-thumb { width: 18px; height: 18px; object-fit: cover; border-radius: 3px; display: inline-block; vertical-align: middle; border: 1px solid rgba(0, 0, 0, 0.08); flex-shrink: 0; }
.fx-uploading { font-size: 12px; color: var(--text-sub); display: inline-flex; align-items: center; gap: 4px; }
.input-actions-bar .fx-hint { margin-left: auto; padding-right: 8px; }
.fx-hint { font-size: 12px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 4px; cursor: help; }
.input-box-row { padding: 8px 8px 8px 16px; gap: 8px; align-items: flex-end; }
.input-box-row textarea {
  color: var(--text-main); border: none; padding: 9px 0; font-size: 15px; line-height: 22px; height: 40px; min-height: 40px; max-height: 160px;
  overflow-y: auto; border-radius: 0; box-shadow: none; background: transparent;
}
.input-box-row textarea::placeholder { color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.input-box-row textarea:focus { border: none; box-shadow: none; }
.btn-send {
  width: auto; height: 40px; padding: 0 12px; border-radius: 8px; border: none; background: transparent; flex-shrink: 0;
  color: var(--primary); font-size: 15px; font-weight: 600; letter-spacing: 0.2px; cursor: pointer; transition: background-color 0.12s;
}
.btn-send:hover:not(:disabled) { background: var(--zl-selected, var(--primary-light)); }
.btn-send:disabled { color: var(--text-muted); background: transparent; cursor: default; }
.fx-emoji-wrap { position: relative; }
/* BIỂU TƯỢNG CẢM XÚC kiểu Zalo PC (EmojiPicker.js + zalo-emoji.js): popover 340px, 8 ô/hàng, tiêu đề nhóm, thanh nhóm ở dưới.
   .zemo = mã riêng Zalo (":)", "/-strong"…) vẽ bằng ảnh; chữ gốc vẫn nằm trong (trong suốt) nên bôi đen / sao chép ra đúng mã. */
.fx-emoji-pop { bottom: calc(100% + 8px); left: 0; width: 340px; padding: 8px 4px 0; }
.fx-emoji-pop > .fx-seg { margin: 0 4px; }
.zep { display: flex; flex-direction: column; }
.zep-list { position: relative; height: 300px; margin-top: 6px; overflow-y: auto; overscroll-behavior: contain; }
.zep-head { padding: 9px 0 5px 8px; font-size: 13px; font-weight: 500; color: var(--text-sub); }
.zep-grid { display: grid; grid-template-columns: repeat(8, 1fr); }
.zep-item {
  height: 38px; border: none; border-radius: 5px; background: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; font-size: 24px; line-height: 1;
}
.zep-item:hover { background: var(--fx-hover); }
.zep-item .zemo { width: 26px; height: 26px; vertical-align: middle; line-height: 26px; }
.zep-tabs { display: flex; height: 40px; border-top: 1px solid var(--zl-line, #e5e7eb); }
.zep-tab {
  flex: 1 1 0; min-width: 30px; border: none; border-bottom: 2px solid transparent; background: none; cursor: pointer;
  color: var(--text-muted); font-size: 18px; display: inline-flex; align-items: center; justify-content: center;
}
.zep-tab b { font-size: 16px; font-weight: 700; }
.zep-tab:hover { color: var(--text-sub); }
.zep-tab.on { color: var(--primary); border-bottom-color: var(--primary); }
.zemo {
  display: inline-block; width: 22px; height: 22px; vertical-align: -5px; background: center / contain no-repeat;
  color: transparent; overflow: hidden; white-space: nowrap; font-size: 12px; line-height: 22px;
}
.msg-emo-only { font-size: 32px; line-height: 44px; }
.msg-emo-only .zemo { width: 40px; height: 40px; vertical-align: middle; line-height: 40px; }
.conv-last-msg .zemo { width: 16px; height: 16px; vertical-align: -3px; line-height: 16px; }
.msg-reacts .zemo, .msg-react-mine .zemo { width: 16px; height: 16px; vertical-align: middle; line-height: 16px; }
.fx-slash-pop { bottom: calc(100% + 4px); left: 16px; right: 16px; max-height: 280px; overflow-y: auto; }
.fx-slash-item {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 8px 12px; border: none; background: none;
  border-radius: 6px; cursor: pointer; text-align: left;
}
.fx-slash-item.active { background: var(--primary-light); }
.fx-slash-key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--primary); font-size: 13px; min-width: 64px; }
.fx-slash-text { display: flex; flex-direction: column; min-width: 0; line-height: 20px; }
.fx-slash-text b { font-weight: 500; }
.fx-slash-text small { color: var(--text-sub); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Panel khách hàng (360px) */
.col-crm { width: 360px; border-left: none; background: #fff; overflow: hidden; }
.col-crm > .crm-content { flex: 1; overflow-y: auto; padding: 0 0 16px; gap: 0; }
.crm-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: auto; padding: 40px 16px; color: var(--text-sub); }
.crm-empty .ph { font-size: 48px; color: #c4cad4; }
.crm-empty small { color: var(--text-muted); font-size: 13px; }
.fx-crm-hero { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 24px 16px 16px; border-bottom: 1px solid var(--border-light); }
.fx-crm-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: #f0f2f5; margin-bottom: 6px; }
.fx-crm-name { font-size: 20px; font-weight: 500; line-height: 28px; display: flex; align-items: center; gap: 6px; }
.fx-crm-name .ph { font-size: 14px; color: var(--text-muted); }
.fx-crm-sub { font-size: 13px; color: var(--text-sub); margin-bottom: 8px; }
.fx-crm-trio { display: flex; gap: 8px; width: 100%; justify-content: center; margin-top: 4px; }
.fx-crm-trio button {
  flex: 1; max-width: 110px; display: flex; flex-direction: column; align-items: center; gap: 6px; border: none; background: none;
  cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text-sub); line-height: 18px; padding: 4px;
}
.fx-crm-trio button span {
  width: 40px; height: 40px; border-radius: 50%; background: #f8fafc; border: 1px solid #cbd5e1; display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--text-main); transition: all 0.15s;
}
.fx-crm-trio button:hover span { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.fx-crm-hero .btn { margin-top: 8px; }
.crm-section { padding: 16px; border-bottom: 1px solid var(--border-color); gap: 8px; }
.crm-section-title { font-size: 15px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--text-main); }
/* Trong Live Chat: ngăn các mục bằng dải xám như bảng "Thông tin hội thoại" của Zalo */
.fx-livechat .fx-crm-hero, .fx-livechat .crm-section { border-bottom: 8px solid var(--zl-bg); }
.fx-livechat .crm-section-title { font-weight: 600; }
.fx-info-row { display: flex; align-items: center; gap: 8px; min-height: 36px; }
.fx-info-label { display: flex; align-items: center; gap: 8px; width: 128px; flex-shrink: 0; color: var(--text-sub); font-size: 13px; font-weight: 500; }
.fx-info-label .ph { font-size: 16px; color: var(--text-sub); }
.fx-info-label.plain { width: auto; flex: 1; color: var(--text-main); }
.fx-info-row .form-input { flex: 1; min-width: 0; height: 34px; border: 1px solid #cbd5e1; color: var(--text-main); font-weight: 500; border-radius: 6px; }
.fx-info-row .form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(0, 104, 255, 0.15); }
.fx-info-row.static { justify-content: space-between; }
.fx-info-value { text-align: right; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.fx-info-value.muted { color: var(--text-muted); }
.fx-info-value.link { color: var(--primary); font-weight: 600; }
.phone-with-copy { padding-left: 136px; gap: 6px; flex-wrap: wrap; }
.btn-copy, .btn-call-mini, .btn-zalo-call-mini {
  height: 28px !important; padding: 0 10px !important; border-radius: 6px !important; font-size: 12px !important; font-weight: 400 !important;
  display: inline-flex !important; align-items: center; gap: 4px;
}
.btn-copy { background: #fff; border: 1px solid var(--fx-ctrl-border); }
.btn-call-mini { background: #0bcb6b; }
.col-crm .form-group label { font-size: 14px; color: var(--text-sub); margin-bottom: 2px; }
.col-crm .fx-grid-2 .form-input { width: 100%; height: 32px; }
.fx-order-card { border: 1px solid var(--border-color); border-radius: 10px; padding: 10px 12px; cursor: pointer; transition: border-color 0.15s; }
.fx-order-card:hover { border-color: var(--primary); }
.fx-order-top { display: flex; justify-content: space-between; align-items: center; }
.fx-order-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-sub); margin-top: 4px; }
.fx-order-meta b { color: var(--text-main); font-size: 13px; }
.tag-chip-toggle {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; line-height: 22px; padding: 0 8px; border-radius: 6px;
  border: 1px dashed var(--fx-ctrl-border); background: #fff; color: var(--text-sub);
}
.tag-chip-toggle .ph { font-size: 12px; }
.tag-chip-toggle:hover { border-color: var(--primary); color: var(--primary); }
.tag-chip-toggle.selected { border-style: solid; background: var(--primary-light); border-color: #91caff; color: var(--primary); font-weight: 400; }
/* Dòng nhắc dưới thẻ khách (CrmPanel): 3 thẻ trạng thái loại trừ nhau, máy tự đổi theo đơn hàng */
.fx-crm-tag-hint { margin-top: 8px; font-size: 12px; line-height: 18px; }
.fx-crm-foot { padding: 12px 16px; border-top: 1px solid var(--border-light); background: #fff; }
.btn-save-crm {
  width: 100%; height: 36px; border-radius: 8px; font-weight: 400; font-size: 14px; display: inline-flex;
  align-items: center; justify-content: center; gap: 6px; padding: 0;
}

/* ---------------------------------------------------------------- 7. ĐĂNG NHẬP & BẢNG GIÁ */
/* Cho phép cuộn trang tự nhiên khi ở trang đăng nhập / landing (chỉ html là scroll container duy nhất) */
html:has(.fx-signin),
html.fx-signin-active {
  height: auto !important;
  min-height: 100% !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

body:has(.fx-signin),
body.fx-signin-active {
  height: auto !important;
  min-height: 100% !important;
  width: 100% !important;
  overflow: visible !important;
  overscroll-behavior-y: auto !important;
}

#app:has(.fx-signin),
body.fx-signin-active #app {
  height: auto !important;
  min-height: 100% !important;
  overflow: visible !important;
}

.fx-signin {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  height: auto;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: #f1f5f9;
  padding: 24px 20px;
  gap: 20px;
  overflow: visible;
}
.fx-signin-art {
  flex: 1;
  min-width: 0;
  border-radius: 20px;
  background: #ffffff;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.03);
  box-sizing: border-box;
}

/* ---------------------------------------------------------------- VIZIO LANDING ART (CỤM MINH HOẠ BÊN PHẢI) */
.fx-signin-art.vz-landing-art {
  background: #ffffff !important;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.03);
  padding: 28px 34px 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-self: center;
  gap: 18px;
  overflow: visible;
  box-sizing: border-box;
}

.vz-hero-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
}

.vz-hero-content {
  flex: 1 1 54%;
  max-width: 560px;
  min-width: 280px;
}

.vz-hero-title {
  font-size: clamp(24px, 2.2vw, 32px);
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: -0.025em;
  color: #081122;
  margin: 0;
}

.vz-gradient-text {
  background: linear-gradient(135deg, #1665f5 0%, #4338ca 50%, #7928ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.vz-channels {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: #344054;
}

.vz-ch-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.vz-ch-icon {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  flex-shrink: 0;
}

.vz-ch-dot {
  color: #cbd5e1;
  font-weight: 400;
}

.vz-sub-features {
  font-size: 14px;
  font-weight: 700;
  color: #475569;
  letter-spacing: -0.01em;
  margin: 12px 0 0 0;
}

.vz-hero-cta {
  margin-top: 16px;
}

.vz-btn-trial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 9999px;
  background: #081122;
  color: #ffffff;
  padding: 10px 24px;
  font-size: 13.5px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(8, 17, 34, 0.16);
  transition: all 0.2s ease;
}

.vz-btn-trial:hover {
  background: #000000;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(8, 17, 34, 0.25);
}

.vz-btn-trial i,
.vz-btn-trial svg {
  font-size: 16px;
  transition: transform 0.2s ease;
}

.vz-btn-trial:hover i,
.vz-btn-trial:hover svg {
  transform: translateX(3px);
}

.vz-hero-perks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #eef2f6;
}

.vz-perk-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.vz-perk-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #eff6ff;
  color: #1665f5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vz-perk-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.vz-perk-text b {
  font-size: 11.5px;
  font-weight: 700;
  color: #081122;
  line-height: 1.2;
}

.vz-perk-text span {
  font-size: 10.5px;
  color: #667085;
  line-height: 1.2;
  margin-top: 1px;
}

.vz-hero-mockup-wrap {
  flex: 0 1 44%;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 480px;
  min-width: 0;
}

.vz-hero-mockup-img {
  width: 100%;
  height: auto;
  max-height: clamp(170px, 22vh, 260px);
  object-fit: contain;
  filter: none;
  user-select: none;
}

/* Features Bottom Row */
.vz-features-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 0;
  padding-top: 14px;
  border-top: 1px solid #eef2f6;
  width: 100%;
}

.vz-feat-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid #e9edf5;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.02);
  transition: all 0.2s ease;
}

.vz-feat-card:hover {
  border-color: #bfdbfe;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.07);
  transform: translateY(-1px);
}

.vz-feat-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: #eff6ff;
  color: #1665f5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.vz-feat-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.vz-feat-title {
  font-size: 13px;
  font-weight: 700;
  color: #081122;
  margin: 0 0 3px;
  line-height: 1.3;
}

.vz-feat-desc {
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.4;
  margin: 0;
}
.fx-pricing-top {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 12px;
}
.fx-pricing-logo img {
  height: 32px;
  width: auto;
  margin-bottom: 6px;
  display: block;
}
.fx-pricing-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #bfdbfe;
  margin-bottom: 6px;
}
.fx-pricing-title {
  font-size: 19px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
  margin: 0 0 6px;
  letter-spacing: -0.4px;
}
.fx-pricing-subtitle {
  font-size: 12px;
  color: #64748b;
  margin: 0;
  line-height: 1.45;
  max-width: 620px;
}
.fx-pricing-pills-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 8px;
  margin-top: 10px;
}
.fx-pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.fx-pill-tag i {
  font-size: 12px;
}
.fx-pill-brand {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}
.fx-pill-indigo {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #4338ca;
}
.fx-pricing-cycle-wrap {
  margin: 12px 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.fx-pricing-cycle-tabs {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 4px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.05);
}
.fx-cycle-tab {
  border: none;
  background: transparent;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 700;
  color: #475467;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.fx-cycle-tab:hover {
  background: #f8fafc;
  color: #0f172a;
}
.fx-cycle-tab.is-active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.28);
}
.fx-cycle-badge {
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 4px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1;
}
.fx-cycle-badge.is-on-active {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  border-color: transparent;
}
.fx-badge-full {
  display: inline;
}
.fx-badge-short {
  display: none;
}
.fx-cycle-badge-spacer {
  display: none;
}
.fx-cycle-points {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 14px;
  font-size: 11px;
  color: #475467;
}
.fx-cycle-point {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
}
.fx-cycle-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #2563eb;
  flex-shrink: 0;
}

.fx-pricing-hint {
  display: none;
}
.fx-pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 8px;
}
@media (max-width: 1400px) and (min-width: 1101px) {
  .fx-pricing-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 8px;
  }
}
@media (max-width: 1100px) and (min-width: 901px) {
  .fx-pricing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px;
  }
}
.fx-pcard {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  min-width: 0;
}
.fx-pcard:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}
.fx-pcard-featured {
  border: 2px solid #2563eb !important;
  box-shadow: 0 8px 24px -4px rgba(37, 99, 235, 0.2) !important;
  background: linear-gradient(180deg, #f8faff 0%, #ffffff 100%) !important;
  z-index: 2;
}
.fx-pcard-tag {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #1677ff 0%, #4f46e5 100%);
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.35);
  letter-spacing: 0.3px;
}
.fx-pcard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  gap: 4px;
}
.fx-pcard-title {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.3px;
}
.fx-pcard-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  line-height: 1;
}
.fx-pcard-badge.fx-badge-green {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.fx-pcard-badge.fx-badge-blue {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.fx-pcard-desc {
  font-size: 11px;
  color: #64748b;
  line-height: 1.35;
  min-height: 28px;
  margin-bottom: 6px;
}
.fx-pcard-price-box {
  margin-bottom: 8px;
  padding: 8px 0;
  border-top: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
}
.fx-pcard-old-price {
  font-size: 11px;
  color: #94a3b8;
  height: 16px;
}
.fx-pcard-old-price del {
  text-decoration: line-through;
}
.fx-pcard-old-price.fx-pcard-listed {
  font-weight: 500;
}
.fx-pcard-price {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin: 2px 0;
}
.fx-pcard-num {
  font-size: 21px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.5px;
  line-height: 1.1;
}
.fx-pcard-unit {
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
}
.fx-pcard-cycle-detail {
  font-size: 10.5px;
  margin-top: 2px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.fx-pcard-subtext {
  color: #475467;
}
.fx-pcard-subtext b {
  color: #0f172a;
}
.fx-pcard-savings {
  color: #047857;
  font-weight: 700;
}
.fx-pcard-quota-table {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.fx-pcard-featured .fx-pcard-quota-table {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.fx-qrow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
}
.fx-qrow-sub {
  font-size: 11px;
  padding-top: 4px;
  border-top: 1px dashed #e2e8f0;
  color: #475467;
}
.fx-pcard-featured .fx-qrow-sub {
  border-top-color: #bfdbfe;
}
.fx-qlabel {
  color: #475467;
  font-weight: 500;
}
.fx-qval {
  font-weight: 700;
  color: #0f172a;
}
.fx-qval-primary {
  color: #2563eb;
  font-weight: 800;
}

.fx-pricing-disclaimer {
  font-size: 11px;
  color: #94a3b8;
  font-style: italic;
  text-align: center;
  margin: 6px 0 14px;
}

/* Nút Hot Giảm Giá ở Dưới Ô Gói (Pro, Business, Enterprise đến 31/12) */
.fx-hot-deal-btn {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border: 1.5px solid #fdba74;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.08);
  position: relative;
  overflow: hidden;
  text-align: left;
}
.fx-hot-deal-btn:hover {
  background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
  border-color: #f97316;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.16);
}
.fx-hot-deal-btn.is-active {
  background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
  border-color: #f43f5e;
  box-shadow: 0 2px 10px rgba(225, 29, 72, 0.14);
}
.fx-hot-flame {
  font-size: 16px;
  line-height: 1;
  display: inline-block;
  animation: fxFlamePulse 1.8s ease-in-out infinite;
}
@keyframes fxFlamePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}
.fx-hot-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.fx-hot-badge-tag {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #c2410c;
  line-height: 1.2;
}
.fx-hot-deal-btn.is-active .fx-hot-badge-tag {
  color: #e11d48;
}
.fx-hot-deal-title {
  font-size: 11px;
  font-weight: 700;
  color: #9a3412;
  line-height: 1.3;
}
.fx-hot-deal-btn.is-active .fx-hot-deal-title {
  color: #9f1239;
}
.fx-hot-applied {
  color: #e11d48;
  font-size: 16px;
}
.fx-badge-hot {
  background: linear-gradient(135deg, #ef4444 0%, #f97316 100%) !important;
  color: #ffffff !important;
  border: 1px solid #ea580c !important;
  font-weight: 800 !important;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.25) !important;
}
.fx-savings-fire {
  color: #ea580c !important;
  font-weight: 700 !important;
}

/* Interactive Calculator (Section V) */
.fx-calc-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px 22px;
  margin: 18px 0 16px;
  box-shadow: 0 4px 16px rgba(16, 24, 40, 0.04);
}
.fx-calc-header {
  text-align: center;
  margin-bottom: 18px;
}
.fx-calc-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 18px;
  align-items: stretch;
}
@media (max-width: 1100px) {
  .fx-calc-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}
.fx-calc-inputs {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.fx-calc-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fx-calc-label {
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
}
.fx-calc-plan-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
@media (max-width: 640px) {
  .fx-calc-plan-selector {
    grid-template-columns: repeat(2, 1fr);
  }
}
.fx-calc-plan-btn {
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 10px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.fx-calc-plan-btn:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}
.fx-calc-plan-btn.is-selected {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}
.fx-calc-plan-name {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
}
.fx-calc-plan-btn.is-selected .fx-calc-plan-name {
  color: #1d4ed8;
}
.fx-calc-plan-price {
  font-size: 11px;
  font-weight: 700;
  color: #2563eb;
}
.fx-calc-plan-spec {
  font-size: 9.5px;
  color: #64748b;
  white-space: nowrap;
}
.fx-calc-cycle-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.fx-calc-cycle-btn {
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 8px;
  padding: 6px 4px;
  font-size: 11.5px;
  font-weight: 700;
  color: #475467;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s ease;
}
.fx-calc-cycle-btn:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.fx-calc-cycle-btn.is-selected {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
}
.fx-calc-stepper-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fx-calc-step-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  gap: 8px;
}
.fx-calc-step-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fx-calc-step-title {
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.fx-calc-step-rate {
  font-size: 11px;
  color: #64748b;
}
.fx-badge-mini {
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  text-transform: uppercase;
}
.fx-calc-counter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 2px 4px;
}
.fx-counter-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: none;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s ease;
}
.fx-counter-btn:hover:not(:disabled) {
  background: #2563eb;
  color: #ffffff;
}
.fx-counter-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.fx-counter-val {
  min-width: 22px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}
.fx-calc-result {
  display: flex;
  flex-direction: column;
}
.fx-calc-summary-card {
  background: linear-gradient(180deg, #f8faff 0%, #ffffff 100%);
  border: 1.5px solid #bfdbfe;
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.08);
}
.fx-calc-sum-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}
.fx-calc-sum-title {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.fx-calc-sum-plan {
  font-size: 11px;
  font-weight: 700;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 2px 8px;
  border-radius: 6px;
}
.fx-calc-quotas {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
}
.fx-calc-quota-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.fx-calc-quota-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #eff6ff;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.fx-calc-quota-detail {
  display: flex;
  flex-direction: column;
  font-size: 11.5px;
}
.fx-calc-quota-label {
  color: #64748b;
}
.fx-calc-quota-value {
  color: #0f172a;
  font-size: 13px;
}
.fx-calc-quota-sub {
  font-size: 10.5px;
  color: #64748b;
  margin-top: 1px;
}
.fx-calc-cost-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11.5px;
}
.fx-calc-cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.fx-cost-name {
  color: #475467;
}
.fx-cost-val-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.fx-cost-del {
  color: #94a3b8;
  font-size: 11px;
}
.fx-cost-val {
  color: #0f172a;
  font-weight: 700;
}
.fx-calc-cost-subrow {
  display: flex;
  justify-content: flex-end;
  margin-top: -2px;
}
.fx-cost-save-pill {
  font-size: 10px;
  font-weight: 700;
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.fx-cost-save-pill.fx-cost-save-fire {
  color: #ea580c;
  background: #fff7ed;
  border-color: #fed7aa;
}
.fx-cost-note {
  font-size: 10px;
  color: #64748b;
  font-style: italic;
}
.fx-calc-upgrade-box {
  background: linear-gradient(135deg, #fef3c7 0%, #fef9c3 100%);
  border: 1px solid #fde047;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fx-upgrade-top {
  display: flex;
  align-items: center;
  gap: 6px;
}
.fx-upgrade-icon {
  color: #d97706;
  font-size: 14px;
}
.fx-upgrade-title {
  font-size: 11.5px;
  font-weight: 800;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}
.fx-upgrade-desc {
  font-size: 11px;
  color: #78350f;
  margin: 0;
  line-height: 1.4;
}
.fx-btn-upgrade {
  align-self: flex-start;
  background: #d97706 !important;
  color: #ffffff !important;
  border: none !important;
  font-weight: 700 !important;
  font-size: 10.5px !important;
  padding: 4px 10px !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  cursor: pointer;
  transition: all 0.15s ease;
}
.fx-btn-upgrade:hover {
  background: #b45309 !important;
}
.fx-calc-total-box {
  padding-top: 10px;
  border-top: 1.5px dashed #bfdbfe;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.fx-calc-total-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #475467;
}
.fx-calc-total-number {
  font-size: 24px;
  font-weight: 800;
  color: #2563eb;
  letter-spacing: -0.5px;
  line-height: 1.1;
}
.fx-calc-total-sub {
  font-size: 11px;
  color: #64748b;
}
.fx-calc-total-sub b {
  color: #0f172a;
}
.fx-calc-cta-btn {
  width: 100%;
  padding: 10px 14px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3) !important;
}

/* Add-ons Section (Section IV) */
.fx-pricing-addons-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px 22px;
  margin: 18px 0 16px;
  box-shadow: 0 2px 10px rgba(16, 24, 40, 0.03);
}
.fx-addons-header {
  text-align: center;
  margin-bottom: 16px;
}
.fx-addons-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid #bfdbfe;
  margin-bottom: 6px;
}
.fx-addons-title {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 4px;
  letter-spacing: -0.2px;
}
.fx-addons-subtitle {
  font-size: 12px;
  color: #64748b;
  margin: 0;
  line-height: 1.4;
}
.fx-addons-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 1280px) {
  .fx-addons-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.fx-addon-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.15s ease;
}
.fx-addon-card:hover {
  border-color: #93c5fd;
  background: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.05);
}
.fx-addon-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}
.fx-addon-name-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.fx-addon-ico {
  color: #2563eb;
  font-size: 16px;
}
.fx-addon-name {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}
.fx-addon-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 4px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  text-transform: uppercase;
}
.fx-addon-desc {
  font-size: 10.5px;
  color: #64748b;
  margin-bottom: 8px;
  line-height: 1.35;
}
.fx-addon-bottom {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid #f1f5f9;
}
.fx-addon-price-box {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.fx-addon-price {
  font-size: 14px;
  font-weight: 800;
  color: #2563eb;
}
.fx-addon-unit {
  font-size: 10.5px;
  color: #64748b;
  font-weight: 600;
}
.fx-addon-action-btn {
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
  color: #1e293b !important;
  font-size: 10.5px !important;
  font-weight: 700 !important;
  padding: 4px 8px !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  transition: all 0.15s ease !important;
}
.fx-addon-action-btn:hover {
  border-color: #2563eb !important;
  color: #2563eb !important;
  background: #eff6ff !important;
}
.fx-addon-btn-contact {
  color: #475467 !important;
  border-color: #e2e8f0 !important;
}
.fx-addon-btn-contact:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}
.fx-addons-footnote {
  font-size: 10.5px;
  color: #94a3b8;
  font-style: italic;
  text-align: center;
  margin-top: 14px;
  line-height: 1.45;
}

/* Comparison Table (Section VII) */
.fx-compare-section {
  margin: 14px 0 16px;
}
.fx-compare-toggle-bar {
  text-align: center;
  margin-bottom: 12px;
}
.fx-compare-toggle-btn {
  background: #ffffff !important;
  border: 1.5px solid #2563eb !important;
  color: #2563eb !important;
  font-weight: 700 !important;
  font-size: 12.5px !important;
  padding: 8px 18px !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  cursor: pointer;
  transition: all 0.15s ease !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.1) !important;
}
.fx-compare-toggle-btn:hover {
  background: #eff6ff !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2) !important;
}
.fx-compare-content {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 4px 16px rgba(16, 24, 40, 0.03);
}
.fx-compare-header {
  text-align: center;
  margin-bottom: 16px;
}
.fx-compare-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.fx-compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}
.fx-compare-table th,
.fx-compare-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #f1f5f9;
  text-align: center;
}
.fx-compare-table th {
  background: #f8fafc;
  font-weight: 700;
  color: #0f172a;
  position: sticky;
  top: 0;
  z-index: 1;
}
.fx-th-feature {
  text-align: left !important;
  width: 28%;
  font-size: 12px;
  color: #475467 !important;
}
.fx-th-plan {
  width: 18%;
  position: relative;
}
.fx-th-name {
  font-size: 13px;
  font-weight: 800;
}
.fx-th-price {
  font-size: 11px;
  color: #2563eb;
  font-weight: 700;
  margin-top: 2px;
}
.fx-th-featured {
  background: #eff6ff !important;
  border-top: 2px solid #2563eb;
}
.fx-th-badge {
  font-size: 9px;
  font-weight: 800;
  color: #2563eb;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}
.fx-tr-category td {
  background: #f1f5f9;
  font-size: 12px;
  font-weight: 800;
  color: #1e293b;
  text-align: left !important;
  padding: 8px 12px;
  letter-spacing: -0.1px;
}
.fx-tr-row:hover td {
  background: #f8fafc;
}
.fx-tr-row:hover td.fx-td-featured {
  background: #e0f2fe;
}
.fx-td-name {
  text-align: left !important;
  font-weight: 500;
  color: #334155;
}
.fx-td-val {
  color: #0f172a;
  font-weight: 600;
}
.fx-td-featured {
  background: #f8faff;
  font-weight: 700;
  color: #1d4ed8;
}
.fx-check-yes {
  color: #059669;
  font-size: 15px;
}
.fx-check-no {
  color: #94a3b8;
  font-size: 13px;
}

/* FAQ Section (Section VIII) */
.fx-faq-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px 22px;
  margin: 16px 0;
  box-shadow: 0 2px 10px rgba(16, 24, 40, 0.03);
}
.fx-faq-header {
  text-align: center;
  margin-bottom: 16px;
}
.fx-faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fx-faq-item {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.15s ease;
}
.fx-faq-item.is-open {
  border-color: #93c5fd;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}
.fx-faq-question {
  width: 100%;
  border: none;
  background: #f8fafc;
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: #0f172a;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.fx-faq-item.is-open .fx-faq-question {
  background: #eff6ff;
  color: #1d4ed8;
}
.fx-faq-chevron {
  font-size: 13px;
  color: #64748b;
  transition: transform 0.2s ease;
}
.fx-faq-item.is-open .fx-faq-chevron {
  transform: rotate(180deg);
  color: #2563eb;
}
.fx-faq-answer {
  padding: 10px 14px;
  background: #ffffff;
  font-size: 11.5px;
  color: #475467;
  line-height: 1.5;
  border-top: 1px solid #f1f5f9;
}
.fx-faq-answer p {
  margin: 0;
}

.fx-pricing-consult-card {
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.fx-consult-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fx-consult-text b {
  font-size: 12.5px;
  color: #1e40af;
}
.fx-consult-text span {
  font-size: 11.5px;
  color: #475467;
}
.fx-consult-btn {
  border: 1px solid #2563eb !important;
  color: #2563eb !important;
  background: #ffffff !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  white-space: nowrap !important;
  padding: 7px 14px !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  text-decoration: none !important;
  transition: all 0.15s ease !important;
  flex-shrink: 0 !important;
}
.fx-consult-btn:hover {
  background: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25) !important;
}
.fx-pcard-features {
  list-style: none;
  padding: 0;
  margin: 0 0 8px 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}
.fx-pcard-features li {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  font-size: 11px;
  color: #334155;
  line-height: 1.3;
}
.fx-pcard-features li i {
  color: #2563eb;
  font-size: 12px;
  margin-top: 2px;
  flex-shrink: 0;
}
.fx-pcard-features li.is-muted-item {
  color: #94a3b8;
  font-style: italic;
}
.fx-pcard-features li.is-muted-item i {
  color: #cbd5e1;
}
.fx-pcard-action {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}
.fx-pcard-btn {
  width: 100%;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  font-weight: 700;
  font-size: 11.5px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.fx-pcard-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
  background: #eff6ff;
}
.fx-pcard-btn-featured {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  color: #ffffff !important;
  border: 1px solid #1d4ed8 !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
}
.fx-pcard-btn-featured:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%) !important;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4) !important;
}
.fx-pcard-footnote {
  font-size: 10px;
  color: #94a3b8;
  text-align: center;
  margin-top: 4px;
}

.fx-pricing-guarantee {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11.5px;
  color: #475569;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  flex-shrink: 0;
}
.fx-pricing-guarantee i {
  color: #2563eb;
  font-size: 15px;
  flex-shrink: 0;
}
.fx-pricing-guarantee b {
  color: #1e40af;
}

.fx-signin-form-wrap {
  width: 400px;
  min-width: 360px;
  max-width: 420px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  position: relative;
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.03);
  padding: 32px 28px;
  overflow: visible;
  box-sizing: border-box;
}
.fx-signin-logo,
.fx-signin-mobile-logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  max-width: 360px;
  margin-bottom: 22px;
}
.fx-signin-logo img,
.fx-signin-mobile-logo img {
  height: 38px;
  width: auto;
  max-width: 165px;
  object-fit: contain;
  display: block;
}
.fx-pricing-jump-wrap {
  margin-top: 14px;
  text-align: center;
}
.fx-signin-price-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #dbeafe;
  transition: all 0.15s ease;
}
.fx-signin-price-jump:hover {
  background: #dbeafe;
  color: #1d4ed8;
}
.fx-signin-lang { display: none !important; }
.fx-reg-plan-banner {
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1.5px solid #bfdbfe;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.fx-reg-plan-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fx-reg-plan-tag {
  font-size: 9.5px;
  font-weight: 800;
  color: #2563eb;
  letter-spacing: 0.3px;
}
.fx-reg-plan-text {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: #0f172a;
}
.fx-reg-plan-cycle {
  font-size: 11.5px;
  color: #475467;
}
.fx-reg-discount-tag {
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  text-transform: uppercase;
}
.fx-reg-plan-change {
  font-size: 11.5px;
  font-weight: 700;
  color: #2563eb;
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #bfdbfe;
  transition: all 0.15s ease;
}
.fx-reg-plan-change:hover {
  background: #2563eb;
  color: #ffffff;
}

.fx-signin-form { width: 100%; max-width: 360px; display: flex; flex-direction: column; }
.fx-signin-form h1 { font-size: 24px; font-weight: 800; color: #0f172a; margin: 0 0 6px; letter-spacing: -0.02em; }
.fx-signin-form .fx-page-sub { margin-bottom: 20px; font-size: 13.5px; color: #64748b; line-height: 1.4; }
.fx-signin-form .fx-label { margin-top: 14px; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: #334155; display: block; }
.fx-signin-form .form-input { width: 100%; height: 42px; padding: 0 14px; border: 1.5px solid #e2e8f0; border-radius: 10px; font-size: 14px; color: #0f172a; background: #f8fafc; box-sizing: border-box; transition: all 0.15s ease; }
.fx-signin-form .form-input:focus { background: #ffffff; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); outline: none; }
.fx-signin-form .btn-primary { margin-top: 22px; height: 46px; border-radius: 10px; background: #1665f5; font-size: 15px; font-weight: 700; color: #ffffff; border: none; box-shadow: 0 4px 14px rgba(22, 101, 245, 0.28); cursor: pointer; transition: all 0.2s ease; display: flex; align-items: center; justify-content: center; gap: 8px; }
.fx-signin-form .btn-primary:hover { background: #1052c9; box-shadow: 0 6px 18px rgba(22, 101, 245, 0.38); transform: translateY(-1px); }
.fx-pw { position: relative; }
.fx-pw .form-input { padding-right: 44px; }
.fx-pw .fx-icon-btn { position: absolute; right: 4px; top: 5px; }
.fx-signin-error { margin-top: 12px; color: #cf1322; background: #fff1f0; border: 1px solid #ffccc7; border-radius: 8px; padding: 8px 12px; font-size: 13px; display: flex; gap: 6px; align-items: center; line-height: 1.4; }
.fx-divider-text { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: 13px; margin: 20px 0 12px; }
.fx-divider-text::before, .fx-divider-text::after { content: ""; flex: 1; height: 1px; background: var(--border-color); }
/* Đăng ký: link chuyển form, gợi ý dưới ô, màn "đăng ký xong – chờ kích hoạt" */
.fx-signin-switch { margin-top: 20px; text-align: center; font-size: 13px; color: #64748b; line-height: 1.5; }
.fx-signin-switch a { color: #1665f5; font-weight: 600; text-decoration: none; }
.fx-signin-switch a:hover { text-decoration: underline; }
.fx-signin-hint { margin-top: 4px; font-size: 12px; line-height: 18px; color: var(--text-muted); }
.fx-signin-note { margin-top: 12px; font-size: 12.5px; line-height: 18px; color: #059669; text-align: center; }
.fx-signin-done-ico { font-size: 48px; line-height: 1; color: #52c41a; margin-bottom: 12px; }
.fx-signin-done .fx-page-sub b { font-weight: 500; color: var(--text-main, inherit); }
.fx-signin-cred { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; border: 1px solid var(--border-color); border-radius: 8px; background: #fafafa; }
.fx-signin-cred div { display: flex; justify-content: space-between; gap: 12px; }
.fx-signin-cred span { color: var(--text-sub); }
.fx-signin-cred b { font-weight: 500; word-break: break-all; text-align: right; }
/* Trang quản trị Vizio: số công ty tự đăng ký đang chờ kích hoạt (cạnh tiêu đề danh sách) */
.ov-pending-count { margin-left: 8px; display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 10px; background: #fef3c7; color: #b45309; font-size: 12px; font-weight: 500; vertical-align: middle; }
.ov-tenants .status-badge-inline { white-space: nowrap; }

/* ---------------------------------------------------------------- 8. RESPONSIVE */
@media (max-width: 1440px) {
  .col-conversations { width: 320px; }
  .col-crm { width: 320px; }
  .phone-with-copy { padding-left: 0; }
}
@media (max-width: 1200px) {
  .fx-nav:not(.collapsed) { width: 200px; }
  .fx-subnav { width: 200px; }
  .fx-side-stats { display: none; }
  .fx-kpi-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .fx-grid-2, .fx-form-grid { grid-template-columns: 1fr; }
  .fx-split { flex-direction: column; }
  .fx-subnav { width: auto; }

  /* Đăng nhập & Landing trên mobile: Form bên trên, Landing bên dưới */
  .fx-signin {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important;
    height: auto !important;
    max-height: none !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
    padding: calc(16px + env(safe-area-inset-top, 0px)) 12px calc(40px + env(safe-area-inset-bottom, 0px)) !important;
    gap: 16px !important;
    align-items: center !important;
    justify-content: flex-start !important;
    box-sizing: border-box !important;
    background: #f8fafc !important;
  }
  .fx-signin-form-wrap {
    width: 100% !important;
    max-width: 420px !important;
    min-width: 0 !important;
    padding: 24px 18px !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04) !important;
    margin: 0 auto !important;
    flex-shrink: 0 !important;
    position: relative !important;
    box-sizing: border-box !important;
  }
  .fx-signin-lang {
    display: none !important;
  }
  .fx-signin-logo,
  .fx-signin-mobile-logo {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 16px !important;
    text-align: center !important;
    width: 100% !important;
  }
  .fx-signin-logo img,
  .fx-signin-mobile-logo img {
    height: 34px !important;
    width: auto !important;
    max-width: 150px !important;
    object-fit: contain !important;
    display: block !important;
  }
  .fx-signin-form {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .fx-signin-form h1 {
    font-size: 22px !important;
    font-weight: 800 !important;
    text-align: center !important;
    margin: 0 0 4px !important;
  }
  .fx-signin-form .fx-page-sub {
    font-size: 13px !important;
    text-align: center !important;
    margin-bottom: 18px !important;
  }
  .fx-signin-form .fx-label {
    font-size: 12.5px !important;
    font-weight: 600 !important;
    margin-top: 12px !important;
    margin-bottom: 4px !important;
  }
  .fx-signin-form .form-input {
    width: 100% !important;
    height: 42px !important;
    box-sizing: border-box !important;
    font-size: 14px !important;
  }
  .fx-signin-form .btn-primary {
    width: 100% !important;
    height: 44px !important;
    margin-top: 18px !important;
    font-size: 14.5px !important;
    font-weight: 700 !important;
  }
  .fx-signin-switch {
    font-size: 12.5px !important;
    line-height: 1.5 !important;
    margin-top: 16px !important;
    text-align: center !important;
    word-break: break-word !important;
  }
  .fx-signin-art.fx-pricing-art,
  .fx-signin-art.vz-landing-art {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 420px !important;
    min-width: 0 !important;
    margin: 0 auto !important;
    padding: 22px 16px !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04) !important;
    overflow: visible !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
  }
  .vz-hero-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 16px !important;
    width: 100% !important;
  }
  .vz-hero-content {
    max-width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    width: 100% !important;
  }
  .vz-hero-title {
    font-size: 23px !important;
    font-weight: 900 !important;
    line-height: 1.22 !important;
    text-align: center !important;
    margin: 0 !important;
  }
  .vz-channels {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 6px 8px !important;
    margin-top: 12px !important;
    font-size: 12.5px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .vz-ch-tag {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
  }
  .vz-ch-icon {
    width: 16px !important;
    height: 16px !important;
  }
  .vz-sub-features {
    text-align: center !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    color: #475569 !important;
    margin: 10px 0 0 !important;
  }
  .vz-hero-cta {
    display: flex !important;
    justify-content: center !important;
    margin-top: 16px !important;
    width: 100% !important;
  }
  .vz-btn-trial {
    padding: 10px 24px !important;
    font-size: 13.5px !important;
  }
  .vz-hero-perks {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
    margin-top: 16px !important;
    padding-top: 14px !important;
    border-top: 1px solid #eef2f6 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .vz-perk-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 4px !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  .vz-perk-icon {
    width: 26px !important;
    height: 26px !important;
    border-radius: 50% !important;
    background: #eff6ff !important;
    color: #1665f5 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
  }
  .vz-perk-icon svg {
    width: 13px !important;
    height: 13px !important;
  }
  .vz-perk-text {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  .vz-perk-text b {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #081122 !important;
    line-height: 1.2 !important;
    text-align: center !important;
    display: block !important;
    white-space: normal !important;
  }
  .vz-perk-text span {
    display: none !important;
  }
  .vz-hero-mockup-wrap {
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 14px !important;
    display: flex !important;
    justify-content: center !important;
  }
  .vz-hero-mockup-img {
    width: 100% !important;
    max-width: 320px !important;
    height: auto !important;
    max-height: 200px !important;
    object-fit: contain !important;
  }
  .vz-features-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    margin-top: 16px !important;
    padding-top: 14px !important;
    border-top: 1px solid #eef2f6 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .vz-feat-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 10px 12px !important;
    background: #f8fafc !important;
    border: 1px solid #eef2f6 !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    text-align: left !important;
  }
  .vz-feat-icon {
    width: 34px !important;
    height: 34px !important;
    border-radius: 9px !important;
    background: #eff6ff !important;
    margin-bottom: 0 !important;
    flex-shrink: 0 !important;
  }
  .vz-feat-icon svg {
    width: 18px !important;
    height: 18px !important;
  }
  .vz-feat-body {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    text-align: left !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }
  .vz-feat-title {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #081122 !important;
    margin: 0 0 2px !important;
    line-height: 1.25 !important;
  }
  .vz-feat-desc {
    font-size: 11.5px !important;
    color: #64748b !important;
    line-height: 1.35 !important;
    margin: 0 !important;
    max-width: 100% !important;
  }
  .fx-pricing-top {
    display: none !important;
  }
  .fx-pricing-cycle-wrap {
    margin: 0 0 14px !important;
  }
  .fx-pricing-logo {
    display: block !important;
    margin-bottom: 12px !important;
    text-align: center !important;
  }
  .fx-pricing-logo img {
    height: 36px !important;
    width: auto !important;
    display: inline-block !important;
    margin: 0 auto !important;
  }
  .fx-pricing-quick-login {
    margin-top: 8px !important;
    text-align: center !important;
  }
  .fx-quick-login-link {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    font-size: 12px !important;
    color: #2563eb !important;
    text-decoration: none !important;
    padding: 5px 14px !important;
    border-radius: 999px !important;
    background: #eff6ff !important;
    border: 1px solid #bfdbfe !important;
    transition: all 0.15s ease !important;
  }
  .fx-quick-login-link:hover {
    background: #dbeafe !important;
    color: #1d4ed8 !important;
  }
  .fx-quick-login-link b {
    font-weight: 600 !important;
    text-decoration: underline !important;
  }
  .fx-pricing-hint {
    display: inline-flex !important;
  }
  .fx-pricing-grid {
    touch-action: pan-x pan-y !important;
  }
  .fx-pcard {
    touch-action: pan-x pan-y !important;
  }
  .fx-pricing-title {
    font-size: 18px !important;
    line-height: 1.3 !important;
  }
  .fx-pricing-subtitle {
    font-size: 12px !important;
    line-height: 1.4 !important;
  }
  .fx-pricing-hint {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 600;
    color: #2563eb;
    background: #eff6ff;
    border: 1px dashed #bfdbfe;
    padding: 4px 12px;
    border-radius: 999px;
    margin: 0 auto 10px;
    text-align: center;
  }
  .fx-pricing-grid {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 12px !important;
    padding: 10px 4px 16px !important;
    margin: 0 -4px 4px !important;
    scrollbar-width: none !important;
  }
  .fx-pricing-grid::-webkit-scrollbar {
    display: none;
  }
  .fx-pcard {
    flex: 0 0 84% !important;
    min-width: 250px !important;
    max-width: 290px !important;
    scroll-snap-align: center !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05) !important;
  }
  .fx-pricing-guarantee {
    font-size: 11.5px !important;
    padding: 10px 12px !important;
  }
}

/* Modal Quản lý người dùng (UserManagement, component multi-tenant giữ nguyên) */
.modal-body .qr-add-form .form-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.modal-body .qr-add-form .form-row > input,
.modal-body .qr-add-form .form-row > select {
  height: 36px; border: 1px solid var(--fx-ctrl-border); border-radius: 8px;
  padding: 0 10px; background: #fff; font-size: 13px; min-width: 0;
}
.modal-body .qr-table td .btn-sm { margin-bottom: 4px; }

/* ---------------------------------------------------------------- 9. DANH BẠ ZALO + GHIM TIN NHẮN
   Trang Danh bạ (.pg-contacts — ContactsPage), modal Thêm bạn / Tạo nhóm (.zc-modal), drawer thành viên
   nhóm (.zc-drawer), nút "+" Zalo trên thanh công cụ danh sách hội thoại (.fx-conv-new), icon nhóm
   trước tên hội thoại (.fx-conv-grp), thanh tin đã ghim dưới header khung chat (.chat-pinbar).
   Màn nhỏ: foxia-mobile.css (mục "DANH BẠ ZALO + GHIM TIN"). */
.pg-contacts .fx-toolbar > .fx-search { flex: 0 1 360px; }
.zc-ch-select { width: auto; min-width: 180px; max-width: 280px; }
.zc-loading { padding: 40px 16px; text-align: center; color: var(--text-sub); }
.zc-table .zc-name { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zc-table .fx-cell-user > .fx-tag { flex-shrink: 0; }
.zc-table td { padding-top: 10px; padding-bottom: 10px; }
.zc-btn-gap { margin-left: 8px; }
.fx-tab-count.zc-count-hot, .fx-tabs button.active .fx-tab-count.zc-count-hot { background: #fff1f0; color: #cf1322; }

/* Danh sách dạng hàng: lời mời kết bạn, thành viên nhóm */
.zc-sec { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 20px 0 8px; }
.fx-toolbar + .zc-sec { margin-top: 0; }
.zc-list { border: 1px solid var(--border-light); border-radius: 12px; overflow: hidden; }
.zc-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border-light); background: #fff; }
.zc-row:last-child { border-bottom: none; }
.zc-av { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #f0f2f5; flex-shrink: 0; }
.zc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 20px; }
.zc-main > b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zc-main > small { font-size: 13px; color: var(--text-sub); }
.zc-msg {
  margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: #f5f7fa; font-size: 13px; line-height: 18px;
  color: var(--text-main); white-space: pre-wrap; overflow-wrap: anywhere;
}
.zc-acts { display: flex; gap: 8px; flex-shrink: 0; }
.zc-drawer .zc-list { border: none; border-radius: 0; }
.zc-drawer .zc-row { padding: 10px 24px; }
.zc-drawer .zc-row .fx-icon-btn { color: var(--primary); }

/* Modal Thêm bạn / Tạo nhóm */
.zc-modal .modal-body { max-height: calc(100vh - 200px); overflow-y: auto; }
.zc-field { margin-bottom: 16px; }
.zc-field:last-child { margin-bottom: 0; }
.zc-inline { display: flex; gap: 8px; }
.zc-inline .form-input { flex: 1; min-width: 0; }
.zc-inline .btn { flex-shrink: 0; }
.zc-note {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 12px; border-radius: 8px;
  background: #fff7e6; color: #ad4e00; font-size: 13px; line-height: 20px;
}
.zc-note .ph { font-size: 16px; }
.zc-found { border: 1px solid var(--border-color); border-radius: 12px; padding: 12px; }
.zc-found-head { display: flex; align-items: center; gap: 12px; }
.zc-found-head > .fx-tag { flex-shrink: 0; }
.zc-found-av { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: #f0f2f5; flex-shrink: 0; }
.zc-found .zc-field { margin: 12px 0 0; }
.zc-textarea { min-height: 72px; }
.zc-count { text-align: right; font-size: 12px; line-height: 18px; color: var(--text-muted); margin-top: 2px; }
.zc-hint { font-weight: 400; font-size: 13px; color: var(--text-sub); }
.zc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; max-height: 88px; overflow-y: auto; }
.zc-chips .fx-chip { height: 28px; font-size: 13px; }
.zc-pick-search { min-width: 0; margin-bottom: 8px; }
.zc-pick-list { border: 1px solid var(--border-light); border-radius: 12px; max-height: 320px; overflow-y: auto; padding: 4px; }
.zc-pick-list .zc-note, .zc-pick-list .zc-loading { justify-content: center; margin: 0; padding: 24px 12px; background: transparent; color: var(--text-sub); }
.zc-pick-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.zc-pick-row:hover { background: var(--fx-hover); }
.zc-pick-row.on { background: var(--primary-light); }
.zc-pick-row input[type="checkbox"] { width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--primary); cursor: pointer; }
.zc-pick-row .zc-av { width: 36px; height: 36px; }
.zc-pick-more { display: flex; margin: 8px auto 4px; }
.zc-foot-hint { margin-right: auto; align-self: center; font-size: 13px; color: var(--text-sub); }

/* Live Chat: nút "+" Zalo + icon nhóm trước tên hội thoại */
.fx-conv-new { display: inline-flex; flex-shrink: 0; }
.fx-conv-grp { margin-right: 4px; font-size: 15px; color: var(--text-sub); vertical-align: -2px; }

/* Thanh tin nhắn đã ghim (dưới header khung chat) */
.chat-pinbar {
  flex-shrink: 0; max-height: 40vh; overflow-y: auto; padding: 2px 8px 2px 16px; background: #fff;
  border-bottom: 1px solid var(--zl-line, #dde1e6); box-shadow: 0 2px 4px rgba(8, 28, 54, 0.06); position: relative; z-index: 1;
}
.chat-pin-row { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.chat-pin-row + .chat-pin-row { border-top: 1px solid var(--border-light); }
.chat-pin-ic { width: 20px; flex-shrink: 0; display: inline-flex; justify-content: center; color: var(--primary); font-size: 18px; }
.chat-pin-main {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 0; padding: 4px 0;
  border: none; background: none; text-align: left; cursor: pointer; line-height: 18px;
}
.chat-pin-main small { font-size: 12px; color: var(--text-sub); }
.chat-pin-text { max-width: 100%; font-size: 13px; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-pin-who { color: var(--text-sub); }
.chat-pin-main:hover .chat-pin-text { color: var(--primary); }
.chat-pin-main:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.chat-pin-more {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; cursor: pointer;
  border: 1px solid var(--fx-ctrl-border); border-radius: 13px; background: #fff; font-size: 12px; color: var(--text-sub);
}
.chat-pin-more:hover { color: var(--primary); border-color: var(--primary); }
.chat-pin-x {
  flex-shrink: 0; width: 28px; height: 28px; border: none; border-radius: 50%; background: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 14px;
}
.chat-pin-x:hover { background: var(--fx-hover); color: var(--text-main); }
/* Ghim nhỏ ở góc bong bóng tin đã ghim + nháy sáng khi bấm từ thanh ghim */
.msg-pin-flag {
  position: absolute; top: -7px; z-index: 1; width: 18px; height: 18px; border-radius: 50%; pointer-events: none;
  display: inline-flex; align-items: center; justify-content: center; background: #fff; color: var(--primary); font-size: 11px;
  box-shadow: 0 1px 3px rgba(8, 28, 54, 0.18);
}
.message-row.inbound .msg-pin-flag { right: -7px; }
.message-row.outbound .msg-pin-flag { left: -7px; }
.message-row.msg-flash :is(.msg-bubble, .call-log-bubble) { animation: fxMsgFlash 1.6s ease-out; }
@keyframes fxMsgFlash {
  0%, 40% { box-shadow: 0 0 0 3px rgba(0, 104, 255, 0.45); }
  100% { box-shadow: 0 1px 2px rgba(8, 28, 54, 0.12); }
}
@media (prefers-reduced-motion: reduce) {
  .message-row.msg-flash :is(.msg-bubble, .call-log-bubble) { animation: none; outline: 3px solid rgba(0, 104, 255, 0.45); }
}

/* ---------------------------------------------------------------- 10. BÌNH LUẬN FANPAGE (.fbc-*)
   Hội thoại bình luận (contact "cmt:…"): icon trước tên trong danh sách (.fbc-conv-ic), thẻ "Bình luận trên
   bài viết" phía trên bong bóng (.fbc-post), chip Đã ẩn / Đã xoá / Đã thích / Đã nhắn riêng trong bong bóng
   (.fbc-chips), nút thao tác bình luận trong cụm nút rê chuột (.msg-actions.fbc-acts), thanh "Đang trả lời
   bình luận" trên ô soạn (.fbc-reply-bar), gợi ý "Trả lời công khai" (.fbc-public-hint), modal Nhắn riêng
   (.fbc-pr-*). Màn nhỏ: foxia-mobile.css (mục "BÌNH LUẬN FANPAGE"). */
.fbc-conv-ic { margin-right: 4px; font-size: 15px; color: #1877f2; vertical-align: -2px; }

/* Thẻ bài viết phía trên bình luận */
.fbc-post {
  display: flex; align-items: center; gap: 6px; max-width: 100%; margin-bottom: 4px; padding: 4px 10px; box-sizing: border-box;
  border: 1px solid var(--zl-line, #dde1e6); border-radius: 8px; background: rgba(255, 255, 255, 0.72);
  font-size: 12px; line-height: 18px; color: var(--text-sub);
}
.fbc-post > .ph { flex-shrink: 0; font-size: 14px; color: #1877f2; }
.fbc-post-text { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fbc-post-text b { font-weight: 500; color: var(--text-main); }
.fbc-post-link {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 2px; margin-left: 2px;
  color: var(--primary); font-weight: 500; text-decoration: none; white-space: nowrap;
}
.fbc-post-link .ph { font-size: 12px; }
.fbc-post-link:hover { text-decoration: underline; }
.fbc-post-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

/* Trạng thái bình luận trong bong bóng */
.message-row.inbound .msg-bubble.fbc-hidden { background: #f7f8fa; color: var(--text-sub); box-shadow: 0 0 0 1px var(--zl-line, #dde1e6); }
.fbc-struck { text-decoration: line-through; color: var(--text-muted); }
.fbc-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.fbc-chip {
  display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 7px; border-radius: 10px;
  font-size: 11px; line-height: 20px; white-space: nowrap; background: #f2f4f7; color: var(--text-sub);
}
.fbc-chip .ph { font-size: 12px; }
.fbc-chip.is-liked { background: var(--primary-light); color: var(--primary); }
.fbc-chip.is-pm { background: #e8f7ee; color: #067647; }
.fbc-chip.is-hidden { background: #fff7e6; color: #ad4e00; }
.fbc-chip.is-del { background: #fff1f0; color: #cf1322; }

/* Nút thao tác bình luận (cụm nút rê chuột) */
.msg-actions button.on { color: var(--primary); }
.msg-actions button:disabled, .msg-actions button.is-off { opacity: 0.45; cursor: not-allowed; }
.msg-actions button:disabled:hover, .msg-actions button.is-off:hover { color: var(--text-sub); }
.msg-actions button.fbc-act-del:hover:not(:disabled) { color: var(--danger); }

/* Ô soạn: đang trả lời bình luận nào + gợi ý trả lời công khai */
.fbc-reply-bar {
  display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 2px 8px 2px 16px;
  background: var(--primary-light); border-bottom: 1px solid var(--zl-line, #dde1e6);
  font-size: 13px; line-height: 18px; color: var(--text-sub);
}
.fbc-reply-bar > .ph { flex-shrink: 0; font-size: 16px; color: var(--primary); }
.fbc-reply-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fbc-reply-text b { font-weight: 500; color: var(--text-main); }
.fbc-reply-x {
  flex-shrink: 0; width: 28px; height: 28px; border: none; border-radius: 50%; background: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; color: var(--text-sub); font-size: 14px;
}
.fbc-reply-x:hover { background: rgba(0, 0, 0, 0.06); color: var(--text-main); }
.fbc-public-hint { color: #ad4e00; }
.fbc-public-hint .ph { font-size: 14px; }

/* Modal Nhắn riêng */
.fbc-pr-quote {
  margin-bottom: 12px; padding: 8px 12px; border-left: 3px solid #1877f2; border-radius: 4px; background: #f5f7fa;
  font-size: 13px; line-height: 20px; color: var(--text-sub); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.fbc-pr-quote b { font-weight: 500; color: var(--text-main); }
.fbc-pr-text { min-height: 96px; }
.fbc-pr-note { display: flex; gap: 6px; margin-top: 8px; font-size: 12px; line-height: 18px; color: var(--text-sub); }
.fbc-pr-note .ph { flex-shrink: 0; margin-top: 2px; font-size: 14px; }

/* Messenger quá 24h kể từ tin cuối của khách (chính sách Meta) — cảnh báo trên ô soạn */
.fbc-window-warn { display: flex; gap: 8px; align-items: flex-start; margin: 6px 12px 0; padding: 8px 10px;
  border-radius: 8px; background: #fff8e6; border: 1px solid #f5d48a; color: #7a5200; font-size: 13px; line-height: 1.45; }
.fbc-window-warn .ph { font-size: 16px; margin-top: 1px; flex-shrink: 0; }

/* Nhóm Zalo: tên thành viên gửi phía trên cụm tin */
.msg-sender { font-size: 12px; line-height: 1.3; color: var(--text-muted, #7a8599); margin: 0 0 3px 2px; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Tương tác với tên / avatar thành viên nhóm Zalo */
.msg-sender-interactive {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease;
}
.msg-sender-interactive:hover {
  color: var(--primary-color, #0b76e0) !important;
  text-decoration: underline;
}
.msg-avatar-interactive {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.msg-avatar-interactive:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Modal thông tin thành viên nhóm Zalo */
.gmm-modal {
  max-width: 380px !important;
  width: 90% !important;
  border-radius: 16px !important;
  overflow: hidden;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
}
.gmm-header {
  padding: 14px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.gmm-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
}
.gmm-body {
  padding: 20px 18px;
  background: #fff;
}
.gmm-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 20px;
}
.gmm-avatar-wrap {
  position: relative;
  margin-bottom: 12px;
}
.gmm-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
.gmm-avatar-initial {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0b76e0, #0056b3);
  color: #fff;
  font-size: 26px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
.gmm-info {
  width: 100%;
}
.gmm-name {
  font-size: 17px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 6px;
  line-height: 1.3;
}
.gmm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 10px;
}
.gmm-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 12px;
}
.gmm-badge-admin {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.gmm-badge-member {
  background: #f1f5f9;
  color: #475569;
}
.gmm-badge-friend {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.gmm-badge-channel {
  background: #eef2ff;
  color: #4338ca;
}
.gmm-meta-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #64748b;
  background: #f8fafc;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}
.gmm-copy-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  border-radius: 4px;
  transition: color 0.15s;
}
.gmm-copy-btn:hover {
  color: #0b76e0;
}
.gmm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.gmm-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.gmm-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.gmm-btn-chat {
  background: #0b76e0;
  color: #fff;
  box-shadow: 0 2px 6px rgba(11, 118, 224, 0.25);
}
.gmm-btn-chat:hover:not(:disabled) {
  background: #0861b8;
  transform: translateY(-1px);
}
.gmm-btn-call {
  background: #10b981;
  color: #fff;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}
.gmm-btn-call:hover:not(:disabled) {
  background: #059669;
  transform: translateY(-1px);
}
.gmm-sub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}
.gmm-sub-btn {
  background: transparent;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 12.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.15s ease;
}
.gmm-sub-btn:hover {
  background: #f8fafc;
  color: #0b76e0;
  border-color: #cbd5e1;
}

/* Ảnh nhóm Zalo chưa đặt ảnh: ghép ảnh thành viên trong 1 vòng tròn (như Zalo). Kích thước theo class nơi dùng. */
.fx-gav { display: inline-grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 1px; flex-shrink: 0;
  border-radius: 50%; overflow: hidden; background: #fff; vertical-align: middle; box-sizing: border-box; }
.fx-gav > * { width: 100%; height: 100%; min-width: 0; min-height: 0; display: block; }
.fx-gav > img { object-fit: cover; }
.fx-gav-blank { background: #e4e7ec; }
.fx-gav-more { display: flex; align-items: center; justify-content: center; background: #e4e7ec; color: #475467;
  font-size: 11px; font-weight: 600; line-height: 1; }
.fx-gav.n2 { grid-template-rows: 1fr; }
.fx-gav.n3 > :first-child { grid-column: 1 / span 2; }
.fx-crm-avatar.fx-gav .fx-gav-more { font-size: 15px; }
.lc-contact-gav { width: 44px; height: 44px; }

/* ===== AI Agent (OpenAI) ===== */
.fx-ai-btn, .fx-ai-pill { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px;
  border-radius: 14px; font-size: 13px; line-height: 1; border: 1px solid #d6c8ff; background: #f6f2ff; color: #6d28d9; cursor: pointer; white-space: nowrap; }
.fx-ai-btn:hover:not(:disabled) { background: #ede5ff; }
.fx-ai-btn:disabled { opacity: .7; cursor: progress; }
.fx-ai-pill { border-color: #b7ebc6; background: #effbf2; color: #137333; }
.fx-ai-pill + .fx-ai-btn { margin-left: 6px; }
.fx-ai-pill.paused { border-color: var(--fx-ctrl-border); background: #f5f5f5; color: var(--text-sub); }
.fx-ai-tag { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: #6d28d9; margin-top: 4px; }
.fx-shell .c-violet { background: #f1ebff; color: #6d28d9; }
.ai-statusbar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--fx-th-bg);
  border: 1px solid var(--border-light); color: var(--text-sub); margin-bottom: 16px; font-size: 14px; flex-wrap: wrap; }
.ai-statusbar.on { background: #effbf2; border-color: #b7ebc6; color: #135c2c; }
.ai-statusbar .ph { font-size: 18px; }
.ai-statusbar .btn { margin-left: auto; }
.ai-form { padding: 16px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--border-light); box-shadow: none; }
.ai-form .fx-label { margin: 8px 0 2px; }
.ai-form .fx-h2 { margin-bottom: 4px; }
.ai-textarea { width: 100%; min-height: 120px; padding: 8px 11px; line-height: 1.5; resize: vertical; font-family: inherit; height: auto; }
.ai-textarea.tall { min-height: 240px; }
.ai-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.ai-channels { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-ch { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--fx-ctrl-border); border-radius: 8px; cursor: pointer; font-size: 14px; }
.ai-ch.on { border-color: var(--primary); background: var(--primary-light); }
.ai-ch-type { font-size: 12px; color: var(--text-muted); }
.ai-inline-switch, .ai-inline { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; }
.ai-inline { margin-top: 0; }
.ai-agents { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.ai-agent { padding: 16px; display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--border-light); box-shadow: none; }
.ai-agent.off { opacity: .7; }
.ai-agent-head { display: flex; align-items: center; gap: 10px; }
.ai-agent-ico { width: 36px; height: 36px; border-radius: 10px; background: #f1ebff; color: #6d28d9; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.ai-agent-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ai-badge { font-size: 12px; padding: 1px 8px; border-radius: 10px; background: var(--primary-light); color: var(--primary); }
.ai-badge.muted { background: #f5f5f5; color: var(--text-sub); }
.ai-agent-ch { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.ai-chip { padding: 1px 8px; border-radius: 10px; background: var(--fx-th-bg); border: 1px solid var(--border-light); }
.ai-agent-ins { margin: 0; color: var(--text-sub); font-size: 13px; line-height: 1.5; white-space: pre-line;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ai-agent-actions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: auto; }
.ai-danger { color: var(--danger) !important; }
.ai-tester { margin-top: 16px; padding: 16px; border: 1px solid var(--border-light); box-shadow: none; }
.ai-tester-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.ai-tester-head .btn-close { margin-left: auto; }
.ai-tester-log { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; padding: 12px; background: var(--bg-app); border-radius: 10px; }
.ai-tmsg { max-width: 80%; padding: 8px 12px; border-radius: 12px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.ai-tmsg.user { align-self: flex-end; background: var(--fx-out-bubble); }
.ai-tmsg.assistant { align-self: flex-start; background: #fff; box-shadow: 0 0 0 1px var(--border-light); }
.ai-tmsg.handoff, .ai-tmsg.error { align-self: center; font-size: 13px; background: #fff8e6; color: #7a5200; }
.ai-tmsg.error { background: #fff1f0; color: #a8071a; }
.ai-tester-input { display: flex; gap: 8px; margin-top: 12px; }
.ai-tester-input .form-input { flex: 1; }
.ai-klist { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.ai-kitem { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--border-light); border-radius: 10px; }
.ai-kitem > .ph { font-size: 22px; color: var(--text-sub); margin-top: 2px; }
.ai-kbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ai-kbody .fx-muted { font-size: 12px; }
.ai-kbody p { margin: 4px 0 0; font-size: 13px; color: var(--text-sub); white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; }
.ai-kact { display: flex; gap: 2px; }
.ai-kb-total { font-weight: 400; }
/* Bộ ảnh sản phẩm của AI (Nguồn kiến thức) + ảnh AI gửi trong Thử trò chuyện */
.ai-hint { font-size: 12px; color: var(--text-sub); margin: 2px 0 8px; }
.ai-imgs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ai-imgs img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border-light); background: #fff; display: block; }
.ai-imgs.lg img, .ai-img-add { width: 88px; height: 88px; }
.ai-img-edit { position: relative; }
.ai-img-edit button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: none;
  background: var(--danger); color: #fff; font-size: 14px; line-height: 22px; padding: 0; cursor: pointer; }
.ai-img-add { border: 1px dashed var(--border-light); border-radius: 8px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4px; font-size: 12px; color: var(--text-sub); background: transparent; cursor: pointer; }
.ai-img-add:disabled { cursor: progress; opacity: 0.7; }
.ai-tmsg-imgs { align-self: flex-start; margin-top: -2px; }
.ai-key { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.ai-key-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.ai-key-row .form-input { width: 280px; max-width: 100%; }
.ai-key-ok { color: #137333; display: inline-flex; align-items: center; gap: 4px; font-size: 14px; }
.ai-note { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: #fff8e6; color: #7a5200; margin-bottom: 16px; }
.ai-tabs2 { margin-top: 24px; }
@media (max-width: 640px) {
  .ai-key { align-items: stretch; }
  .ai-key-row { justify-content: stretch; }
  .ai-key-row .form-input { width: 100%; }
  .ai-agents { grid-template-columns: 1fr; }
}
.ai-key-link { font-size: 13px; color: var(--primary); display: inline-flex; align-items: center; gap: 4px; }
.ai-key-note { font-size: 13px; color: var(--text-sub); margin: -4px 0 8px; }
.ai-provider-select { min-width: 260px; }
@media (max-width: 640px) { .ai-provider-select { min-width: 0; width: 100%; } }

/* Trả lời trích dẫn (Zalo): khung tin gốc trong bong bóng (kèm ảnh thu nhỏ nếu trích dẫn tin hình ảnh) */
.msg-quote { display: flex; flex-direction: row; align-items: center; gap: 8px; padding: 5px 8px; margin: 0 0 6px; border-left: 3px solid var(--primary);
  background: rgba(0, 104, 255, 0.06); border-radius: 6px; font-size: 13px; line-height: 1.4; cursor: pointer; max-width: 100%; }
.msg-quote-thumb { width: 42px; height: 42px; border-radius: 5px; object-fit: cover; flex-shrink: 0; background: #e2e8f0; border: 1px solid rgba(8, 28, 54, 0.08); cursor: zoom-in; transition: transform 0.15s ease; }
.msg-quote-thumb:hover { transform: scale(1.04); }
.msg-quote-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.msg-quote b { font-weight: 600; color: var(--text-main); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-quote span { color: var(--text-sub); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.msg-quote:hover { background: rgba(0, 104, 255, 0.1); }
.message-row.outbound .msg-quote { background: rgba(255, 255, 255, 0.7); border-left-color: #0068ff; }
.fbc-reply-thumb { width: 28px; height: 28px; border-radius: 4px; object-fit: cover; flex-shrink: 0; border: 1px solid rgba(8, 28, 54, 0.1); }
.msg-quote-fail { margin-top: 4px; font-size: 12px; color: #ad6800; display: flex; align-items: center; gap: 4px; }
.ai-ch-owner { font-size: 12px; color: var(--warning); }

/* Tag thành viên (@) trong nhóm Zalo */
.msg-mention { color: var(--primary); font-weight: 500; }
.fx-mention-item { display: flex; align-items: center; gap: 8px; }
.fx-mention-ava { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: #f0f2f5; }
.fx-mention-ava.all { display: inline-flex; align-items: center; justify-content: center; background: var(--primary-light); color: var(--primary); font-size: 16px; }

/* AI tạm dừng (nhân viên nhắn tay) — nhắc bật lại */
.ai-paused-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: #fff8e6;
  border: 1px solid #f5d48a; color: #7a5200; margin: -8px 0 16px; font-size: 14px; flex-wrap: wrap; }
.ai-paused-bar .ph { font-size: 18px; }
.ai-paused-bar .btn { margin-left: auto; }
.fx-ai-pill.paused { border-color: #f5d48a; background: #fff8e6; color: #7a5200; }
.ai-k-agents { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.ai-chip.muted { color: var(--text-muted); }
.ai-upload-for { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; }
/* AI Agents: cấu hình model riêng của agent + kiến thức theo agent */
.ai-sub { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--border-light); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.ai-sub .fx-muted { font-weight: 400; font-size: 13px; }
.ai-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.ai-grid2 > div { display: flex; flex-direction: column; min-width: 0; }
.ai-model-row { display: flex; gap: 8px; align-items: center; }
.ai-model-row .form-input { flex: 1; min-width: 0; }
.ai-hint { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.ai-hint.ok { color: #137333; }
.ai-hint.err { color: var(--danger); }
.ai-hint.warn { color: #7a5200; }
.ai-chip.warn { background: #fff8e6; border-color: #f5d48a; color: #7a5200; }
.ai-chip.model { font-size: 12px; color: var(--text-sub); }
.ai-chip.test-active { background: #fdf4ff; border-color: #d8b4fe; color: #7e22ce; font-weight: 500; }
.fx-ai-pill.off { border-color: var(--fx-ctrl-border); background: #fff; color: var(--text-sub); }
.fx-ai-pill.off:hover { border-color: var(--primary); color: var(--primary); }
.fx-ai-pill.is-test { border-color: #d8b4fe; background: #fdf4ff; color: #7e22ce; }
.fx-ai-pill.is-test:hover { background: #fae8ff; border-color: #c084fc; }
.fx-ai-pill + .fx-ai-pill { margin-left: 6px; }

/* AI Agent Chế độ chạy thử nghiệm kịch bản */
.ai-test-config-box { margin-top: 10px; padding: 12px 14px; background: var(--fx-th-bg); border: 1px dashed #d8b4fe; border-radius: 10px; }
.ai-test-config-body { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.ai-test-modal { max-width: 600px !important; }
.ai-test-convs-list { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; padding: 4px 0; }
.ai-test-conv-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--border-light); border-radius: 10px; background: var(--bg-card, #fff); transition: background 0.15s; }
.ai-test-conv-item:hover { background: var(--fx-th-bg); }
.ai-test-conv-avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: #e2e8f0; display: flex; align-items: center; justify-content: center; }
.ai-test-conv-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ai-test-conv-noavatar { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: var(--text-muted); font-size: 20px; }
.ai-test-conv-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ai-test-conv-name { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.ai-test-conv-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.ai-test-conv-name .channel-chip { font-size: 11px; padding: 0 6px; border-radius: 4px; }
.ai-test-conv-meta { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-test-conv-lastmsg { color: var(--text-sub); }
.ai-kagent-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; padding: 10px 12px; border-radius: 10px; background: var(--fx-th-bg); border: 1px solid var(--border-light); }
.ai-kagent-bar label { font-weight: 600; }
.ai-kagent-bar .fx-select { min-width: 240px; }
.ai-kagent-bar .fx-muted { font-size: 13px; }
@media (max-width: 640px) {
  .ai-grid2 { grid-template-columns: 1fr; }
  .ai-kagent-bar .fx-select { min-width: 0; width: 100%; }
}

/* ---------------------------------------------------------------- 11. XOÁ / THU HỒI TIN + TẮT THÔNG BÁO HỘI THOẠI
   Tin đã thu hồi / bị xoá với mọi người (.msg-bubble.is-recalled + .msg-recalled), nút thùng rác của quản trị viên
   trong cụm nút rê chuột (.msg-act-del), modal Xoá / thu hồi tin (.msg-del-*), nút + menu Tắt thông báo (ConvMute.js:
   .fx-mute* — chuông trên header khung chat, ô giữa bộ 3 nút của panel khách / drawer Khách hàng), dấu "đã tắt thông
   báo" ở danh sách hội thoại (.fx-conv-muted, .conv-unread.is-muted) và ở dòng phụ dưới tên khách (.fx-sub-muted).
   Màn nhỏ: foxia-mobile.css (mục "XOÁ / THU HỒI TIN + TẮT THÔNG BÁO"). */

/* Bong bóng tin đã thu hồi: nền trong mờ, viền mảnh, chữ nghiêng (như Zalo) */
.message-row.inbound .msg-bubble.is-recalled,
.message-row.outbound .msg-bubble.is-recalled {
  background: rgba(255, 255, 255, 0.55); color: var(--text-sub); box-shadow: 0 0 0 1px var(--zl-line, #dde1e6);
}
.msg-recalled { display: inline-flex; align-items: center; gap: 6px; font-style: italic; color: var(--text-sub); }
.msg-recalled .ph { flex-shrink: 0; font-size: 15px; font-style: normal; }
.msg-actions button.msg-act-del:hover:not(:disabled) { color: var(--danger); }

/* Modal Xoá / thu hồi tin: tin đang xoá · các cách xoá (ô chọn; không dùng được = mờ + lý do) · cảnh báo */
.msg-del-modal:focus { outline: none; }
.msg-del-quote {
  margin-bottom: 12px; padding: 8px 12px; border-left: 3px solid var(--primary); border-radius: 4px; background: #f5f7fa;
  font-size: 13px; line-height: 20px; color: var(--text-sub); overflow-wrap: anywhere;
}
.msg-del-who b { font-weight: 500; color: var(--text-main); }
.msg-del-snip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.msg-del-state { display: flex; align-items: center; gap: 8px; padding: 8px 0; font-size: 14px; line-height: 20px; color: var(--text-sub); }
.msg-del-state .ph { flex-shrink: 0; font-size: 18px; }
.msg-del-state.is-err { color: #b42318; }
.msg-del-state .btn { flex-shrink: 0; margin-left: auto; }
.msg-del-opts { display: flex; flex-direction: column; gap: 8px; }
.msg-del-opt {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--border-color);
  border-radius: 8px; background: #fff; cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.msg-del-opt:hover:not(.off) { border-color: var(--primary); }
.msg-del-opt.on { border-color: var(--primary); background: var(--primary-light); }
.msg-del-opt.off { cursor: not-allowed; background: #fafafa; }
.msg-del-opt.off .msg-del-opt-text > b,
.msg-del-opt.off .msg-del-opt-text > small:not(.msg-del-why) { opacity: 0.55; }
.msg-del-opt input { flex-shrink: 0; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--primary); cursor: inherit; }
.msg-del-opt-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.msg-del-opt-text b { font-size: 14px; font-weight: 500; line-height: 20px; color: var(--text-main); }
.msg-del-opt-text small { font-size: 12px; line-height: 18px; color: var(--text-sub); }
.msg-del-opt-text small.msg-del-why,
.msg-del-opt-text small.msg-del-dl { display: flex; align-items: flex-start; gap: 4px; margin-top: 2px; }
.msg-del-opt-text small.msg-del-why { color: #ad4e00; }
.msg-del-why .ph, .msg-del-dl .ph { flex-shrink: 0; margin-top: 2px; font-size: 13px; }
.msg-del-note {
  display: flex; gap: 6px; margin-top: 12px; padding: 8px 10px; border-radius: 8px; background: #fff8e6;
  border: 1px solid #f5d48a; color: #7a5200; font-size: 13px; line-height: 18px;
}
.msg-del-warn { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 13px; line-height: 18px; color: var(--text-sub); }
.msg-del-note .ph, .msg-del-warn .ph { flex-shrink: 0; font-size: 15px; }
.msg-del-note .ph { margin-top: 1px; }
/* Nút xác nhận đỏ ở chân modal (màn lớn — màn nhỏ dùng chung chân bottom sheet) */
.fx-modal-foot .btn.fx-btn-danger { background: #d92d20; border-color: #d92d20; color: #fff; }
.fx-modal-foot .btn.fx-btn-danger:hover:not(:disabled) { background: #b42318; border-color: #b42318; }
.fx-modal-foot .btn.fx-btn-danger:disabled {
  background: rgba(0, 0, 0, 0.04); border-color: var(--fx-ctrl-border); color: rgba(0, 0, 0, 0.25); cursor: not-allowed;
}

/* Nút Tắt thông báo: chuông header (đang tắt = nền xanh nhạt như nút "chưa đọc") / ô giữa bộ 3 nút (display: contents →
   nút là con trực tiếp của .fx-crm-trio, dùng y nguyên CSS bộ 3 nút ở mọi cỡ màn) */
.fx-mute.is-icon { display: inline-flex; }
.fx-mute.is-trio { display: contents; }
.chat-header .fx-mute-btn.is-muted { color: var(--primary); background: rgba(0, 104, 255, 0.1); }
.chat-header .fx-mute-btn.is-muted:hover { color: var(--primary); background: rgba(0, 104, 255, 0.16); }
.fx-crm-trio .fx-mute button.fx-mute-trio.on { color: var(--primary); }
.fx-crm-trio .fx-mute button.fx-mute-trio.on span { background: var(--primary-light); color: var(--primary); }
.fx-crm-trio button.fx-mute-trio:disabled { opacity: 0.5; cursor: not-allowed; }
/* Menu (Teleport ra body, position fixed — ConvMute.js tự đặt toạ độ) */
.fx-popover.fx-mute-pop { position: fixed; width: 268px; max-width: calc(100vw - 16px); box-sizing: border-box; }
.fx-mute-pop .fx-pop-item .ph { flex-shrink: 0; }
.fx-mute-note { padding: 0 12px 8px; font-size: 12px; line-height: 18px; color: var(--text-sub); }
.fx-mute-status { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 13px; line-height: 18px; color: var(--text-sub); }
.fx-mute-status .ph { flex-shrink: 0; font-size: 16px; color: var(--primary); }
.fx-mute-status b { font-weight: 500; color: var(--text-main); }

/* Đã tắt thông báo: chuông gạch trước giờ ở danh sách (vẫn đếm chưa đọc — badge xám) + dòng phụ dưới tên khách */
.fx-conv-muted { flex-shrink: 0; width: 15px; height: 15px; margin-left: auto; margin-right: -3px; color: #9aa3b2; display: inline-block; vertical-align: middle; }
.conv-item.unread.is-muted .conv-time { color: var(--text-muted); font-weight: 500; }
.conv-unread.is-muted { background: #b0b7c3; color: #ffffff; }
.fx-sub-muted { margin-right: 4px; font-size: 14px; vertical-align: -2px; color: var(--text-sub); }

/* Ảnh phóng to (bấm vào ảnh trong tin nhắn) trên máy tính: cỡ vừa phải — tối đa ~2/3 màn hình (và 1100×760px trên
   màn lớn), đúng tỉ lệ, không tràn / không kéo giãn ảnh nhỏ; chừa chỗ cho nút đóng. Màn ≤ 1023px dùng quy tắc riêng ở
   foxia-mobile.css (điều kiện bù đúng điều kiện đó — phóng to trình duyệt có thể cho bề ngang lẻ kiểu 1023.5px). */
@media not all and (max-width: 1023px) {
  .lightbox-overlay > img {
    display: block;
    width: auto;
    height: auto;
    max-width: min(65vw, 1100px);
    max-height: min(65vh, calc(100vh - 120px), 760px);
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  }
}

/* ---------------------------------------------------------------- 12. THẺ ZALO (.msg-zcard, .msg-znote)
   Tin Zalo dạng thẻ (meta.card do máy chủ đọc từ nội dung tin: chuyển khoản, thiệp, nhắc hẹn, tin OA, bình chọn,
   công việc, danh thiếp…) hiện thành thẻ gọn trong bong bóng THAY dòng "[chat.webcontent]"…: ảnh (QR với thẻ chuyển
   khoản) · loại · tiêu đề (link) · mô tả ≤ 3 dòng · ngân hàng / số tài khoản (nút sao chép) / chủ tài khoản · nút.
   Tin dạng thẻ chưa đọc được (tin cũ, loại mới) → nhãn dễ đọc, chữ nghiêng mờ (.msg-znote). Chỉ dùng token màu.
   Màn nhỏ: foxia-mobile.css (mục "THẺ ZALO"). */
.msg-znote { font-style: italic; color: var(--text-sub); }
.msg-zcard {
  display: flex; flex-direction: column; width: 280px; max-width: 100%; overflow: hidden; border-radius: 8px;
  background: var(--bg-card); box-shadow: 0 0 0 1px var(--border-color); color: var(--text-main);
}
.message-row.outbound .msg-zcard { background: #ffffff; box-shadow: 0 0 0 1px #cce0ff; }
.msg-zcard + .msg-attachments { margin-top: 8px; }
.msg-zcard-thumb { display: block; line-height: 0; background: var(--bg-app); }
.msg-zcard-thumb img { display: block; width: 100%; height: auto; max-height: 180px; object-fit: cover; }
/* Thẻ chuyển khoản: ảnh QR vuông, đủ rõ để quét */
.msg-zcard.is-bank .msg-zcard-thumb { align-self: center; margin: 12px 12px 0; border-radius: 6px; overflow: hidden; background: #fff; }
.msg-zcard.is-bank .msg-zcard-thumb img { width: 160px; height: 160px; max-height: none; object-fit: contain; }
/* Danh thiếp: ảnh đại diện tròn nhỏ (không kéo giãn thành ảnh bìa) */
.msg-zcard.is-contact .msg-zcard-thumb { align-self: flex-start; margin: 12px 12px 0; border-radius: 50%; overflow: hidden; }
.msg-zcard.is-contact .msg-zcard-thumb img { width: 56px; height: 56px; max-height: none; object-fit: cover; }
.msg-zcard-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 10px 12px; }
.msg-zcard-kind { display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 16px; color: var(--text-sub); }
.msg-zcard-kind .ph { flex-shrink: 0; font-size: 15px; color: var(--primary); }
.msg-zcard-title {
  font-size: 14px; font-weight: 600; line-height: 20px; color: var(--text-main); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* Thẻ chỉ có tiêu đề (thông báo dài, không mô tả): hiện đủ (tiêu đề ≤ 200 ký tự ≈ 6 dòng) */
.msg-zcard-title.is-solo { -webkit-line-clamp: 8; }
a.msg-zcard-title { color: var(--primary); text-decoration: none; }
a.msg-zcard-title:hover { text-decoration: underline; }
.msg-zcard-desc {
  font-size: 13px; line-height: 18px; color: var(--text-sub); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.msg-zcard-bank { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; margin: 2px 0 0; font-size: 13px; line-height: 24px; }
.msg-zcard-bank dt { color: var(--text-sub); white-space: nowrap; }
.msg-zcard-bank dd { display: flex; align-items: center; gap: 2px; min-width: 0; margin: 0; color: var(--text-main); overflow-wrap: anywhere; }
.msg-zcard-bank b { font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 0.2px; }
.msg-zcard-copy {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 24px; height: 24px; padding: 0;
  border: none; border-radius: 50%; background: transparent; color: var(--text-sub); font-size: 15px; cursor: pointer;
}
.msg-zcard-copy:hover { color: var(--primary); background: var(--fx-hover); }
.msg-zcard-copy:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.msg-zcard-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.msg-zcard-btns a, .msg-zcard-btns span {
  max-width: 100%; padding: 2px 10px; border: 1px solid var(--border-color); border-radius: 14px; font-size: 13px; line-height: 20px;
  color: var(--primary); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.msg-zcard-btns a:hover { border-color: var(--primary); background: var(--primary-light); }
/* Nút chỉ mở được trong app Zalo (không có đường dẫn): viền đứt, không nền, con trỏ thường — khác nút bấm được */
.msg-zcard-btns .is-static { color: var(--text-sub); border-style: dashed; background: transparent; cursor: default; }
.msg-zcard-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; line-height: 20px; color: var(--primary); text-decoration: none; }
.msg-zcard-link:hover { text-decoration: underline; }
.msg-zcard a:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

/* Danh thiếp Zalo chuẩn màu xanh Hoàng Gia (.msg-zcard.is-contact):
   - Nền xanh Hoàng Gia (linear-gradient #1b68ff → #0050d8) + 2 khối bo góc chéo mờ ở góc dưới phải (y hệt Zalo thật)
   - Phần trên: Avatar tròn 48x48 viền trắng 2px + Tên đậm trắng 16px + SĐT trắng định dạng "093 207 3222" (có nút copy) + QR góc phải
   - Phần dưới: 2 nút thao tác nhanh "Gọi điện / Kết bạn" | "Nhắn tin" + "Thêm vào nhóm" */
.message-row .msg-bubble-box > .msg-bubble.is-contact-card-bubble {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}
.message-row .msg-bubble.is-contact-card-bubble > .msg-time {
  margin-top: 4px;
  padding: 0 4px;
  font-size: 11.5px;
  color: #72808e;
}
.message-row.outbound .msg-bubble.is-contact-card-bubble > .msg-time {
  text-align: right;
}
.msg-zcard.is-contact,
.message-row.outbound .msg-zcard.is-contact {
  width: 288px;
  max-width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 65, 178, 0.18), 0 0 0 1px rgba(0, 82, 217, 0.12);
}
.zcard-contact-top {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 112px;
  padding: 16px 16px 22px;
  background: linear-gradient(135deg, #1b68ff 0%, #0050d8 100%);
  color: #ffffff;
}
.zcard-contact-top::before {
  content: "";
  position: absolute;
  right: 26px;
  bottom: -42px;
  width: 132px;
  height: 96px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.09);
  transform: rotate(-32deg);
  pointer-events: none;
}
.zcard-contact-top::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -24px;
  width: 124px;
  height: 96px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  transform: rotate(-32deg);
  pointer-events: none;
}
.zcard-contact-ava,
.zcard-contact-avatar {
  position: relative;
  z-index: 1;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #ffffff;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 20, 60, 0.22);
}
.zcard-contact-info {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 2px;
}
.zcard-contact-title,
.zcard-contact-name,
.message-row.outbound .msg-bubble .zcard-contact-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 22px;
  color: #ffffff !important;
  letter-spacing: -0.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.zcard-contact-phone,
.message-row.outbound .msg-bubble .zcard-contact-phone,
.message-row.outbound .msg-bubble .zcard-contact-phone span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: rgba(255, 255, 255, 0.95) !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.25px;
}
.zcard-contact-desc,
.zcard-contact-sub,
.zcard-contact-badge,
.message-row.outbound .msg-bubble .zcard-contact-desc,
.message-row.outbound .msg-bubble .zcard-contact-sub {
  font-size: 13px;
  line-height: 18px;
  color: rgba(255, 255, 255, 0.85) !important;
}
.zcard-contact-top .msg-zcard-copy {
  width: 22px;
  height: 22px;
  color: rgba(255, 255, 255, 0.85) !important;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  font-size: 13px;
}
.zcard-contact-top .msg-zcard-copy:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.26);
}
.zcard-contact-qr {
  position: relative;
  z-index: 1;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff !important;
  font-size: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
}
.zcard-contact-qr:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: scale(1.05);
}
.zcard-contact-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
}
.zcard-cbtn,
.zcard-contact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  border: none;
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
  color: #081c36;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.zcard-cbtn + .zcard-cbtn,
.zcard-contact-btn + .zcard-contact-btn {
  border-left: 1px solid #e2e8f0;
}
.zcard-cbtn.is-primary,
.zcard-contact-btn.is-primary,
.message-row.outbound .msg-bubble .zcard-cbtn.is-primary span {
  color: #0068ff !important;
}
.zcard-cbtn:hover,
.zcard-contact-btn:hover {
  background: #f1f5f9;
  color: #0068ff;
}
.zcard-contact-addgrp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 34px;
  border: none;
  border-top: 1px dashed #cbd5e1;
  background: #f8fafc;
  color: #0068ff !important;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.zcard-contact-addgrp:hover { background: #eff6ff; }

/* Thanh gợi ý Gửi Danh Thiếp Zalo chuẩn màu xanh Hoàng Gia ngay trên ô nhập khi gõ số điện thoại */
.fx-draft-zcard-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: linear-gradient(90deg, #f0f7ff 0%, #e6f0ff 100%);
  border-bottom: 1px solid #bfdbfe;
  animation: fx-pop-in 0.14s ease-out;
}
.fx-draft-zcard-preview {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 210px;
  max-width: 280px;
  padding: 8px 14px 8px 10px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1b68ff 0%, #0050d8 100%);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(0, 82, 217, 0.24);
}
.fx-draft-zcard-preview::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: -20px;
  width: 72px;
  height: 56px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.11);
  transform: rotate(-32deg);
  pointer-events: none;
}
.fx-draft-zcard-ava {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #ffffff;
  background: #ffffff;
}
.fx-draft-zcard-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  position: relative;
  z-index: 1;
}
.fx-draft-zcard-name {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 18px;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fx-draft-zcard-phone {
  font-size: 12.5px;
  line-height: 16px;
  color: rgba(255, 255, 255, 0.94);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
}
.fx-draft-zcard-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
.fx-draft-zcard-hint {
  font-size: 12px;
  color: #1e40af;
  font-weight: 500;
}
@media (max-width: 768px) {
  .fx-draft-zcard-hint { display: none; }
}
.fx-draft-zcard-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: none;
  border-radius: 8px;
  background: #0068ff;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 104, 255, 0.25);
  transition: background 0.15s;
}
.fx-draft-zcard-btn:hover:not(:disabled) {
  background: #0052d9;
}
.fx-draft-zcard-btn:disabled {
  opacity: 0.65;
  cursor: progress;
}
.fx-draft-zcard-close {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.fx-draft-zcard-close:hover {
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
}

/* Thanh công cụ soạn tin Zalo (9 icon chuẩn Zalo PC/Web) */
.fx-zcap-btn .fx-zcap-icon {
  display: inline-flex; align-items: center; justify-content: center; position: relative;
  width: 19px; height: 19px; border: 1.5px dashed currentColor; border-radius: 4px;
  font-size: 11px; font-weight: 700; line-height: 1; font-family: system-ui, sans-serif;
}
.fx-zcap-btn .fx-zcap-icon small {
  position: absolute; right: -4px; bottom: -4px; font-size: 10px; font-weight: 800;
  background: var(--bg-card); line-height: 1; padding: 0 1px; border-radius: 2px;
}
.fx-rtf-bar {
  display: flex; align-items: center; gap: 4px; padding: 4px 12px;
  border-bottom: 1px solid var(--border-color); background: var(--bg-app);
}
.fx-rtf-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border: none; border-radius: 6px;
  background: transparent; color: var(--text-sub); font-size: 16px; cursor: pointer;
}
.fx-rtf-btn:hover { background: var(--fx-hover); color: var(--text-main); }
.fx-priority-bar {
  display: flex; align-items: center; gap: 6px; padding: 4px 12px;
  font-size: 12.5px; font-weight: 600; border-bottom: 1px solid var(--border-color);
}
.fx-priority-bar.is-important { background: #fffbeb; color: #b45309; }
.fx-priority-bar.is-urgent { background: #fef2f2; color: #dc2626; }
.fx-priority-bar button {
  margin-left: auto; border: none; background: transparent; color: inherit;
  cursor: pointer; padding: 2px; display: inline-flex; border-radius: 4px;
}
.fx-composer-more-pop {
  position: absolute; bottom: calc(100% + 6px); left: 0; width: max-content; min-width: 215px; z-index: 60;
  padding: 5px; border-radius: 10px; background: var(--bg-card);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16), 0 0 0 1px var(--border-color);
}
.fx-composer-more-pop .fx-pop-item {
  height: 32px; padding: 0 10px; gap: 8px; font-size: 12.5px; white-space: nowrap;
}
.fx-composer-more-pop .fx-pop-item .ph {
  font-size: 16px; flex-shrink: 0;
}
.fx-composer-more-pop .fx-pop-item.on {
  background: var(--primary-light); color: var(--primary); font-weight: 500;
}
.fx-pop-sep { height: 1px; margin: 4px 6px; background: var(--border-color); }

/* Modal Gửi Danh Thiếp chuẩn Zalo (.zcc-*) & Công cụ cắt vùng chụp màn hình (.zsc-*) */
.zcc-modal {
  width: 480px; max-width: calc(100vw - 24px); padding: 0; border-radius: 10px;
  background: #ffffff; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.22);
}
.zcc-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid #e5e7eb;
}
.zcc-title { margin: 0; font-size: 16px; font-weight: 700; color: #081c36; line-height: 22px; }
.zcc-close {
  width: 30px; height: 30px; border: none; border-radius: 6px; background: transparent;
  color: #475569; font-size: 18px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.zcc-close:hover { background: #f1f5f9; color: #0f172a; }
.zcc-top { padding: 14px 18px 8px; border-bottom: 1px solid #f1f5f9; }
.zcc-search-pill {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px;
  border-radius: 999px; border: 1px solid #d0d7de; background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.zcc-search-pill:focus-within { border-color: #0068ff; box-shadow: 0 0 0 2px rgba(0, 104, 255, 0.12); }
.zcc-search-pill > i { font-size: 16px; color: #64748b; flex-shrink: 0; }
.zcc-search-pill input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font-size: 14px; color: #081c36;
}
.zcc-search-pill input::placeholder { color: #94a3b8; }
.zcc-search-clear {
  border: none; background: transparent; color: #94a3b8; font-size: 16px;
  padding: 2px; cursor: pointer; display: inline-flex;
}
.zcc-find-phone-btn {
  height: 26px; padding: 0 10px; border-radius: 999px; border: none;
  background: #0068ff; color: #fff; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.zcc-cats-wrap {
  position: relative; display: flex; align-items: center; margin-top: 12px;
}
.zcc-cats {
  display: flex; align-items: center; gap: 8px; overflow-x: auto;
  scrollbar-width: none; -ms-overflow-style: none; padding-right: 34px; width: 100%;
}
.zcc-cats::-webkit-scrollbar { display: none; }
.zcc-cat-pill {
  height: 28px; padding: 0 14px; border-radius: 999px; border: none;
  background: #eaedf0; color: #081c36; font-size: 13px; font-weight: 500;
  white-space: nowrap; cursor: pointer; flex-shrink: 0; transition: background 0.15s, color 0.15s;
}
.zcc-cat-pill:hover { background: #dfe3e8; }
.zcc-cat-pill.active { background: #0068ff; color: #ffffff; font-weight: 600; }
.zcc-cats-next {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 50%; border: 1px solid #e2e8f0;
  background: #ffffff; color: #334155; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: -6px 0 10px rgba(255, 255, 255, 0.95), 0 1px 4px rgba(15, 23, 42, 0.1);
}
.zcc-cats-next:hover { color: #0068ff; border-color: #cbd5e1; }
.zcc-list-body {
  height: 390px; max-height: 56vh; overflow-y: auto; padding: 4px 18px 12px;
}
.zcc-empty {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 180px; color: #64748b; font-size: 13.5px; text-align: center;
}
.zcc-group-letter {
  font-size: 14px; font-weight: 600; color: #081c36; padding: 12px 2px 6px;
}
.zcc-item {
  display: flex; align-items: center; gap: 12px; padding: 7px 6px;
  border-radius: 8px; cursor: pointer; user-select: none; transition: background 0.12s;
}
.zcc-item:hover { background: #f3f5f6; }
.zcc-item.is-selected { background: #edf5ff; }
.zcc-radio {
  width: 19px; height: 19px; border-radius: 50%; border: 1.5px solid #c5ccd6;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: #fff; color: #fff; font-size: 12px; transition: all 0.12s;
}
.zcc-radio.checked { background: #0068ff; border-color: #0068ff; }
.zcc-ava {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  background: #f1f5f9;
}
.zcc-item-name {
  flex: 1; min-width: 0; font-size: 14px; font-weight: 500; color: #081c36;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.zcc-item-phone {
  margin-left: 6px; font-size: 13px; font-weight: 400; color: #64748b;
  font-variant-numeric: tabular-nums;
}
.zcc-preview-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 18px; border-top: 1px solid #e2e8f0; background: #f8fafc;
}
.zcc-blue-card-preview {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: 10px;
  min-width: 210px; max-width: 250px; padding: 9px 14px 9px 10px;
  border-radius: 10px; background: linear-gradient(135deg, #1b68ff 0%, #0050d8 100%);
  color: #ffffff; box-shadow: 0 3px 10px rgba(0, 82, 217, 0.22);
}
.zcc-blue-card-preview::after {
  content: ""; position: absolute; right: -16px; bottom: -18px;
  width: 68px; height: 52px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.11); transform: rotate(-32deg); pointer-events: none;
}
.zcc-blue-ava {
  width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  border: 2px solid #ffffff; background: #ffffff;
}
.zcc-blue-meta {
  min-width: 0; display: flex; flex-direction: column; gap: 1px; position: relative; z-index: 1;
}
.zcc-blue-name {
  font-size: 13.5px; font-weight: 700; line-height: 18px; color: #ffffff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.zcc-blue-phone {
  font-size: 12.5px; line-height: 16px; color: rgba(255, 255, 255, 0.94);
  font-variant-numeric: tabular-nums; letter-spacing: 0.2px;
}
.zcc-blue-more {
  margin-left: auto; padding: 2px 7px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.22); color: #ffffff; font-size: 11.5px; font-weight: 700;
}
.zcc-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 12px 18px; border-top: 1px solid #e5e7eb; background: #fff;
}
.zcc-btn-cancel {
  height: 38px; padding: 0 20px; border-radius: 6px; border: none;
  background: #eaedf0; color: #081c36; font-size: 14px; font-weight: 600; cursor: pointer;
}
.zcc-btn-cancel:hover { background: #dfe3e8; }
.zcc-btn-submit {
  height: 38px; padding: 0 20px; border-radius: 6px; border: none;
  background: #0068ff; color: #ffffff; font-size: 14px; font-weight: 600; cursor: pointer;
}
.zcc-btn-submit:hover:not(:disabled) { background: #0057d6; }
.zcc-btn-submit:disabled { background: #b3d4ff; color: #ffffff; cursor: not-allowed; }
.zcc-phone-chk {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; color: #334155; cursor: pointer;
}

/* Công cụ kéo chọn vùng chụp màn hình & vẽ chú thích chuẩn Zalo [Z+] (.zsc-*) */
.zsc-overlay {
  position: fixed; inset: 0; z-index: 99999; background: rgba(15, 23, 42, 0.9);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  user-select: none; outline: none;
}
.zsc-top-hint {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 5;
  padding: 6px 16px; border-radius: 999px; background: rgba(15, 23, 42, 0.85);
  color: #f8fafc; font-size: 13px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  pointer-events: none; white-space: nowrap;
}
.zsc-stage-wrap {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 100vw; height: 100vh; padding: 52px 24px 64px; cursor: crosshair; overflow: hidden;
}
.zsc-stage {
  position: relative; display: inline-block; max-width: 100%; max-height: 100%;
  line-height: 0; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.zsc-img {
  display: block; max-width: calc(100vw - 48px); max-height: calc(100vh - 116px);
  width: auto; height: auto; object-fit: contain; pointer-events: none;
}
.zsc-draw-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2;
}
.zsc-crop-box {
  position: absolute; z-index: 3; border: 2px solid #0068ff;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.56); cursor: move;
}
.zsc-crop-box.is-drawing { cursor: crosshair; }
.zsc-dim-badge {
  position: absolute; top: -26px; left: 0; padding: 2px 8px; border-radius: 4px;
  background: rgba(15, 23, 42, 0.85); color: #fff; font-size: 11.5px; line-height: 18px;
  font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none;
}
.zsc-handle {
  position: absolute; width: 10px; height: 10px; border-radius: 2px;
  background: #ffffff; border: 2px solid #0068ff; z-index: 4;
}
.zsc-handle.tl { top: -6px; left: -6px; cursor: nwse-resize; }
.zsc-handle.tr { top: -6px; right: -6px; cursor: nesw-resize; }
.zsc-handle.bl { bottom: -6px; left: -6px; cursor: nesw-resize; }
.zsc-handle.br { bottom: -6px; right: -6px; cursor: nwse-resize; }
.zsc-handle.tm { top: -6px; left: calc(50% - 5px); cursor: ns-resize; }
.zsc-handle.bm { bottom: -6px; left: calc(50% - 5px); cursor: ns-resize; }
.zsc-handle.ml { left: -6px; top: calc(50% - 5px); cursor: ew-resize; }
.zsc-handle.mr { right: -6px; top: calc(50% - 5px); cursor: ew-resize; }
.zsc-toolbar {
  position: absolute; z-index: 6; display: flex; align-items: center; gap: 4px;
  padding: 5px 8px; border-radius: 8px; background: #1e293b; color: #f8fafc;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); white-space: nowrap; cursor: default;
}
.zsc-tool-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  height: 30px; min-width: 30px; padding: 0 6px; border: none; border-radius: 6px;
  background: transparent; color: #e2e8f0; font-size: 16px; cursor: pointer;
}
.zsc-tool-btn.zsc-text-btn { font-size: 12.5px; font-weight: 600; padding: 0 8px; }
.zsc-tool-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.12); color: #fff; }
.zsc-tool-btn.on { background: #0068ff; color: #fff; }
.zsc-tool-btn.danger { color: #f87171; }
.zsc-tool-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.zsc-colors { display: inline-flex; align-items: center; gap: 5px; padding: 0 6px; }
.zsc-color-dot {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.5);
  cursor: pointer; padding: 0;
}
.zsc-color-dot.on { border-color: #fff; transform: scale(1.2); }
.zsc-sep { width: 1px; height: 20px; background: rgba(255, 255, 255, 0.18); margin: 0 3px; }
.zsc-btn-attach, .zsc-btn-send {
  display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 11px;
  border: none; border-radius: 6px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.zsc-btn-attach { background: #334155; color: #fff; }
.zsc-btn-attach:hover { background: #475569; }
.zsc-btn-send { background: #0068ff; color: #fff; }
.zsc-btn-send:hover { background: #0057d6; }
.zcc-modal, .zbc-modal { width: 480px; max-width: calc(100vw - 24px); }
.zcc-phone-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; margin-bottom: 10px; border-radius: 8px;
  background: var(--bg-app); font-size: 13px; font-weight: 500; cursor: pointer;
}
.zcc-search-row { display: flex; gap: 8px; margin-bottom: 10px; }
.zcc-search-row .fx-search { flex: 1; }
.zcc-manual-box {
  padding: 10px 12px; margin-bottom: 10px; border-radius: 8px;
  border: 1px dashed var(--border-color); background: var(--bg-app);
}
.zcc-list { max-height: 300px; overflow-y: auto; border: 1px solid var(--border-color); border-radius: 8px; }
.zcc-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer;
  border-bottom: 1px solid var(--border-color); transition: background 0.12s;
}
.zcc-row:last-child { border-bottom: none; }
.zcc-row:hover { background: var(--fx-hover); }
.zcc-row.is-on { background: var(--primary-light); }
.zcc-check {
  width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid var(--border-color);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  color: #fff; font-size: 12px;
}
.zcc-row.is-on .zcc-check { background: var(--primary); border-color: var(--primary); }
.zcc-av {
  width: 36px; height: 36px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-app); color: var(--primary); font-weight: 600; font-size: 14px;
}
.zcc-av img { width: 100%; height: 100%; object-fit: cover; }
.zcc-info { flex: 1; min-width: 0; }
.zcc-name { font-size: 13.5px; font-weight: 600; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zcc-sub { font-size: 12px; color: var(--text-sub); }
.zbc-saved-list { display: flex; flex-direction: column; gap: 6px; max-height: 150px; overflow-y: auto; }
.zbc-saved-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border-color); cursor: pointer;
}
.zbc-saved-item.is-on { border-color: var(--primary); background: var(--primary-light); }
.zbc-preview {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-top: 10px;
  border-radius: 8px; background: var(--bg-app); border: 1px solid var(--border-color);
}
.zbc-preview img { width: 72px; height: 72px; border-radius: 6px; object-fit: contain; background: #fff; }

/* ---------------------------------------------------------------- 13. CHUYỂN TIẾP TIN (.msg-fwd-*)
   Modal Chuyển tiếp (MsgForwardModal.js): khung + danh sách chọn của modal Tạo nhóm (.zc-modal, .zc-pick-*), trích
   tin của modal Xoá (.msg-del-quote). Mỗi hội thoại: tên · kênh (ô chữ cái + tên kênh, 1 dòng) · lý do không chọn
   được (kênh chưa kết nối) / máy chủ từ chối (đỏ, nền hồng nhạt). Đã chọn đủ 10 → các dòng còn lại mờ.
   Dải lỗi (.msg-fwd-err) nằm ngoài thân cuộn, ngay trên chân modal → luôn thấy dù danh sách đã cuộn; khung xếp dọc
   có trần chiều cao để thân modal tự co lại khi dải lỗi hiện.
   Màn nhỏ: foxia-mobile.css (mục "CHUYỂN TIẾP TIN"). */
.msg-fwd-modal { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
.msg-fwd-modal > .modal-body { flex: 1 1 auto; min-height: 0; }
.msg-fwd-modal > .modal-header, .msg-fwd-modal > .fx-modal-foot, .msg-fwd-modal > .msg-fwd-err { flex: 0 0 auto; }
.msg-fwd-modal:focus { outline: none; }
.msg-fwd-ch { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-fwd-ch .fx-ch-ico.xs { margin-right: 6px; vertical-align: -3px; }
.msg-fwd-why { display: flex; align-items: flex-start; gap: 4px; line-height: 18px; }
.msg-fwd-why .ph { flex-shrink: 0; margin-top: 2px; font-size: 14px; }
.msg-fwd-why.is-err { color: #b42318; }
.zc-pick-row.msg-fwd-row.off { cursor: not-allowed; }
.zc-pick-row.msg-fwd-row.off:hover { background: transparent; }
.zc-pick-row.msg-fwd-row.off input[type="checkbox"] { cursor: not-allowed; }
.zc-pick-row.msg-fwd-row.off .zc-av,
.zc-pick-row.msg-fwd-row.off .zc-main > b,
.zc-pick-row.msg-fwd-row.off .msg-fwd-ch { opacity: 0.55; }
.zc-pick-row.msg-fwd-row.is-err { background: #fef3f2; }
.zc-chips .fx-chip.msg-fwd-chip-err { color: #b42318; box-shadow: inset 0 0 0 1px #fda29b; }
.msg-fwd-err { align-items: flex-start; max-height: 30vh; overflow-y: auto; margin: 0 24px 8px; padding: 8px 12px; border-radius: 8px; background: #fef3f2; }
.msg-fwd-err > .ph { margin-top: 1px; }
.msg-fwd-err > .btn { margin-top: -4px; margin-bottom: -4px; color: #b42318; font-weight: 600; }

/* ---------------------------------------------------------------- 14. THẺ TỆP & XEM TRƯỚC TỆP (.msg-file-card, .file-preview-modal) */
.msg-file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
  max-width: 380px;
  min-width: 250px;
  transition: all 0.2s ease;
  box-sizing: border-box;
}
.msg-row.outbound .msg-file-card {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}
.msg-file-card:hover {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}
.msg-file-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
/* Màu sắc icon theo loại tệp */
.msg-file-card.is-pdf .msg-file-icon { background: rgba(229, 57, 53, 0.12); color: #e53935; }
.msg-file-card.is-doc .msg-file-icon, .msg-file-card.is-docx .msg-file-icon { background: rgba(30, 136, 229, 0.12); color: #1e88e5; }
.msg-file-card.is-xls .msg-file-icon, .msg-file-card.is-xlsx .msg-file-icon, .msg-file-card.is-csv .msg-file-icon { background: rgba(46, 125, 50, 0.12); color: #2e7d32; }
.msg-file-card.is-zip .msg-file-icon, .msg-file-card.is-rar .msg-file-icon, .msg-file-card.is-7z .msg-file-icon { background: rgba(245, 124, 0, 0.12); color: #f57c00; }
.msg-file-card.is-file .msg-file-icon { background: rgba(100, 116, 139, 0.12); color: #64748b; }

.msg-file-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.msg-file-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg-file-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  opacity: 0.75;
}
.msg-file-ext {
  font-weight: 700;
  letter-spacing: 0.5px;
}
.msg-file-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.msg-file-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  line-height: 1.2;
}
.msg-file-btn.is-preview {
  background: var(--primary, #0068ff);
  color: #fff;
}
.msg-file-btn.is-preview:hover {
  filter: brightness(1.1);
}
.msg-file-btn.is-dl {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-color, #1e293b);
  border-color: rgba(0, 0, 0, 0.1);
}
.msg-row.outbound .msg-file-btn.is-dl {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}
.msg-file-btn.is-dl:hover {
  background: rgba(0, 0, 0, 0.12);
}
.msg-row.outbound .msg-file-btn.is-dl:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Modal xem trước tệp */
.file-preview-modal {
  width: 90vw !important;
  max-width: 1000px !important;
  height: 85vh !important;
  max-height: 90vh !important;
  display: flex;
  flex-direction: column;
  border-radius: 16px !important;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25) !important;
}
.fpm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.fpm-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.fpm-ext-badge {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.fpm-ext-badge.is-pdf { background: #fee2e2; color: #dc2626; }
.fpm-ext-badge.is-doc, .fpm-ext-badge.is-docx { background: #e0f2fe; color: #0284c7; }
.fpm-ext-badge.is-xls, .fpm-ext-badge.is-xlsx, .fpm-ext-badge.is-csv { background: #dcfce7; color: #16a34a; }
.fpm-ext-badge.is-zip, .fpm-ext-badge.is-rar { background: #ffedd5; color: #ea580c; }
.fpm-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.fpm-filename {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fpm-filesize {
  font-size: 11px;
  color: #64748b;
}
.fpm-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.fpm-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 8px;
}
.fpm-body {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  background: #f1f5f9;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.fpm-pdf-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}
.fpm-mobile-pdf-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #eff6ff;
  border-bottom: 1px solid #bfdbfe;
  flex-shrink: 0;
  gap: 8px;
}
.fpm-mobile-pdf-hint {
  font-size: 13px;
  font-weight: 500;
  color: #1e40af;
  display: flex;
  align-items: center;
  gap: 6px;
}
.fpm-mobile-pdf-btn {
  white-space: nowrap;
  flex-shrink: 0;
}
.fpm-pdf-frame {
  width: 100%;
  height: 100%;
  flex: 1 1 auto;
  border: none;
  background: #525659;
}

/* 1. Trình xem Excel / Bảng tính */
.fpm-excel-viewer {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  background: #fff;
}
.fpm-excel-table-wrap {
  flex: 1 1 auto;
  overflow: auto;
  min-height: 0;
  padding: 4px 6px;
}
.fpm-excel-table-wrap table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 13px;
  color: #1e293b;
}
.fpm-excel-table-wrap th,
.fpm-excel-table-wrap td {
  border: 1px solid #cbd5e1;
  padding: 5px 8px;
  white-space: nowrap;
  min-width: 50px;
  height: 24px;
  box-sizing: border-box;
}
.fpm-excel-table-wrap tr:first-child td,
.fpm-excel-table-wrap th {
  background: #f1f5f9;
  font-weight: 600;
  color: #334155;
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: inset 0 -1px 0 #94a3b8;
}
.fpm-excel-table-wrap tr:nth-child(even) td {
  background: #fafafa;
}
.fpm-excel-table-wrap tr:hover td {
  background: #f0f7ff;
}
.fpm-excel-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 10px 0;
  background: #e2e8f0;
  border-top: 1px solid #cbd5e1;
  overflow-x: auto;
  flex-shrink: 0;
}
.fpm-sheet-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.fpm-sheet-tab:hover {
  background: #fff;
  color: #0f172a;
}
.fpm-sheet-tab.active {
  background: #fff;
  color: #16a34a;
  font-weight: 700;
  box-shadow: 0 -2px 0 #16a34a;
}

/* 2. Trình xem Word (.docx) */
.fpm-docx-viewer {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  padding: 24px 16px;
  background: #cbd5e1;
  display: flex;
  justify-content: center;
}
.fpm-docx-paper {
  background: #ffffff;
  max-width: 840px;
  width: 100%;
  min-height: 100%;
  padding: 44px 52px;
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
  color: #1e293b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14.5px;
  line-height: 1.65;
  box-sizing: border-box;
  overflow-wrap: break-word;
}
.fpm-docx-paper h1, .fpm-docx-paper h2, .fpm-docx-paper h3 {
  color: #0f172a;
  margin-top: 1.2em;
  margin-bottom: 0.5em;
  font-weight: 600;
}
.fpm-docx-paper p {
  margin-bottom: 0.85em;
}
.fpm-docx-paper table {
  border-collapse: collapse;
  width: 100%;
  margin: 16px 0;
}
.fpm-docx-paper table td, .fpm-docx-paper table th {
  border: 1px solid #94a3b8;
  padding: 6px 10px;
}
.fpm-docx-paper ul, .fpm-docx-paper ol {
  padding-left: 24px;
  margin-bottom: 12px;
}

/* 3. Trình xem Văn bản thuần (.txt, .json, .log) */
.fpm-text-viewer {
  flex: 1 1 auto;
  overflow: auto;
  min-height: 0;
  padding: 16px 20px;
  background: #ffffff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  color: #1e293b;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Trạng thái tải & lỗi */
.fpm-loading-state, .fpm-error-state {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
  background: #fff;
  gap: 12px;
}
.fpm-loading-spin {
  font-size: 36px;
  color: var(--primary, #0068ff);
  animation: fx-spin 1s linear infinite;
}

.fpm-doc-view {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.fpm-doc-card {
  background: #fff;
  border-radius: 16px;
  padding: 36px 32px;
  text-align: center;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}
.fpm-doc-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}
.fpm-doc-icon.is-doc, .fpm-doc-icon.is-docx { background: #e0f2fe; color: #0284c7; }
.fpm-doc-icon.is-xls, .fpm-doc-icon.is-xlsx, .fpm-doc-icon.is-csv { background: #dcfce7; color: #16a34a; }
.fpm-doc-name {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 8px;
  word-break: break-all;
}
.fpm-doc-hint {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 24px;
}
.fpm-doc-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fpm-big-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  text-decoration: none;
}

/* Responsive cho Modal Xem trước tệp trên điện thoại */
@media (max-width: 767px) {
  .modal-overlay > .modal-card.file-preview-modal {
    width: 100% !important;
    max-width: 100% !important;
    height: 94dvh !important;
    max-height: 94dvh !important;
    border-radius: 16px 16px 0 0 !important;
  }
  .fpm-header {
    padding: 10px 12px;
    gap: 8px;
  }
  .fpm-filename {
    max-width: 130px;
    font-size: 13px;
  }
  .fpm-actions {
    gap: 6px;
  }
  .fpm-action-btn {
    padding: 6px 10px;
    font-size: 12px;
  }
  .fpm-docx-viewer {
    padding: 12px 8px;
  }
  .fpm-docx-paper {
    padding: 18px 12px;
    font-size: 13.5px;
  }
  .fpm-excel-table-wrap {
    padding: 2px;
  }
}
@media (max-width: 480px) {
  .fpm-btn-label {
    display: none;
  }
  .fpm-action-btn {
    padding: 6px 8px;
  }
  .fpm-mobile-pdf-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 8px 10px;
  }
  .fpm-mobile-pdf-btn {
    text-align: center;
    justify-content: center;
  }
}

/* ---------------------------------------------------------------- 15. ĐƠN AI CHỜ XEM (.fx-oa*)
   OrderAlerts.js: AI chốt đơn → thẻ lớn góc phải TRÊN, ngay dưới header khung chat (68px) — góc phải dưới đã có softphone /
   toast tin đến / toast thường. Rộng 440px. z-index 895: DƯỚI nền mờ màn nhỏ (900), drawer / sheet (910), softphone, modal
   + drawer trang (1000), popover (1050) → lớp nào mở cũng phủ lên thẻ, thẻ không chặn thao tác nào khác.
   Không tự tắt, không nút ✕: chỉ tắt khi có người bấm "Xem hội thoại". Đầu thẻ (tên khách) + chân thẻ (số tiền, nút Xem)
   LUÔN thấy; cả cụm nằm gọn trong màn nhờ TRẦN CAO đặt cho từng phần theo chiều cao màn (--app-h): thân thẻ (SĐT, địa
   chỉ, món…) và khung đơn cũ (1 dòng / đơn, tối đa 3 + "Còn N đơn chờ xem") cuộn riêng — không dựa vào flex co (cỡ tối
   thiểu tự động của thẻ = cả nội dung nên thẻ không co). Viền cam nhấp nháy nhẹ (tắt khi hệ thống bật giảm chuyển động).
   .fx-oa-slim: thanh mảnh thay thẻ khi màn nhỏ đang bật bàn phím ảo (OrderAlerts.js — không che ô đang gõ).
   Màn nhỏ: foxia-mobile.css (mục "THẺ ĐƠN AI"). */
.fx-oa {
  position: fixed; top: 76px; right: 16px; z-index: 895; display: flex; flex-direction: column; gap: 8px;
  width: 440px; max-width: calc(100vw - 32px);
}
.fx-oa-card {
  display: flex; flex-direction: column; flex-shrink: 0; border: 2px solid #fb923c;
  border-radius: 12px; background: #fff; color: var(--text-main);
  box-shadow: 0 12px 32px -8px rgba(234, 88, 12, 0.35), var(--fx-pop-shadow);
  animation: fxOaIn 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), fxOaPulse 1.8s ease-in-out 0.3s infinite;
}
@keyframes fxOaIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}
@keyframes fxOaPulse {
  0%, 100% { border-color: #fb923c; box-shadow: 0 12px 32px -8px rgba(234, 88, 12, 0.35), 0 0 0 0 rgba(249, 115, 22, 0); }
  50% { border-color: #ea580c; box-shadow: 0 12px 32px -8px rgba(234, 88, 12, 0.35), 0 0 0 4px rgba(249, 115, 22, 0.22); }
}
.fx-oa-head {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0; padding: 10px 10px 10px 12px;
  border-radius: 10px 10px 0 0; background: #fff7ed; border-bottom: 1px solid #fed7aa;
}
.fx-oa-ico {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 36px; height: 36px;
  border-radius: 50%; background: #ffedd5; color: #ea580c; font-size: 20px;
}
.fx-oa-title { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
/* Dòng nhỏ "giờ · Đơn AI chờ duyệt" (1 dòng) trên tên khách (tối đa 2 dòng) */
.fx-oa-title small {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 500; line-height: 18px; color: #c2410c;
}
.fx-oa-title b {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
  font-size: 16px; font-weight: 600; line-height: 22px; color: var(--text-main);
}
.fx-oa-chime {
  display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; height: 30px; padding: 0 10px;
  border: 1px solid #fed7aa; border-radius: 15px; background: #fff; color: #9a3412; font-size: 12px; line-height: 1;
  white-space: nowrap; cursor: pointer;
}
.fx-oa-chime .ph { font-size: 15px; }
.fx-oa-chime:hover { background: #ffedd5; }
.fx-oa-chime.is-off { border-color: var(--border-color); color: var(--text-sub); }
/* Trần thân thẻ = 3/4 màn trừ ~350px (đầu thẻ ≤ 88 + chân thẻ ≤ 150 + lề trên 76 + khoảng cách); 1/4 màn còn lại cho
   khung đơn cũ → cụm thẻ không chạm đáy màn. Màn thấp: còn tối thiểu 56px, phần còn lại cuộn. */
.fx-oa-body {
  min-height: 56px; max-height: max(56px, calc(var(--app-h, 100vh) * 0.75 - 350px)); overflow-y: auto; overscroll-behavior: contain;
  padding: 10px 14px 12px;
}
.fx-oa-cust {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; margin: 0 0 10px; font-size: 13px; line-height: 20px;
}
.fx-oa-cust dt { color: var(--text-muted); white-space: nowrap; }
.fx-oa-cust dd { min-width: 0; margin: 0; color: var(--text-main); overflow-wrap: anywhere; }
.fx-oa-cust dd.is-none { color: var(--text-muted); font-style: italic; }
.fx-oa-items { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 18px; font-variant-numeric: tabular-nums; }
.fx-oa-items th {
  padding: 4px 0 4px 8px; border-bottom: 1px solid var(--border-light); color: var(--text-muted); font-size: 12px;
  font-weight: 500; text-align: right; white-space: nowrap;
}
.fx-oa-items td {
  padding: 6px 0 6px 8px; border-bottom: 1px dashed var(--border-light); color: var(--text-main); text-align: right;
  vertical-align: top; white-space: nowrap;
}
/* Cột tên món: sát trái, xuống dòng khi dài (cột số giữ 1 dòng) */
.fx-oa-items th:first-child, .fx-oa-items td:first-child { padding-left: 0; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.fx-oa-summary { margin: 0; font-size: 13px; line-height: 20px; color: var(--text-main); overflow-wrap: anywhere; }
.fx-oa-money {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; margin: 8px 0 0; font-size: 13px; line-height: 20px;
  font-variant-numeric: tabular-nums;
}
.fx-oa-money dt { color: var(--text-sub); text-align: right; }
.fx-oa-money dd { margin: 0; color: var(--text-main); font-weight: 500; text-align: right; }
.fx-oa-note {
  display: flex; gap: 6px; margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; background: #fffbeb; color: #92400e;
  font-size: 13px; line-height: 18px; overflow-wrap: anywhere;
}
.fx-oa-note .ph { flex-shrink: 0; margin-top: 1px; font-size: 15px; }
.fx-oa-foot {
  display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; padding: 10px 14px 12px; border-top: 1px solid var(--border-light);
  background: #fff;
}
/* Số tiền cần thu ở chân thẻ — luôn thấy cạnh nút Xem dù thân thẻ đang cuộn */
.fx-oa-total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.fx-oa-total span { color: var(--text-sub); font-size: 13px; }
.fx-oa-total b { color: #e11d48; font-size: 18px; font-weight: 700; line-height: 24px; }
.fx-oa-hint {
  display: flex; align-items: center; gap: 6px; margin: 0; padding: 6px 10px; border-radius: 8px; background: #fef3c7;
  color: #92400e; font-size: 13px; line-height: 18px;
}
.fx-oa-hint .ph { flex-shrink: 0; font-size: 16px; }
.fx-oa-view {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 46px; padding: 0 16px;
  border: 1px solid #16a34a; border-radius: 10px; background: #16a34a; color: #fff; font-size: 15px; font-weight: 600;
  line-height: 1; cursor: pointer;
}
.fx-oa-view .ph { font-size: 20px; }
.fx-oa-view:hover { border-color: #15803d; background: #15803d; }
/* Đơn cũ hơn: trần 1/4 màn → màn thấp còn 1–2 dòng (cuộn), chỗ còn lại dành cho thẻ chính */
.fx-oa-more {
  flex-shrink: 0; max-height: calc(var(--app-h, 100vh) * 0.25); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid #fed7aa; border-radius: 12px; background: #fff; box-shadow: var(--fx-pop-shadow);
}
.fx-oa-row {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 6px 10px 6px 12px; border: 0;
  background: #fff; color: var(--text-main); font-size: 13px; line-height: 18px; text-align: left; cursor: pointer;
}
.fx-oa-row + .fx-oa-row { border-top: 1px solid var(--border-light); }
.fx-oa-row:hover { background: #fff7ed; }
.fx-oa-row-time { flex-shrink: 0; color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.fx-oa-row-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-oa-row-text b { font-weight: 600; }
/* Số tiền tách khỏi phần chữ bị cắt "…" → tên món dài cũng không che mất tiền */
.fx-oa-row-amt { flex-shrink: 0; color: #e11d48; font-weight: 600; font-variant-numeric: tabular-nums; }
.fx-oa-row-go { display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0; color: #ea580c; font-weight: 600; }
.fx-oa-count {
  padding: 8px 12px; border-top: 1px solid var(--border-light); background: #fffaf5; color: var(--text-sub);
  font-size: 12px; line-height: 16px; text-align: center;
}
/* Thanh mảnh (bàn phím ảo đang bật): 1 dòng "Đơn AI · tên · tiền" + nút Xem, cùng viền cam nhấp nháy */
.fx-oa-slim {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 48px; padding: 4px 6px 4px 12px; border: 2px solid #fb923c;
  border-radius: 12px; background: #fff7ed; color: var(--text-main); font-size: 14px; line-height: 18px; text-align: left;
  cursor: pointer; animation: fxOaPulse 1.8s ease-in-out infinite;
}
.fx-oa-slim > .ph { flex-shrink: 0; color: #ea580c; font-size: 20px; }
.fx-oa-slim-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-oa-slim-text b { color: #c2410c; font-weight: 600; }
.fx-oa-slim-amt { flex-shrink: 0; color: #e11d48; font-weight: 600; font-variant-numeric: tabular-nums; }
.fx-oa-slim-go {
  display: inline-flex; align-items: center; flex-shrink: 0; height: 36px; padding: 0 14px; border-radius: 8px;
  background: #16a34a; color: #fff; font-weight: 600;
}
/* Nút "Thu gọn" (^) đầu thẻ + thanh đã thu gọn: thẻ lớn che panel khách / nút Duyệt ở trang Đơn hàng → thu thành 1 dòng
   như .fx-oa-slim (bấm thân thanh mở lại thẻ, nút Xem như thẻ). Thu gọn KHÔNG tắt: thanh vẫn nhấp nháy, chuông vẫn kêu. */
.fx-oa-fold {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 30px; height: 30px; padding: 0;
  border: 1px solid #fed7aa; border-radius: 50%; background: #fff; color: #9a3412; font-size: 16px; cursor: pointer;
}
.fx-oa-fold:hover { background: #ffedd5; }
.fx-oa-mini {
  display: flex; align-items: center; gap: 6px; width: 100%; min-height: 48px; padding: 4px 6px; border: 2px solid #fb923c;
  border-radius: 12px; background: #fff7ed; animation: fxOaPulse 1.8s ease-in-out infinite;
}
.fx-oa-mini-main {
  display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; height: 40px; padding: 0 6px; border: 0;
  border-radius: 8px; background: transparent; color: var(--text-main); font: inherit; font-size: 14px; line-height: 18px;
  text-align: left; cursor: pointer;
}
.fx-oa-mini-main:hover { background: #ffedd5; }
.fx-oa-mini-main > .ph:first-child { flex-shrink: 0; color: #ea580c; font-size: 20px; }
.fx-oa-mini-open { flex-shrink: 0; color: #9a3412; font-size: 14px; }
.fx-oa-mini .fx-oa-slim-go { border: 0; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.fx-oa-chime:focus-visible, .fx-oa-view:focus-visible, .fx-oa-slim:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.fx-oa-fold:focus-visible, .fx-oa-mini-main:focus-visible, .fx-oa-mini .fx-oa-slim-go:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* Dòng đơn cũ nằm trong khung cuộn (overflow cắt phần tràn) → viền focus vẽ vào trong để không bị cắt */
.fx-oa-row:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
/* Cửa sổ rất thấp: trần từng phần chưa đủ → cả cụm cuộn trong phần màn dưới header (bóng đổ bị cắt, chấp nhận) */
@media (max-height: 520px) {
  .fx-oa { max-height: calc(var(--app-h, 100vh) - 84px); overflow-y: auto; overscroll-behavior: contain; }
}
@media (prefers-reduced-motion: reduce) {
  .fx-oa-card, .fx-oa-slim, .fx-oa-mini { animation: none; }
}


/* =============================================================================
   ONBOARDING: Gợi ý kết nối tài khoản Zalo đầu tiên tại nút "+" (ChannelStrip & HomePage)
   Chỉ hiện khi chưa có bất kỳ tài khoản nào được kết nối.
   ============================================================================= */
@keyframes fxOnboardPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 104, 255, 0.48);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(0, 104, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 104, 255, 0);
  }
}
@keyframes fxOnboardFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(3px);
  }
}
.fx-chs-add.is-onboard-pulse {
  border: 2px solid #0068ff !important;
  background: #eef6ff !important;
  color: #0068ff !important;
  animation: fxOnboardPulse 1.8s ease-out infinite;
}
.fx-home-add-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
}
.fx-home-add-wrap > .fx-home-ch.add {
  width: 100%;
}
.fx-home-ch.add.is-onboard-pulse {
  border: 1.5px solid #0068ff;
  background: #f4f9ff;
  animation: fxOnboardPulse 1.8s ease-out infinite;
}
.fx-onboard-pop {
  position: absolute;
  z-index: 62;
  top: calc(100% + 10px);
  left: 6px;
  right: 6px;
  max-width: 316px;
  background: linear-gradient(180deg, #f4f9ff 0%, #ffffff 46%);
  border: 1.5px solid #0068ff;
  border-radius: 12px;
  box-shadow: 0 14px 32px rgba(0, 104, 255, 0.2), 0 4px 12px rgba(8, 28, 54, 0.1);
  padding: 12px 12px 11px;
  color: #081c36;
  animation: fxOnboardFloat 2.4s ease-in-out infinite;
}
.fx-onboard-pop.is-home {
  left: 0;
  right: 0;
  max-width: 340px;
}
.fx-onboard-arrow {
  position: absolute;
  top: -7px;
  left: calc(var(--ob-arrow-x, 70px) - 6px);
  width: 12px;
  height: 12px;
  background: #f4f9ff;
  border-top: 1.5px solid #0068ff;
  border-left: 1.5px solid #0068ff;
  transform: translateX(-50%) rotate(45deg);
  pointer-events: none;
}
.fx-onboard-pop.is-home .fx-onboard-arrow {
  left: 30px;
}
.fx-onboard-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.fx-onboard-close:hover {
  background: rgba(8, 28, 54, 0.06);
  color: #081c36;
}
.fx-onboard-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
}
.fx-onboard-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-right: 20px;
}
.fx-onboard-head .fx-ch-ico {
  width: 22px;
  height: 22px;
  font-size: 9px;
  border-radius: 6px;
  margin: 0;
}
.fx-onboard-head b {
  font-size: 13.5px;
  font-weight: 600;
  color: #081c36;
  line-height: 1.3;
}
.fx-onboard-desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: #334155;
}
.fx-onboard-desc b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e6f0ff;
  color: #0068ff;
  font-weight: 700;
  font-size: 12px;
  vertical-align: 0;
}
.fx-onboard-pop.is-home .fx-onboard-desc b {
  width: auto;
  height: auto;
  padding: 0 5px;
  border-radius: 4px;
}
.fx-onboard-cta {
  margin-top: 2px;
  height: 32px;
  padding: 0 12px;
  border: none;
  border-radius: 8px;
  background: #0068ff;
  color: #fff;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: background-color 0.15s;
}
.fx-onboard-cta:hover {
  background: #0056d6;
}
.fx-onboard-cta .ph {
  font-size: 15px;
}
.fx-onboard-menu-tag {
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 6px;
  background: #e6f0ff;
  color: #0068ff;
  font-size: 11px;
  font-weight: 600;
}
@media (max-width: 1023px) {
  .fx-livechat .conv-header .fx-onboard-pop {
    left: 16px;
    right: 16px;
    max-width: 320px;
  }
  .fx-livechat .conv-header .fx-onboard-arrow {
    left: calc(var(--ob-arrow-x, 70px) - 16px);
  }
}

/* =============================================================================
   STORE BADGES: Biểu tượng tải ứng dụng App Store & Google Play trên cột phải SigninPage
   ============================================================================= */
.vz-store-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.vz-store-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #081122;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(8, 17, 34, 0.06);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.vz-store-badge:hover {
  transform: translateY(-1px);
  border-color: #1665f5;
  box-shadow: 0 6px 16px rgba(22, 101, 245, 0.14);
}
.vz-store-ico {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.vz-store-txt {
  display: flex;
  flex-direction: column;
  line-height: 1.12;
  text-align: left;
}
.vz-store-txt small {
  font-size: 9.5px;
  font-weight: 500;
  color: #64748b;
  letter-spacing: 0.01em;
}
.vz-store-txt b {
  font-size: 13px;
  font-weight: 700;
  color: #081122;
  letter-spacing: -0.01em;
}
@media (max-width: 1023px) {
  .vz-store-badges {
    justify-content: center !important;
    width: 100%;
  }
}

/* Đặt tiêu đề "Nền tảng quản lý & CSKH đa kênh" trên cùng 1 dòng */
.vz-hero-title {
  white-space: nowrap;
  font-size: clamp(18px, 1.65vw, 25px) !important;
}
@media (max-width: 1023px) {
  .vz-hero-title {
    white-space: nowrap !important;
    font-size: clamp(16px, 4.6vw, 22px) !important;
  }
}

/* Tinh chỉnh kích thước tiêu đề lớn hơn và cụm kênh / tính năng nhỏ gọn hơn */
.vz-hero-content {
  flex: 1 1 58% !important;
  max-width: 640px !important;
}
.vz-hero-title {
  white-space: nowrap;
  font-size: clamp(22px, 1.95vw, 29px) !important;
}
.vz-channels {
  font-size: 11.5px !important;
  gap: 4px 6px !important;
  margin-top: 10px !important;
}
.vz-ch-icon {
  width: 15px !important;
  height: 15px !important;
}
.vz-sub-features {
  font-size: 12px !important;
  margin-top: 8px !important;
}
@media (max-width: 1023px) {
  .vz-hero-title {
    white-space: nowrap !important;
    font-size: clamp(18px, 5vw, 24px) !important;
  }
  .vz-channels {
    font-size: 11px !important;
  }
  .vz-sub-features {
    font-size: 11.5px !important;
  }
}

/* ==========================================================================
   MÔ HÌNH A: NHÃN NHÂN VIÊN GỬI TIN ĐI TRONG HỘI THOẠI & DANH SÁCH HỘI THOẠI
   ========================================================================== */
.message-row.outbound .msg-time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.msg-out-sender {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 7.6px !important;
  font-weight: 400 !important;
  font-style: italic !important;
  line-height: 11px !important;
  padding: 0px 4px;
  border-radius: 999px;
  max-width: 165px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: none;
  opacity: 0.58;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  transition: opacity 0.15s ease;
}
.msg-bubble-wrap:hover .msg-out-sender {
  opacity: 0.85;
}
.msg-out-sender .ph {
  font-size: 7.6px !important;
  flex-shrink: 0;
  font-style: normal;
}
.msg-out-sender > span {
  font-size: 7.6px !important;
  font-weight: 400 !important;
  font-style: italic !important;
  line-height: 11px !important;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Tin chỉ có ảnh (.is-media): góc ảnh chỉ giữ giờ gửi gọn gàng, nhãn người gửi nằm ở .msg-out-foot ngay dưới ảnh */
.msg-bubble.is-media .msg-out-sender {
  display: none !important;
}
.msg-out-foot {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 3px;
}
.msg-out-foot-time {
  font-size: 11px;
  line-height: 16px;
  color: #72808e;
}

/* Bảng màu phân biệt từng nhân viên / nguồn gửi (Phương án 2: nền siêu mảnh, không viền, chữ dịu) */
.msg-out-sender.is-staff-0,
.message-row.outbound .msg-bubble .msg-out-sender.is-staff-0,
.message-row.outbound .msg-bubble .msg-out-sender.is-staff-0 span {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb !important;
}
.msg-out-sender.is-staff-1,
.message-row.outbound .msg-bubble .msg-out-sender.is-staff-1,
.message-row.outbound .msg-bubble .msg-out-sender.is-staff-1 span {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d !important;
}
.msg-out-sender.is-staff-2,
.message-row.outbound .msg-bubble .msg-out-sender.is-staff-2,
.message-row.outbound .msg-bubble .msg-out-sender.is-staff-2 span {
  background: rgba(168, 85, 247, 0.12);
  color: #7e22ce !important;
}
.msg-out-sender.is-staff-3,
.message-row.outbound .msg-bubble .msg-out-sender.is-staff-3,
.message-row.outbound .msg-bubble .msg-out-sender.is-staff-3 span {
  background: rgba(245, 158, 11, 0.13);
  color: #b45309 !important;
}
.msg-out-sender.is-staff-4,
.message-row.outbound .msg-bubble .msg-out-sender.is-staff-4,
.message-row.outbound .msg-bubble .msg-out-sender.is-staff-4 span {
  background: rgba(244, 63, 94, 0.12);
  color: #be123c !important;
}
.msg-out-sender.is-staff-5,
.message-row.outbound .msg-bubble .msg-out-sender.is-staff-5,
.message-row.outbound .msg-bubble .msg-out-sender.is-staff-5 span {
  background: rgba(20, 184, 166, 0.12);
  color: #0f766e !important;
}
.msg-out-sender.is-device,
.message-row.outbound .msg-bubble .msg-out-sender.is-device,
.message-row.outbound .msg-bubble .msg-out-sender.is-device span {
  background: rgba(100, 116, 139, 0.12);
  color: #475569 !important;
}
.msg-out-sender.is-ai,
.message-row.outbound .msg-bubble .msg-out-sender.is-ai,
.message-row.outbound .msg-bubble .msg-out-sender.is-ai span {
  background: rgba(139, 92, 246, 0.12);
  color: #6d28d9 !important;
}

/* Tiền tố người gửi tin cuối ở Danh sách hội thoại (ConversationList.js) */
.conv-last-sender {
  font-weight: 600;
  margin-right: 4px;
}
.conv-last-sender.is-staff-0 { color: #1d4ed8; }
.conv-last-sender.is-staff-1 { color: #15803d; }
.conv-last-sender.is-staff-2 { color: #7e22ce; }
.conv-last-sender.is-staff-3 { color: #b45309; }
.conv-last-sender.is-staff-4 { color: #be123c; }
.conv-last-sender.is-staff-5 { color: #0f766e; }
.conv-last-sender.is-device { color: #475569; }
.conv-last-sender.is-ai { color: #7c3aed; }

/* ==========================================================================
   VIZIO SUPER ADMIN & CRM CSKH CONSOLE (admin.vizio.vn)
   ========================================================================== */
.v-admin-header-main {
  max-width: 1480px !important;
  padding: 10px 20px !important;
  flex-wrap: wrap !important;
  gap: 10px 14px !important;
}
.v-admin-brand {
  flex-shrink: 0 !important;
  gap: 11px !important;
}
.v-admin-brand-text {
  min-width: 0;
}
.v-admin-title-row {
  white-space: nowrap !important;
}
.v-admin-title {
  font-size: 16px !important;
  white-space: nowrap !important;
}
.v-badge-super {
  white-space: nowrap !important;
  font-size: 10.5px !important;
}
.v-admin-subtitle {
  white-space: nowrap !important;
  font-size: 11.5px !important;
}
.v-admin-header-actions {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 7px !important;
  flex-shrink: 0 !important;
}
.v-admin-header-actions .btn {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
}
.v-admin-user-pill {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}
.v-btn-cskh-staff {
  background: #f0f9ff !important;
  color: #0369a1 !important;
  border: 1px solid #7dd3fc !important;
  font-weight: 600 !important;
}
.v-btn-cskh-staff:hover {
  background: #e0f2fe !important;
  border-color: #38bdf8 !important;
}

.v-main-mode-switcher {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  flex-shrink: 0;
  white-space: nowrap;
}
.v-mode-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: #475569;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.v-mode-tab-btn:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.6);
}
.v-mode-tab-btn.active {
  background: #ffffff;
  color: #1d4ed8;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}
.v-mode-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.v-mode-badge-danger {
  background: #dc2626;
  color: #ffffff;
}
.v-mode-badge-blue {
  background: #dbeafe;
  color: #1d4ed8;
}

/* THANH QUẢN LÝ & TẠO TÀI KHOẢN NHÂN VIÊN CSKH VIZIO TRONG TAB CRM CSKH */
.v-cskh-staff-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  background: linear-gradient(90deg, #f0f9ff 0%, #f8fafc 100%);
  border: 1px solid #bae6fd;
  border-radius: 14px;
  padding: 12px 16px;
}
.v-cskh-staff-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.v-cskh-staff-bar-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #0284c7;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.v-cskh-staff-bar-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.v-cskh-staff-count-badge {
  font-size: 11px;
  font-weight: 600;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #7dd3fc;
  padding: 1px 8px;
  border-radius: 999px;
}
.v-cskh-staff-bar-sub {
  font-size: 12.5px;
  color: #475569;
  margin-top: 2px;
}
.v-cskh-staff-pills-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}
.v-cskh-staff-member-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.15s ease;
}
.v-cskh-staff-member-pill:hover {
  border-color: #0284c7;
  background: #f0f9ff;
}
.v-cskh-staff-member-pill.is-locked {
  opacity: 0.6;
}
.v-cskh-staff-member-pill code {
  font-size: 11px;
  color: #64748b;
}
.v-cskh-staff-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.v-cskh-staff-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.v-btn-create-cskh-staff {
  background: #0284c7 !important;
  color: #ffffff !important;
  border: 1px solid #0369a1 !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}
.v-btn-create-cskh-staff:hover {
  background: #0369a1 !important;
}

.v-cskh-cancel-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: linear-gradient(90deg, #fef2f2 0%, #fff1f2 100%);
  border: 1px solid #fca5a5;
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 14px;
  cursor: pointer;
  color: #991b1b;
}
.v-cskh-cancel-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.v-cskh-cancel-banner-icon {
  font-size: 22px;
}

.v-row-cancel-req {
  background: #fffafb !important;
}
.v-cancel-alert-box {
  margin-top: 8px;
  padding: 9px 12px;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.v-cancel-alert-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: #7f1d1d;
}
.v-cancel-alert-tag {
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
}
.v-cancel-alert-btns {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.v-btn-confirm-cancel {
  background: #dc2626 !important;
  color: #ffffff !important;
  border: 1px solid #b91c1c !important;
  font-weight: 600 !important;
}
.v-btn-confirm-cancel:hover {
  background: #b91c1c !important;
}
.v-btn-reject-cancel {
  background: #ffffff !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}

.v-cskh-mini-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid transparent;
}

.v-cskh-pipeline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.v-cskh-pipe-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 11px 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.v-cskh-pipe-card:hover {
  border-color: #93c5fd;
  transform: translateY(-1px);
}
.v-cskh-pipe-card.active {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14);
  background: #f8fafc;
}
.v-cskh-pipe-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.v-cskh-pipe-ico {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.v-cskh-pipe-val {
  font-size: 20px;
  font-weight: 600;
  color: #0f172a;
}
.v-cskh-pipe-lbl {
  font-size: 12px;
  color: #475569;
  font-weight: 500;
}

.v-cskh-phone-bar {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  flex-wrap: wrap;
}
.v-cskh-phone-num {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 6px;
}
.v-cskh-quick-ico-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 23px;
  padding: 0 7px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.v-cskh-quick-ico-btn.is-zalo {
  background: #eff6ff;
  color: #0068ff;
  border-color: #bfdbfe;
}
.v-cskh-quick-ico-btn.is-call {
  background: #ecfdf5;
  color: #059669;
  border-color: #a7f3d0;
}

.v-cskh-telemetry-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.v-cskh-tele-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.v-zalo-pill.v-zalo-warn {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}
.v-zalo-pill.v-zalo-full {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}
.v-cskh-tele-metrics {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: #334155;
}
.v-cskh-tele-last {
  font-size: 11px;
  color: #64748b;
}

.v-cskh-advice-card {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 11.5px;
  line-height: 1.38;
}
.v-cskh-advice-card.tone-warn {
  background: #fffbeb;
  border-color: #fde68a;
}
.v-cskh-advice-card.tone-hot {
  background: #fff1f2;
  border-color: #fecdd3;
}
.v-cskh-advice-card.tone-good {
  background: #ecfdf5;
  border-color: #a7f3d0;
}
.v-cskh-advice-card.tone-danger {
  background: #fef2f2;
  border-color: #fca5a5;
}
.v-cskh-advice-badge {
  font-size: 11px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 2px;
}
.v-cskh-advice-title {
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 2px;
}
.v-cskh-advice-desc {
  color: #475569;
  font-size: 11px;
}

.v-cskh-status-stack {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.v-cskh-stage-select {
  height: 29px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}
.v-cskh-assignee-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11.5px;
}
.v-cskh-assigned-tag {
  color: #0369a1;
  font-weight: 500;
}
.v-cskh-claim-btn {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px dashed #93c5fd;
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}
.v-cskh-followup-tag {
  background: #f5f3ff;
  color: #6d28d9;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 11px;
}
.v-cskh-followup-tag.is-overdue {
  background: #fef2f2;
  color: #dc2626;
  font-weight: 600;
}
.v-cskh-note-preview {
  font-size: 11.5px;
  color: #475569;
  background: #f8fafc;
  padding: 4px 7px;
  border-radius: 6px;
  border-left: 2px solid #94a3b8;
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.v-cskh-note-preview.is-cancel {
  background: #fef2f2;
  color: #b91c1c;
  border-left-color: #dc2626;
  white-space: normal;
}

.v-cskh-actions-col {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.v-btn-report-no-need {
  background: #fff1f2 !important;
  color: #be123c !important;
  border: 1px solid #fecdd3 !important;
  font-weight: 500 !important;
}
.v-btn-report-no-need:hover {
  background: #ffe4e6 !important;
  border-color: #fda4af !important;
}
.v-cskh-pending-cancel-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 500;
}
.v-cskh-undo-cancel-link {
  background: none;
  border: none;
  color: #2563eb;
  text-decoration: underline;
  font-size: 11px;
  cursor: pointer;
  padding: 0;
}



