:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --hover: #eef2f7;
  --border: #e3e8ef;
  --text: #17202e;
  --muted: #64708a;
  --accent: #1f6feb;
  --accent-soft: #e6efff;
  --accent-text: #ffffff;
  --bubble-in: #eef1f5;
  --bubble-out: #1f6feb;
  --bubble-out-text: #ffffff;
  --danger: #d1242f;
  --danger-soft: #fdecec;
  --warn: #9a6700;
  --warn-soft: #fff6dc;
  --ok: #1a7f37;
  --ok-soft: #e6f6ea;
  --shadow: 0 6px 24px rgba(16, 24, 40, 0.08);
  --radius: 12px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --surface: #151b23;
    --surface-2: #10161d;
    --hover: #1e2631;
    --border: #2a3340;
    --text: #e6edf3;
    --muted: #8b97a8;
    --accent: #4c8dff;
    --accent-soft: #16263f;
    --bubble-in: #222b37;
    --bubble-out: #2f6fe0;
    --danger: #ff6b6b;
    --danger-soft: #3a1d20;
    --warn: #e3b341;
    --warn-soft: #34290f;
    --ok: #3fb950;
    --ok-soft: #12301b;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); }
img { display: block; }
.boot { display: grid; place-items: center; height: 100%; color: var(--muted); }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface); border-radius: 8px;
  padding: 7px 12px; cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--text);
}
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--danger); }
.btn.small { padding: 4px 9px; font-size: 13px; }
.btn.icon { padding: 6px; border-color: transparent; background: transparent; }
.btn.icon:hover { background: var(--hover); }
.btn svg { width: 18px; height: 18px; flex: none; }

.avatar {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none;
  background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 600;
}
.avatar.sm { width: 22px; height: 22px; font-size: 11px; }
.avatar.lg { width: 64px; height: 64px; font-size: 24px; }
.badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 600; display: inline-grid; place-items: center;
}
.pill { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--hover); color: var(--muted); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.err { background: var(--danger-soft); color: var(--danger); }
.muted { color: var(--muted); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }

/* ---------- Đăng nhập ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.login-card {
  width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 32px; box-shadow: var(--shadow); text-align: center;
}
.login-card .logo { width: 56px; height: 56px; margin: 0 auto 16px; }
.login-card h1 { font-size: 22px; margin: 0 0 6px; }
.login-card p { color: var(--muted); margin: 0 0 24px; }
.fb-btn { width: 100%; justify-content: center; padding: 11px 16px; font-weight: 600; background: #1877f2; border-color: #1877f2; color: #fff; }
.login-card ul { text-align: left; color: var(--muted); padding-left: 18px; margin: 22px 0 0; font-size: 13px; }
.alert { padding: 10px 12px; border-radius: 8px; font-size: 13px; text-align: left; margin-bottom: 16px; }
.alert.err { background: var(--danger-soft); color: var(--danger); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- Khung ứng dụng ---------- */
.shell { display: grid; grid-template-columns: 64px 1fr; height: 100%; }
.rail {
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; padding: 12px 0; gap: 6px;
}
.rail .logo { width: 36px; height: 36px; margin-bottom: 12px; }
.rail a {
  width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); position: relative;
}
.rail a:hover { background: var(--hover); color: var(--text); }
.rail a.active { background: var(--accent-soft); color: var(--accent); }
.rail a svg { width: 22px; height: 22px; }
.rail a .badge { position: absolute; top: 4px; right: 2px; }
.rail .spacer { flex: 1; }
.rail .me { cursor: pointer; border: none; background: none; padding: 0; }
.view { min-width: 0; min-height: 0; height: 100%; overflow: hidden; }

