/* Zalo-xevip Admin — tông xanh lạnh / tím than, có chế độ tối.
   Màu biểu đồ (--series-*) giữ nguyên bộ đã kiểm tra CVD / contrast. */

@font-face { font-family: "Be Vietnam Pro"; src: url("fonts/BeVietnamPro-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Be Vietnam Pro"; src: url("fonts/BeVietnamPro-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Be Vietnam Pro"; src: url("fonts/BeVietnamPro-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Be Vietnam Pro"; src: url("fonts/BeVietnamPro-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --text: #0f1b2d;
  --muted: #5b6b82;
  --border: #dde4ee;
  --grid: #e8edf4;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #e7eefd;
  --primary-text: #ffffff;
  --accent: #38bdf8;
  --navy: #0b1f3a;
  --navy-2: #12305a;
  --navy-3: #1b4380;
  --danger: #d0353a;
  --warn-bg: #fff4e2;
  --warn-text: #8a4b00;
  --ok-bg: #e5f6ec;
  --ok-text: #17663a;
  --err-bg: #fdeced;
  --err-text: #a1202a;
  --info-bg: #e7eefd;
  --info-text: #1a4fa8;
  --neutral-bg: #edf0f5;
  --neutral-text: #475467;
  --shadow-sm: 0 1px 2px rgba(15, 27, 45, 0.06);
  --shadow: 0 1px 2px rgba(15, 27, 45, 0.05), 0 6px 20px -8px rgba(15, 27, 45, 0.12);
  --shadow-lg: 0 20px 50px -12px rgba(11, 31, 58, 0.35);
  --radius: 14px;
  --radius-sm: 9px;
  --sidebar-w: 252px;
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --series-5: #e87ba4; --series-6: #008300; --series-7: #6250d6; --series-8: #e34948;
  --series-other: #98a2b3;
  --status-good: #0ca30c;
  --status-critical: #d03b3b;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1220; --surface: #101a2c; --surface-2: #16223a; --text: #e5ecf6; --muted: #93a3bb;
    --border: #22314d; --grid: #1c2942; --primary: #4f8cff; --primary-hover: #6b9eff; --primary-soft: #15264a;
    --danger: #f0565b; --warn-bg: #3a2a12; --warn-text: #ffcc80; --ok-bg: #0f2f1f; --ok-text: #8fdca8;
    --err-bg: #3a1619; --err-text: #ff9a9f; --info-bg: #15264a; --info-text: #9cc0ff;
    --neutral-bg: #1e2a40; --neutral-text: #c0cadb;
    --navy: #060d19; --navy-2: #0c1a33; --navy-3: #16325f;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -10px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, 0.7);
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
    --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
    --series-other: #667085;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a1220; --surface: #101a2c; --surface-2: #16223a; --text: #e5ecf6; --muted: #93a3bb;
  --border: #22314d; --grid: #1c2942; --primary: #4f8cff; --primary-hover: #6b9eff; --primary-soft: #15264a;
  --danger: #f0565b; --warn-bg: #3a2a12; --warn-text: #ffcc80; --ok-bg: #0f2f1f; --ok-text: #8fdca8;
  --err-bg: #3a1619; --err-text: #ff9a9f; --info-bg: #15264a; --info-text: #9cc0ff;
  --neutral-bg: #1e2a40; --neutral-text: #c0cadb;
  --navy: #060d19; --navy-2: #0c1a33; --navy-3: #16325f;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -10px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, 0.7);
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
  --series-other: #667085;
  color-scheme: dark;
}

/* ---------- Nền tảng ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0 0 8px; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 22px; font-weight: 700; } h2 { font-size: 16px; font-weight: 650; } h3 { font-size: 14px; font-weight: 600; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.9em; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: var(--danger); margin: 0; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: color-mix(in srgb, var(--primary) 25%, transparent); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.ico { display: inline-grid; place-items: center; width: 20px; height: 20px; flex: none; }
.ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Thẻ ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; min-width: 0; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h2 { margin: 0; flex: 1; }

/* ---------- Form ---------- */
label { display: grid; gap: 5px; font-weight: 500; font-size: 13px; }
input, select, textarea {
  font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 11px; width: 100%; min-width: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--primary); }
.inline-check { display: flex; align-items: center; gap: 8px; font-weight: 400; }

/* ---------- Nút ---------- */
.btn { font: inherit; font-weight: 600; border-radius: var(--radius-sm); padding: 8px 15px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  box-shadow: var(--shadow-sm); transition: background 0.15s, border-color 0.15s, transform 0.08s, box-shadow 0.15s; }
.btn:hover:not(:disabled) { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); background: var(--surface-2); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 88%, #fff), var(--primary)); border-color: var(--primary); color: var(--primary-text);
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25), 0 4px 12px -4px rgba(37, 99, 235, 0.45); }
.btn.primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 88%, #000); border-color: transparent; }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.sm { padding: 5px 11px; font-size: 12px; border-radius: 8px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Đăng nhập ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--bg); }
.login-hero { position: relative; overflow: hidden; color: #e6eefb; padding: 48px clamp(28px, 5vw, 72px);
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  background: radial-gradient(120% 90% at 0% 0%, #1b4380 0%, transparent 55%), radial-gradient(90% 80% at 100% 100%, #0e3b6e 0%, transparent 60%), linear-gradient(150deg, #0b1f3a, #071427); }
.login-hero::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(148, 197, 255, 0.16) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(180deg, #000 0%, transparent 85%); }
.login-hero > * { position: relative; }
.login-hero .brand { color: #fff; }
.login-hero h2 { font-size: clamp(26px, 3.2vw, 38px); line-height: 1.15; font-weight: 700; color: #fff; margin: 0 0 14px; max-width: 14em; }
.login-hero h2 em { font-style: normal; background: linear-gradient(90deg, #7dd3fc, #c7e4ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-hero p { color: #b7c7de; max-width: 30em; margin: 0; }
.login-points { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; }
.login-points li { display: flex; gap: 12px; align-items: flex-start; color: #d5e2f5; }
.login-points .ico { width: 32px; height: 32px; padding: 7px; border-radius: 9px; background: rgba(125, 211, 252, 0.12); color: #7dd3fc; border: 1px solid rgba(125, 211, 252, 0.22); }
.login-points strong { display: block; color: #fff; font-weight: 600; }
.login-points span { font-size: 13px; color: #9fb3cf; }
.login-foot { font-size: 12px; color: #7f93b1; }
.login-hero .bolt-art { position: absolute; right: -40px; top: 12%; width: min(46%, 360px); opacity: 0.9; pointer-events: none; }
.login-panel { display: grid; place-items: center; padding: 32px 20px; }
.login-card { width: 100%; max-width: 380px; display: grid; gap: 16px; animation: rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.login-card h1 { margin: 0; font-size: 26px; }
.login-card .lead { margin: 4px 0 0; }
.login-card .btn.primary { padding: 11px 16px; font-size: 15px; }
.login-users { display: grid; gap: 6px; padding-top: 14px; border-top: 1px dashed var(--border); }
.login-users p { margin: 0; }
.login-users ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.login-user { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; font: inherit; text-align: left;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.login-user:hover, .login-user:focus-visible { border-color: var(--primary); background: var(--primary-soft); }
.login-user .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login-hero { padding: 28px 20px; gap: 18px; }
  .login-hero .login-points, .login-hero .login-foot, .login-hero .bolt-art { display: none; }
  .login-hero h2 { font-size: 22px; margin-bottom: 6px; }
}

/* ---------- Logo ---------- */
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.logo-mark { position: relative; overflow: hidden; flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(140deg, #3b82f6, #1e40af 60%, #172554); box-shadow: 0 6px 16px -6px rgba(56, 189, 248, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  animation: logo-in 0.8s cubic-bezier(0.2, 0.9, 0.2, 1.1) both; }
.logo-mark svg { width: 24px; height: 24px; }
.logo-mark::after { content: ""; position: absolute; inset: -40% -60%; background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.75) 50%, transparent 60%);
  transform: translateX(-120%); animation: shine 7s ease-in-out 1.2s infinite; }
.logo-text { display: grid; line-height: 1.15; animation: logo-text-in 0.8s 0.12s cubic-bezier(0.2, 0.9, 0.2, 1) both; }
.logo-text strong { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.logo-text small { font-size: 11px; opacity: 0.65; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }

/* ---------- Khung ứng dụng ---------- */
.app { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 30; display: flex; flex-direction: column; gap: 6px; padding: 18px 14px;
  color: #c3d1e6; background: linear-gradient(180deg, var(--navy-2), var(--navy) 55%); border-right: 1px solid rgba(255, 255, 255, 0.04); }
.sidebar::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(80% 30% at 0% 0%, rgba(56, 189, 248, 0.16), transparent 70%), radial-gradient(60% 25% at 100% 100%, rgba(37, 99, 235, 0.18), transparent 70%); }
.sidebar > * { position: relative; }
.sidebar .brand { color: #fff; padding: 2px 6px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); margin-bottom: 6px; }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; margin: 0 -4px; padding: 0 4px; }
.nav-group { font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #6f86a8; padding: 14px 10px 6px; }
.nav-group:first-child { padding-top: 4px; }
.tab { font: inherit; font-weight: 500; display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; background: none; border: none; color: #b4c4dc;
  padding: 9px 11px; border-radius: 10px; cursor: pointer; position: relative; transition: background 0.15s, color 0.15s; }
.tab .ico { width: 19px; height: 19px; opacity: 0.85; }
.tab:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.tab[aria-selected="true"] { color: #fff; font-weight: 600;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.18), rgba(37, 99, 235, 0.08)); box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.16); }
.tab[aria-selected="true"]::before { content: ""; position: absolute; left: -4px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: linear-gradient(180deg, #7dd3fc, #3b82f6); box-shadow: 0 0 10px rgba(56, 189, 248, 0.7); }
.tab[aria-selected="true"] .ico { opacity: 1; color: #7dd3fc; }
.tab .count { margin-left: auto; background: #ef4444; color: #fff; border-radius: 999px; padding: 0 7px; font-size: 11px; font-weight: 700; line-height: 18px; min-width: 18px; text-align: center; }
.sidebar-foot { border-top: 1px solid rgba(255, 255, 255, 0.07); padding: 12px 8px 0; font-size: 11.5px; color: #6f86a8; display: flex; align-items: center; gap: 8px; }
.sidebar-foot .dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18); }
.sidebar-backdrop { position: fixed; inset: 0; background: rgba(6, 13, 25, 0.5); z-index: 25; backdrop-filter: blur(2px); }

.main { margin-left: var(--sidebar-w); min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 24px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.page-title { flex: 1; min-width: 0; }
.page-title h1 { margin: 0; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-title p { margin: 1px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); cursor: pointer; box-shadow: var(--shadow-sm); transition: color 0.15s, border-color 0.15s, background 0.15s; }
.icon-btn:hover { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.icon-btn .ico { width: 19px; height: 19px; }
.menu-btn { display: none; }
.bell-count { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #ef4444; color: #fff;
  font-size: 10.5px; font-weight: 700; line-height: 18px; text-align: center; border: 2px solid var(--bg); box-sizing: content-box; }
.bell.ring .ico { animation: ring 1s ease-in-out 2; transform-origin: 50% 10%; }
.bell.ring .bell-count { animation: pop 0.5s ease-out; }
.user-menu { position: relative; }
.user-chip { display: flex; align-items: center; gap: 9px; font: inherit; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 4px 12px 4px 4px; cursor: pointer; color: var(--text); box-shadow: var(--shadow-sm); }
.user-chip:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.avatar { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff;
  background: linear-gradient(140deg, #38bdf8, #2563eb 55%, #1e3a8a); }
.user-meta { display: grid; text-align: left; line-height: 1.2; }
.user-meta strong { font-size: 13px; }
.user-meta span { font-size: 11px; color: var(--muted); }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 6px; z-index: 40; animation: rise 0.16s ease-out both; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; font: inherit; background: none; border: none; color: var(--text); padding: 8px 10px; border-radius: 8px; cursor: pointer; text-align: left; }
.menu button:hover { background: var(--surface-2); }
.menu button .ico { width: 17px; height: 17px; color: var(--muted); }
.menu hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }
.content { padding: 22px 24px 40px; width: 100%; max-width: 1440px; margin: 0 auto; animation: fade-in 0.35s ease-out both; }

.banner { padding: 9px 24px; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.banner.warn { background: var(--warn-bg); color: var(--warn-text); border-bottom: 1px solid color-mix(in srgb, var(--warn-text) 18%, transparent); }

@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.25s ease; box-shadow: var(--shadow-lg); }
  .app.nav-open .sidebar { transform: none; }
  .main { margin-left: 0; }
  .menu-btn { display: grid; }
}
@media (max-width: 640px) {
  .topbar { padding: 10px 16px; gap: 8px; }
  .content { padding: 16px 16px 32px; }
  .banner { padding: 8px 16px; }
  .user-meta, .page-title p { display: none; }
  .user-chip { padding: 4px; }
  .page-title h1 { font-size: 17px; }
}

/* ---------- Banner trang chủ ---------- */
.hero { position: relative; overflow: hidden; border-radius: 18px; padding: 24px 28px; margin-bottom: 16px; color: #e6eefb; min-height: 132px;
  display: flex; align-items: center; gap: 20px; box-shadow: var(--shadow-lg);
  background: radial-gradient(90% 140% at 100% 0%, rgba(56, 189, 248, 0.35), transparent 55%), linear-gradient(120deg, #0b1f3a 0%, #12305a 55%, #1b4380 100%); }
.hero::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(148, 197, 255, 0.14) 1px, transparent 1px); background-size: 20px 20px;
  mask-image: linear-gradient(90deg, transparent, #000 60%); }
.hero::after { content: ""; position: absolute; top: -50%; bottom: -50%; width: 40%; left: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.14) 45%, rgba(186, 230, 253, 0.28) 50%, rgba(255, 255, 255, 0.14) 55%, transparent);
  transform: translateX(-120%) skewX(-12deg); animation: sweep 6s ease-in-out 0.6s infinite; }
.hero > * { position: relative; z-index: 1; }
.hero-text { flex: 1; min-width: 0; }
.hero-eyebrow { margin: 0 0 4px; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: #8fb3df; font-weight: 600; }
.hero h2 { color: #fff; font-size: 24px; margin: 0 0 6px; font-weight: 700; }
.hero p { margin: 0; color: #c2d3ea; }
.hero p strong { color: #fff; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.hero-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.12); color: #dbe7f7; }
.hero-chip i { width: 7px; height: 7px; border-radius: 50%; background: #34d399; }
.hero-chip.warn i { background: #fbbf24; } .hero-chip.err i { background: #f87171; }
.hero-art { width: 150px; height: 110px; flex: none; }
.bolt { filter: drop-shadow(0 0 6px rgba(125, 211, 252, 0.9)); animation: flash 5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.bolt.b2 { animation-delay: 1.7s; opacity: 0; }
.bolt.b3 { animation-delay: 3.3s; opacity: 0; }
.spark { stroke: #e0f2fe; stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: strike 5s ease-in-out infinite; }
.spark.s2 { animation-delay: 2.4s; }
@media (max-width: 640px) { .hero { padding: 18px; } .hero h2 { font-size: 19px; } .hero-art { display: none; } }

/* ---------- Lưới ---------- */
.grid { display: grid; gap: 16px; }
.grid.kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
.grid.form { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); align-items: end; gap: 12px; }
@media (max-width: 520px) { .grid.two { grid-template-columns: 1fr; } }

/* ---------- Ô số liệu ---------- */
.stat { position: relative; overflow: hidden; }
.card.stat::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--primary), var(--accent)); opacity: 0.85; }
.grid.kpis .stat:nth-child(2)::before { background: linear-gradient(90deg, #1e3a8a, #3b82f6); }
.grid.kpis .stat:nth-child(3)::before { background: linear-gradient(90deg, #0ea5e9, #67e8f9); }
.grid.kpis .stat:nth-child(4)::before { background: linear-gradient(90deg, #4f46e5, #818cf8); }
.grid.kpis .stat:nth-child(5)::before { background: linear-gradient(90deg, #0b1f3a, #38bdf8); }
.stat .label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.stat .value { font-size: 28px; font-weight: 700; line-height: 1.2; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat .sub { color: var(--muted); font-size: 12px; margin-top: 6px; }
.stat .meter { margin-top: 10px; }
.delta { font-weight: 600; font-size: 12.5px; }
.delta.up { color: var(--ok-text); } .delta.down { color: var(--err-text); } .delta.flat { color: var(--muted); }

.compare-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin: 6px 0 12px; }
.compare-hero .value { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; }

/* ---------- Thanh tiến độ ---------- */
.meter { --c: var(--primary); position: relative; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; min-width: 60px; }
.meter > span { position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 70%, #38bdf8), var(--c)); animation: grow 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.meter > span::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent); transform: translateX(-100%); animation: meter-shine 2.4s ease-in-out 1.1s infinite; }
.meter.warn { --c: #f59e0b; } .meter.err { --c: var(--danger); }
.cell-meter { display: grid; gap: 4px; justify-items: end; }
.cell-meter .meter { width: 90px; }

/* ---------- Badge trạng thái: luôn có chữ + icon, không chỉ màu ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge.ok { background: var(--ok-bg); color: var(--ok-text); border-color: color-mix(in srgb, var(--ok-text) 15%, transparent); }
.badge.warn { background: var(--warn-bg); color: var(--warn-text); border-color: color-mix(in srgb, var(--warn-text) 15%, transparent); }
.badge.err { background: var(--err-bg); color: var(--err-text); border-color: color-mix(in srgb, var(--err-text) 15%, transparent); }
.badge.info { background: var(--info-bg); color: var(--info-text); border-color: color-mix(in srgb, var(--info-text) 15%, transparent); }
.badge.neutral { background: var(--neutral-bg); color: var(--neutral-text); }
.badge.pending { animation: pulse 1.8s ease-out infinite; }
.badge.err.pending { animation-name: pulse-err; }

/* ---------- Bảng ---------- */
.table-wrap { overflow: auto; max-height: 72vh; border: 1px solid var(--border); border-radius: 12px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); font-size: 11.5px; color: var(--muted); font-weight: 600; white-space: nowrap; text-transform: uppercase; letter-spacing: 0.04em; }
th.num { text-align: right; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: color-mix(in srgb, var(--primary-soft) 65%, transparent); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.pager { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; justify-content: flex-end; margin-top: 12px; font-size: 13px; }
.pager-info { margin-right: auto; font-variant-numeric: tabular-nums; }
.pager-size { display: flex; align-items: center; gap: 6px; font-weight: 400; color: var(--muted); }
.pager-size select { width: auto; padding: 4px 8px; font-size: 13px; }
.pager-pages { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pager-pages .btn.sm { min-width: 32px; padding: 5px 9px; font-variant-numeric: tabular-nums; }
.pager-pages .btn.current { background: var(--primary); border-color: var(--primary); color: var(--primary-text); cursor: default; }
.pager-gap { color: var(--muted); padding: 0 2px; }
.empty { color: var(--muted); padding: 22px 8px; text-align: center; }

/* ---------- Biểu đồ ---------- */
.chart-box { position: relative; height: 280px; }
.chart-box.short { height: 240px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); margin: 4px 0 8px; }
.legend .key { display: inline-flex; align-items: center; gap: 6px; }
.legend .swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 10px; }
.filters label { min-width: 140px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.seg button { font: inherit; font-size: 13px; font-weight: 500; border: none; background: transparent; color: var(--muted); padding: 5px 11px; border-radius: 7px; cursor: pointer; transition: background 0.15s, color 0.15s; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--primary); font-weight: 600; box-shadow: var(--shadow-sm); }

/* ---------- Danh sách cảnh báo / vấn đề ---------- */
.issue { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--border); }
.issue:last-child { border-bottom: none; }
.issue .body { flex: 1; min-width: 0; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(6, 13, 25, 0.55); backdrop-filter: blur(3px); display: grid; place-items: start center; padding: 48px 12px; z-index: 50; overflow-y: auto; animation: fade-in 0.18s ease-out both; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; width: 100%; max-width: 760px; padding: 22px; box-shadow: var(--shadow-lg); animation: rise 0.25s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.modal.wide { max-width: 1000px; }
.modal-head { display: flex; align-items: center; gap: 10px; margin: -4px 0 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.modal-head h2 { flex: 1; margin: 0; font-size: 17px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.qr { display: grid; place-items: center; gap: 8px; padding: 16px; text-align: center; }
.qr img { width: 240px; height: 240px; image-rendering: pixelated; background: #fff; padding: 8px; border-radius: 12px; box-shadow: 0 0 0 4px var(--primary-soft), 0 0 0 5px color-mix(in srgb, var(--primary) 40%, transparent); animation: qr-glow 2s ease-in-out infinite; }
.secret-box { background: var(--warn-bg); color: var(--warn-text); padding: 12px; border-radius: 10px; overflow-wrap: anywhere; }

/* ---------- Xem trước tin Zalo (ảnh banner + chữ có định dạng) ---------- */
.zalo-preview { background: var(--surface-2); border-radius: 12px; padding: 12px; display: grid; gap: 6px; justify-items: start; }
.zalo-img { display: block; max-width: min(360px, 100%); border-radius: 12px; border: 1px solid var(--border); background: #fff; }
.zalo-bubble { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; max-width: min(360px, 100%); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; }
.zalo-bubble.with-img { padding: 0; overflow: hidden; }
.zalo-bubble.with-img .zalo-img { max-width: 100%; border: 0; border-radius: 0; }
.zalo-caption { padding: 8px 12px 10px; white-space: pre-wrap; }
.zs-b { font-weight: 700; } .zs-i { font-style: italic; } .zs-u { text-decoration: underline; } .zs-s { text-decoration: line-through; }
.zs-c_db342e { color: #db342e; } .zs-c_f27806 { color: #f27806; } .zs-c_f7b503 { color: #c98f00; } .zs-c_15a85f { color: #15a85f; }
.zs-f_18 { font-size: 18px; } .zs-f_13 { font-size: 12.5px; }
.fmt-bar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.tpl-cell { max-width: 420px; display: grid; gap: 4px; }
.tpl-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; color: var(--muted); }
.btn.danger-text { color: var(--danger); }
.btn.danger-text:hover:not(:disabled) { background: var(--err-bg); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.tpl-image { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tpl-image img { max-height: 70px; max-width: 220px; border-radius: 8px; border: 1px solid var(--border); background: #fff; }
pre.content { white-space: pre-wrap; background: var(--surface-2); padding: 10px; border-radius: 10px; margin: 0; font: inherit; animation: none; max-width: none; }
.subtabs { display: flex; gap: 4px; margin: 14px 0 10px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.subtabs button { font: inherit; font-weight: 500; background: none; border: none; padding: 8px 12px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.subtabs button:hover { color: var(--text); }
.subtabs button[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.param-row { display: grid; grid-template-columns: 1.1fr 1.6fr 0.6fr 0.7fr 1.2fr auto; gap: 6px; align-items: center; margin-bottom: 6px; }
@media (max-width: 720px) { .param-row { grid-template-columns: 1fr 1fr; } }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #0b1f3a; color: #fff; padding: 11px 18px 11px 16px;
  border-radius: 12px; z-index: 100; max-width: calc(100% - 32px); box-shadow: var(--shadow-lg); border: 1px solid rgba(125, 211, 252, 0.25);
  display: flex; align-items: center; gap: 10px; animation: toast-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1.2) both; }
.toast::before { content: "✓"; display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 50%; background: rgba(56, 189, 248, 0.2); color: #7dd3fc; font-size: 12px; font-weight: 700; }
.toast.error { background: #3b0d12; border-color: rgba(248, 113, 113, 0.4); }
.toast.error::before { content: "!"; background: rgba(248, 113, 113, 0.25); color: #fca5a5; }

/* ---------- Pháo giấy ---------- */
.fx-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 200; }

/* ---------- Chuyển động ---------- */
@keyframes logo-in { from { opacity: 0; transform: translateX(-24px) rotate(-12deg) scale(0.8); } to { opacity: 1; transform: none; } }
@keyframes logo-text-in { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
@keyframes shine { 0%, 82% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
@keyframes sweep { 0%, 60% { transform: translateX(-120%) skewX(-12deg); } 100% { transform: translateX(320%) skewX(-12deg); } }
@keyframes flash { 0%, 70%, 100% { opacity: 0.25; transform: scale(0.96); } 72% { opacity: 1; transform: scale(1.04); } 74% { opacity: 0.4; } 76% { opacity: 1; } 84% { opacity: 0.35; transform: scale(1); } }
@keyframes strike { 0%, 68% { stroke-dashoffset: 60; opacity: 0; } 72% { opacity: 1; } 80% { stroke-dashoffset: 0; opacity: 1; } 90%, 100% { stroke-dashoffset: -60; opacity: 0; } }
@keyframes grow { from { width: var(--from, 0%); } }
@keyframes meter-shine { 0%, 50% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--info-text) 45%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
@keyframes pulse-err { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--err-text) 45%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
@keyframes ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(16deg); } 30% { transform: rotate(-14deg); } 45% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } 75% { transform: rotate(3deg); } }
@keyframes pop { 0% { transform: scale(0.4); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px) scale(0.96); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes qr-glow { 0%, 100% { box-shadow: 0 0 0 4px var(--primary-soft), 0 0 0 5px color-mix(in srgb, var(--primary) 30%, transparent); }
  50% { box-shadow: 0 0 0 6px var(--primary-soft), 0 0 22px 6px color-mix(in srgb, var(--accent) 45%, transparent); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; }
  .logo-mark::after, .hero::after, .meter > span::after { display: none; }
  .bolt.b2, .bolt.b3 { opacity: 0.4; }
}
.bolt-art .hero-art, .bolt-art .hero-art svg { width: 100%; height: auto; }