/* ---------- Hộp thư ---------- */
.inbox { display: grid; grid-template-columns: 340px minmax(0, 1fr) 290px; height: 100%; }
.list-col { background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.list-head { padding: 14px 14px 8px; border-bottom: 1px solid var(--border); }
.list-head h2 { font-size: 17px; margin: 0 0 10px; display: flex; align-items: center; justify-content: space-between; }
.page-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; white-space: nowrap; font-size: 13px; flex: none;
}
.chip.all { padding-left: 10px; }
.chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip .badge { margin-left: 2px; }
.search { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.search:focus, textarea:focus, input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.tabs { display: flex; gap: 2px; margin-top: 8px; }
.tabs button {
  flex: 1; border: none; background: none; padding: 6px 4px; border-radius: 6px; cursor: pointer; color: var(--muted); font-size: 13px;
}
.tabs button.active { background: var(--hover); color: var(--text); font-weight: 600; }
.conv-list { flex: 1; overflow-y: auto; }
.conv {
  display: flex; gap: 10px; padding: 11px 14px; cursor: pointer; border-bottom: 1px solid var(--border); position: relative;
}
.conv:hover { background: var(--hover); }
.conv.active { background: var(--accent-soft); }
.conv .who { position: relative; }
.conv .who .avatar.sm { position: absolute; right: -4px; bottom: -4px; border: 2px solid var(--surface); }
.conv .body { flex: 1; min-width: 0; }
.conv .line1 { display: flex; justify-content: space-between; gap: 8px; }
.conv .name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv .time { color: var(--muted); font-size: 12px; flex: none; }
.conv .line2 { display: flex; justify-content: space-between; gap: 8px; margin-top: 2px; }
.conv .snippet { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.conv .meta { font-size: 11px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv.unread .name, .conv.unread .snippet { font-weight: 600; color: var(--text); }
.load-more { display: block; margin: 12px auto; }

/* ---------- Khung chat ---------- */
.chat-col { display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.chat-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.chat-head .title { flex: 1; min-width: 0; }
.chat-head .title b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head .title span { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back { display: none; }
.messages { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 3px; }
.day { align-self: center; font-size: 12px; color: var(--muted); margin: 14px 0 8px; }
.msg { display: flex; flex-direction: column; max-width: min(72%, 560px); }
.msg.in { align-self: flex-start; }
.msg.out { align-self: flex-end; align-items: flex-end; }
.bubble { padding: 8px 12px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.in .bubble { background: var(--bubble-in); border-bottom-left-radius: 5px; }
.msg.out .bubble { background: var(--bubble-out); color: var(--bubble-out-text); border-bottom-right-radius: 5px; }
.msg.out .bubble a { color: inherit; }
.msg.failed .bubble { background: var(--danger-soft); color: var(--danger); }
.msg .att img { max-width: 260px; max-height: 300px; border-radius: 12px; cursor: zoom-in; border: 1px solid var(--border); }
.msg .att video { max-width: 300px; border-radius: 12px; }
.msg .att .file { display: inline-flex; gap: 6px; align-items: center; padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.msg .att + .bubble, .msg .att + .att { margin-top: 3px; }
.msg .info { font-size: 11px; color: var(--muted); margin: 2px 6px 6px; }
.msg .info .err { color: var(--danger); }
.typing-hint { padding: 8px 16px; font-size: 12px; }

.window-bar { padding: 6px 16px; font-size: 12px; color: var(--muted); background: var(--surface); border-top: 1px solid var(--border); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.window-bar.warn { background: var(--warn-soft); color: var(--warn); }
.window-bar.err { background: var(--danger-soft); color: var(--danger); }
.window-bar label { display: inline-flex; gap: 5px; align-items: center; cursor: pointer; font-weight: 600; }
.composer { position: relative; display: flex; gap: 8px; align-items: flex-end; padding: 10px 16px 14px; background: var(--surface); }
.composer textarea {
  flex: 1; resize: none; max-height: 160px; min-height: 40px; padding: 9px 12px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--surface-2); line-height: 1.4;
}
.quick-pop {
  position: absolute; left: 16px; right: 16px; bottom: calc(100% - 4px); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); max-height: 240px; overflow-y: auto; z-index: 5;
}
.quick-pop button { display: block; width: 100%; text-align: left; border: none; background: none; padding: 8px 12px; cursor: pointer; }
.quick-pop button:hover, .quick-pop button.sel { background: var(--hover); }
.quick-pop b { color: var(--accent); margin-right: 6px; }
.quick-pop span { color: var(--muted); }

/* ---------- Thông tin khách ---------- */
.info-col { background: var(--surface); border-left: 1px solid var(--border); overflow-y: auto; padding: 20px 16px; }
.info-col .who { text-align: center; margin-bottom: 18px; }
.info-col .who .avatar { margin: 0 auto 10px; }
.info-col .who b { display: block; font-size: 16px; }
.info-col dl { margin: 0 0 18px; display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; font-size: 13px; }
.info-col dt { color: var(--muted); }
.info-col dd { margin: 0; overflow-wrap: anywhere; }
.info-col h4 { margin: 0 0 6px; font-size: 13px; }
.info-col textarea { width: 100%; min-height: 110px; resize: vertical; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); }
.info-col .actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.info-col .actions .btn { justify-content: center; }

/* ---------- Trang quản lý ---------- */
.page-view { height: 100%; overflow-y: auto; padding: 24px; }
.page-view header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-view h1 { font-size: 22px; margin: 0 0 4px; }
.page-view header p { margin: 0; color: var(--muted); max-width: 640px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.card.off { opacity: .7; }
.card .top { display: flex; gap: 12px; align-items: center; }
.card .top .avatar { width: 48px; height: 48px; }
.card .top b { display: block; font-size: 15px; }
.card .stats { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.card .error { font-size: 12px; color: var(--danger); background: var(--danger-soft); padding: 8px 10px; border-radius: 8px; margin-bottom: 12px; }
.card .row { display: flex; gap: 6px; flex-wrap: wrap; }
.section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 20px; max-width: 860px; }
.section h2 { margin: 0 0 12px; font-size: 16px; }
.form-row { display: grid; grid-template-columns: 160px 1fr auto; gap: 8px; align-items: start; margin-bottom: 14px; }
.form-row input, .form-row textarea { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); width: 100%; }
.form-row textarea { min-height: 40px; resize: vertical; }
table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
td .user { display: flex; align-items: center; gap: 8px; }
td select { padding: 4px 6px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); }

dialog {
  border: 1px solid var(--border); border-radius: 14px; padding: 0; width: min(440px, calc(100% - 32px));
  background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(10, 15, 25, .45); }
dialog .d-head { padding: 16px 18px 6px; }
dialog .d-head h3 { margin: 0 0 4px; }
dialog .d-body { padding: 8px 18px; max-height: 50vh; overflow-y: auto; }
dialog .d-body label { display: flex; align-items: center; gap: 10px; padding: 7px 0; cursor: pointer; }
dialog .d-foot { padding: 12px 18px 16px; display: flex; justify-content: flex-end; gap: 8px; }
dialog.lightbox { width: auto; max-width: 92vw; background: transparent; border: none; box-shadow: none; }
dialog.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 10px; }

#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 50; max-width: calc(100% - 32px); }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); max-width: 380px; animation: pop .18s ease-out; }
.toast.err { background: var(--danger); color: #fff; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

/* ---------- Nhãn, AI, phụ trách ---------- */
.small { font-size: 12px; }
.search-row { display: flex; gap: 6px; }
.search-row .search { flex: 1; min-width: 0; }
.tag-filter { max-width: 120px; padding: 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.tabs { flex-wrap: wrap; row-gap: 2px; }
.tabs button { flex: none; padding: 5px 8px; }
.conv .tags { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.pill.tag { background: var(--accent-soft); color: var(--accent); }
.conv .hot { font-size: 12px; }
.viewing { color: var(--ok); font-weight: 500; }
.ai-strip {
  display: flex; gap: 8px; align-items: flex-start; padding: 8px 16px; font-size: 13px; cursor: pointer;
  background: var(--accent-soft); color: var(--text); border-bottom: 1px solid var(--border);
}
.ai-strip svg { width: 16px; height: 16px; flex: none; color: var(--accent); margin-top: 2px; }
.ai-strip.collapsed span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-strip[hidden] { display: none; }
.ai-btn { color: var(--accent); }
.busy svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.msg.ai .bubble { background: var(--surface); color: var(--text); border: 1px dashed var(--accent); }
.quick-pop em { font-style: normal; font-size: 11px; color: var(--muted); background: var(--hover); border-radius: 4px; padding: 1px 5px; margin-right: 6px; }
.info-col h4 { margin-top: 16px; }
.info-col select, .info-col input { width: 100%; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); }
.info-head { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.info-head h4 { margin: 0; }
.info-head .btn svg { width: 14px; height: 14px; }
.ai-summary { margin: 6px 0 0; font-size: 13px; background: var(--accent-soft); border-radius: 8px; padding: 8px 10px; }
.tag-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.tag-chips .pill { border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; }
.tag-chips .pill.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.fields { display: grid; gap: 6px; }
.fields label { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.info-col .info-col textarea { min-height: 90px; }

/* ---------- Cài đặt ---------- */
.section h3 { font-size: 14px; margin: 18px 0 4px; }
.section .kb { width: 100%; min-height: 220px; padding: 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); resize: vertical; line-height: 1.5; }
.check { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; cursor: pointer; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.inline-form input { padding: 5px 7px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); }
.inline-form input[type="password"] { flex: 1 1 280px; min-width: 0; padding: 8px 10px; border-radius: 8px; }
.section .kb.short { min-height: 90px; }
.form-grid { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 12px; }
.form-grid label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: 100%; min-width: 0; }
.form-grid select { max-width: 100%; min-width: 0; }
.form-grid label > span { color: var(--muted); font-size: 13px; }
.form-grid select, .form-grid input { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.form-grid input { width: 260px; max-width: 100%; }
.form-grid p { margin: 0; }
.form-row.two { grid-template-columns: 1fr 220px; }
.form-row.qr { grid-template-columns: 120px 120px 1fr auto; }
code { background: var(--hover); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* ---------- Thống kê ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters select { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; max-width: 1100px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.stat .label { font-size: 12px; color: var(--muted); }
.stat b { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 12px; color: var(--muted); }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; max-width: 1100px; }
.chart-grid .section { margin-bottom: 0; max-width: none; }
.section.wide { max-width: 1100px; margin-top: 20px; }
.section.chart h2 { font-size: 14px; }
.section.chart h2 .muted { font-weight: 400; font-size: 12px; }
.plot { position: relative; height: 180px; padding-bottom: 20px; }
.plot .grid { position: absolute; inset: 0 0 20px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.plot .grid span { border-top: 1px solid var(--border); opacity: .6; }
.plot .grid span:last-child { opacity: 1; }
.bars { position: absolute; inset: 0; display: flex; gap: 2px; }
.bars .col { flex: 1; position: relative; display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: 20px; min-width: 0; cursor: default; }
.bars .col:hover { background: var(--hover); border-radius: 4px 4px 0 0; }
.bars .bar { background: var(--accent); border-radius: 4px 4px 0 0; min-height: 0; width: min(100%, 22px); margin: 0 auto; }
.bars .x { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--muted); white-space: nowrap; }
.chart-tip {
  position: absolute; top: -6px; transform: translate(-50%, -100%); background: var(--text); color: var(--bg);
  padding: 5px 9px; border-radius: 6px; font-size: 12px; white-space: nowrap; pointer-events: none; z-index: 2;
}
.chart-tip span { display: block; opacity: .75; font-size: 11px; }
.chart-tip[hidden] { display: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .inbox { grid-template-columns: 320px minmax(0, 1fr); }
  .info-col { display: none; }
  .inbox.show-info .info-col { display: block; position: fixed; right: 0; top: 0; bottom: 0; width: min(320px, 100%); z-index: 20; box-shadow: var(--shadow); }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 56px; }
  .rail { flex-direction: row; justify-content: space-around; border-right: none; border-top: 1px solid var(--border); padding: 0 8px; order: 2; }
  .rail .logo, .rail .spacer { display: none; }
  .inbox { grid-template-columns: minmax(0, 1fr); }
  .chat-head .btn.small { padding: 4px 7px; }
  .inbox .chat-col { display: none; }
  .inbox.show-chat .list-col { display: none; }
  .inbox.show-chat .chat-col { display: flex; }
  .back { display: inline-flex; }
  .msg { max-width: 85%; }
  .page-view { padding: 16px; }
  .cards { grid-template-columns: 1fr; }
  .form-row, .form-row.two, .form-row.qr { grid-template-columns: 1fr; }
  .section { overflow-x: auto; } /* bảng người dùng/trả lời nhanh cuộn ngang thay vì bị cắt */
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat b { font-size: 22px; }
}
