/* =========================================================
   NhoSub — Design system v2 (compact)
   Quy tắc: màu phẳng, 0 gradient (ngoại lệ duy nhất .hero),
   độ sâu bằng box-shadow + viền + khoảng cách.
   Bản v2: khoảng cách chặt hơn, chữ nhỏ hơn, component gọn
   → cùng một lưới thông tin nhưng nhìn hiện đại, đỡ "loãng".
   ========================================================= */

:root {
  --primary: #1E6FD9;
  --primary-dark: #0A4DB3;
  --primary-light: #DCEBFD;
  --bg: #F5F8FF;
  --card: #FFFFFF;
  --text: #0F2233;
  --muted: #5B6B80;
  --success: #16A34A;
  --warning: #F59E0B;
  --danger: #DC2626;

  /* Surface phụ — biến ánh của xanh chủ đạo, không lạc tone */
  --surface-tint: #EEF4FE;      /* nền khối phụ: banner, thẻ thông tin */
  --surface-deep: #0F2A52;      /* khối tối duy nhất: 1 điểm neo mỗi trang */
  --surface-deep-soft: #16375F; /* lớp trên khối tối: hàng hover trong khối tối */

  --radius: 10px;
  --radius-sm: 7px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(15, 34, 51, .05);
  --shadow-md: 0 1px 2px rgba(15, 34, 51, .04), 0 3px 10px rgba(15, 34, 51, .06);
  --shadow-lg: 0 8px 24px rgba(15, 34, 51, .10), 0 2px 6px rgba(15, 34, 51, .05);

  --ease: .2s ease;
  --sidebar-w: 244px;
  --sidebar-w-collapsed: 64px;
  --header-h: 54px;
}

/* Font Baloo 2 — display tròn đậm, giống brand (self-host, subset latin + vietnamese) */
@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/baloo2-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/baloo2-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Chữ brand NHOSUB — Baloo 2 đậm, to nổi bật như ảnh tham khảo */
.sidebar-brand-text {
  font-family: 'Baloo 2', system-ui, sans-serif;
  font-weight: 800;
}

h1, h2, h3, h4 { margin: 0 0 .45em; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(26px, 3.6vw, 40px); }
h2 { font-size: clamp(20px, 2.4vw, 28px); }
h3 { font-size: 15.5px; }
p { margin: 0 0 .8em; }
a { color: var(--primary); text-decoration: none; }

/* Link gạch chân chạy trái → phải */
.link-underline { position: relative; display: inline-block; }
.link-underline::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 100%; height: 2px; background: var(--primary);
  transform: scaleX(0); transform-origin: left;
  transition: transform .2s ease;
}
.link-underline:hover::after { transform: scaleX(1); }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 7px 14px;
  font: inherit; font-weight: 600; font-size: 13.5px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; white-space: nowrap;
  transition: background-color .2s ease, color .2s ease,
              border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); box-shadow: var(--shadow-sm); }

.btn-outline { background: #fff; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover:not(:disabled) {
  background: var(--primary-light); transform: translateY(-1px); box-shadow: var(--shadow-sm);
}

.btn-ghost { background: transparent; color: var(--text); border-color: #E3ECFB; }
.btn-ghost:hover:not(:disabled) { background: var(--primary-light); color: var(--primary-dark); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #B91C1C; transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.btn-sm { min-height: 30px; padding: 4px 10px; font-size: 12.5px; }
.btn-block { width: 100%; }

/* ---------- Card ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--primary-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 16px;
}
.card-title { font-size: 14.5px; font-weight: 700; margin: 0 0 10px; }
.card-hover { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.card-hover:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}

/* ---------- Section (nhịp sâu bằng nền xen kẽ, không gradient) ---------- */
.section { position: relative; padding: 64px 0; background: var(--card); }
.section-alt { background: var(--bg); }
.section-head { max-width: 720px; margin: 0 auto 36px; text-align: center; }
.section-head::before {
  content: ""; display: block; width: 44px; height: 4px; border-radius: 2px;
  background: var(--primary); margin: 0 auto 14px;
}
.section-head p { color: var(--muted); margin: 0; }

.dot-pattern {
  background-image: url("/assets/img/pattern.svg");
  background-repeat: repeat;
  background-size: 32px 32px;
}

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---------- Badge trạng thái ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 1px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; line-height: 1.8;
  border: 1px solid transparent; white-space: nowrap;
}
.badge-pending   { background: #FFF7E6; color: #92580A; border-color: #FCE3B3; }
.badge-processing{ background: var(--primary-light); color: var(--primary-dark); border-color: #C6DDFB; }
.badge-completed { background: #E7F7EE; color: #0E7A38; border-color: #BFEACD; }
.badge-partial   { background: #FFF7E6; color: #92580A; border-color: #FCE3B3; }
.badge-canceled  { background: #FDECEC; color: #A31818; border-color: #F7C9C9; }
.badge-error     { background: #FDECEC; color: #A31818; border-color: #F7C9C9; }
.badge-review    { background: #FDECEC; color: #A31818; border-color: #F7C9C9; }
.badge-neutral   { background: #EEF2F8; color: var(--muted); border-color: #DDE5F1; }

/* ---------- Bảng (compact) ---------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-weight: 700; font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
  padding: 9px 12px; background: var(--bg);
  border-bottom: 1px solid var(--primary-light); white-space: nowrap;
}
.table td { padding: 10px 12px; border-bottom: 1px solid #EDF2FA; vertical-align: middle; }
.table tbody tr { transition: background-color .2s ease; }
.table tbody tr:hover { background: var(--bg); }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Form ---------- */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; }
.form-input, .form-select, .form-textarea {
  width: 100%; min-height: 38px; padding: 8px 12px;
  font: inherit; color: var(--text); background: #fff;
  border: 1px solid #D6E2F2; border-radius: var(--radius-sm);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.form-textarea { min-height: 96px; resize: vertical; }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 111, 217, .14);
}
.form-input::placeholder { color: #9AA9BC; }
.form-error { color: var(--danger); font-size: 12.5px; margin-top: 4px; }
.form-hint { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.form-input.is-invalid, .form-select.is-invalid { border-color: var(--danger); }

/* ---------- Alert ---------- */
.alert { padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid; font-size: 13.5px; margin-bottom: 14px; }
.alert-success { background: #E7F7EE; border-color: #BFEACD; color: #0E7A38; }
.alert-error   { background: #FDECEC; border-color: #F7C9C9; color: #A31818; }
.alert-warning { background: #FFF7E6; border-color: #FCE3B3; color: #92580A; }
.alert-info    { background: var(--primary-light); border-color: #C6DDFB; color: var(--primary-dark); }

/* ---------- Sidebar ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 50;
  width: var(--sidebar-w);
  display: flex; flex-direction: column;
  background: var(--card);
  border-right: 1px solid var(--primary-light);
  transition: width .2s ease, transform .2s ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 9px;
  height: var(--header-h); padding: 0 14px;
  border-bottom: 1px solid var(--primary-light);
  flex-shrink: 0;
}
.sidebar-brand img { width: 38px; height: 38px; flex-shrink: 0; border-radius: 9px; }
.sidebar-brand-text { font-weight: 800; font-size: 23px; letter-spacing: .02em; color: var(--primary-dark); line-height: 1.2; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 8px 16px; }
.nav-group { margin-bottom: 4px; }
.nav-group-title {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); padding: 10px 10px 4px;
}
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; margin-bottom: 1px;
  border-radius: var(--radius-sm);
  color: var(--text); font-size: 16px; font-weight: 500;
  transition: background-color .2s ease, color .2s ease;
}
.nav-item::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%) scaleY(0);
  width: 3px; height: 18px; border-radius: 0 3px 3px 0;
  background: var(--primary); transition: transform .2s ease;
}
.nav-item:hover { background: var(--primary-light); color: var(--primary-dark); }
.nav-item:hover::before { transform: translateY(-50%) scaleY(1); }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 600; }
.nav-item.active::before { background: #fff; transform: translateY(-50%) scaleY(1); }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 10.5px; font-weight: 700;
}
.nav-item.active .nav-badge { background: #fff; color: var(--primary); }

/* Mục submenu (danh mục con trong "Sản phẩm & dịch vụ") */
.nav-item-sub { padding-left: 36px; font-size: 14px; font-weight: 400; }
.nav-item-sub::before { display: none; }
.nav-item-sub:hover { background: var(--primary-light); }
.nav-item-sub.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }
.nav-item-sub.active::before {
  display: block; content: ""; position: absolute; left: 18px; top: 50%;
  transform: translateY(-50%); width: 3px; height: 14px; border-radius: 2px;
  background: var(--primary);
}
.sidebar-collapsed .nav-item-sub { display: none; }

/* ---------- Accordion nền tảng (Sản phẩm & dịch vụ) ---------- */
.nav-acc { margin-bottom: 1px; }
.nav-acc-summary {
  cursor: pointer; list-style: none; margin-bottom: 0;
  user-select: none;
}
.nav-acc-summary::-webkit-details-marker { display: none; }
.nav-acc-summary::marker { content: ""; }

/* Logo nền tảng thật */
.platform-logo {
  width: 21px; height: 21px; flex-shrink: 0;
  border-radius: 5px; object-fit: contain;
  transition: transform .2s ease;
}
.nav-acc-summary:hover .platform-logo { transform: scale(1.08); }

/* Mũi tên xổ xuống */
.nav-acc-chevron {
  width: 14px; height: 14px; margin-left: auto; flex-shrink: 0;
  color: var(--muted);
  transition: transform .2s ease, color .2s ease;
}
.nav-acc[open] .nav-acc-chevron { transform: rotate(180deg); }
.nav-acc-summary:hover .nav-acc-chevron { color: var(--primary); }

/* Vùng xổ xuống */
.nav-acc-body {
  padding: 2px 0 6px;
  border-left: 1px solid var(--primary-light);
  margin-left: 16px;
  animation: acc-in .2s ease;
}
@keyframes acc-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.nav-acc-body .nav-item-sub { padding-left: 14px; border-radius: var(--radius-sm); }
.nav-acc-body .nav-item-sub.active::before { left: -1px; }

/* Sidebar thu gọn: ẩn nội dung accordion, chỉ giữ logo nền tảng */
.sidebar-collapsed .nav-acc-body { display: none; }
.sidebar-collapsed .nav-acc-chevron { display: none; }
.sidebar-collapsed .nav-acc-summary { justify-content: center; padding: 9px 0; }

/* Sidebar thu gọn (desktop) */
.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
.sidebar-collapsed .sidebar-brand-text,
.sidebar-collapsed .nav-group-title,
.sidebar-collapsed .nav-item span,
.sidebar-collapsed .nav-badge { display: none; }
.sidebar-collapsed .nav-item { justify-content: center; padding: 9px 0; }
.sidebar-collapsed .main { margin-left: var(--sidebar-w-collapsed); }

.main {
  flex: 1; min-width: 0;
  margin-left: var(--sidebar-w);
  transition: margin-left .2s ease;
  display: flex; flex-direction: column;
}

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  height: var(--header-h); padding: 0 18px;
  background: var(--card); border-bottom: 1px solid var(--primary-light);
}
.topbar-title { font-size: 15px; font-weight: 700; margin: 0; }
.topbar-spacer { flex: 1; }
.topbar-balance {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--primary-light); color: var(--primary-dark);
  font-weight: 700; font-size: 13px; white-space: nowrap;
  transition: background-color .2s ease, color .2s ease;
}
.topbar-balance:hover { background: var(--primary); color: #fff; }
.content { padding: 20px 18px 40px; flex: 1; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: transparent; color: var(--text);
  cursor: pointer; transition: background-color .2s ease, color .2s ease;
  position: relative;
}
.icon-btn:hover { background: var(--primary-light); color: var(--primary-dark); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--danger);
  border: 2px solid #fff;
}

/* Overlay mobile */
.sidebar-overlay {
  position: fixed; inset: 0; z-index: 45;
  background: rgba(15, 34, 51, .45);
  opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s ease;
}
.sidebar-open .sidebar-overlay { opacity: 1; visibility: visible; }

/* ---------- Lưới ---------- */
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Lưới dịch vụ: cột hẹp, nhiều cột hơn để quét giá nhanh */
.grid-services { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }

/* ---------- Thống kê (compact, có icon) ---------- */
.stat {
  background: var(--card); border: 1px solid var(--primary-light);
  border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 12px;
  transition: box-shadow .2s ease, border-color .2s ease;
}
.stat:hover { box-shadow: var(--shadow-md); border-color: #C6DDFB; }
.stat-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: var(--primary-light); color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-icon svg { width: 18px; height: 18px; }
.stat-icon.success { background: #E7F7EE; color: #0E7A38; }
.stat-icon.warning { background: #FFF7E6; color: #92580A; }
.stat-icon.danger { background: #FDECEC; color: #A31818; }
.stat-body { min-width: 0; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 600; margin: 0; line-height: 1.35; }
.stat-value { font-size: 19px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.25; }
.stat-value.primary { color: var(--primary); }
.stat-value.success { color: var(--success); }
.stat-value.warning { color: var(--warning); }
.stat-value.danger { color: var(--danger); }

/* Khối stat dọc (không icon) — dùng cho vài chỗ cũ */
.stat.stat-stack { display: block; }
.stat.stat-stack .stat-value { margin-top: 2px; }

/* ---------- Hero landing (NGOẠI LỆ GRADIENT DUY NHẤT) ---------- */
.hero {
  position: relative;
  padding: 88px 0 80px;
  background: linear-gradient(180deg, #F5F8FF 0%, #EDF3FE 100%);
  border-bottom: 1px solid var(--primary-light);
  overflow: hidden;
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 44px; align-items: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; border-radius: 999px;
  background: #fff; border: 1px solid var(--primary-light);
  color: var(--primary-dark); font-size: 12.5px; font-weight: 600;
  box-shadow: var(--shadow-sm); margin-bottom: 18px;
}
.hero h1 { margin-bottom: 16px; }
.hero-lead { font-size: 16px; color: var(--muted); max-width: 520px; margin-bottom: 24px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 28px; margin-top: 34px; flex-wrap: wrap; }
.hero-stat strong { display: block; font-size: 22px; color: var(--primary); font-weight: 800; }
.hero-stat span { font-size: 12.5px; color: var(--muted); }

/* ---------- Landing header/footer ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: #fff; border-bottom: 1px solid var(--primary-light);
}
.site-header-inner { display: flex; align-items: center; gap: 24px; height: 60px; }
.site-nav { display: flex; gap: 24px; margin-left: 12px; }
.site-nav a { color: var(--text); font-weight: 500; font-size: 14px; }
.site-nav a:hover { color: var(--primary); }

.site-footer { background: var(--card); border-top: 1px solid var(--primary-light); padding: 40px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.footer-bottom {
  margin-top: 30px; padding-top: 18px; border-top: 1px solid #EDF2FA;
  font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 7px; }
.footer-links a { color: var(--muted); font-size: 13.5px; }
.footer-links a:hover { color: var(--primary); }

/* ---------- FAQ ---------- */
.faq-item {
  background: var(--card); border: 1px solid var(--primary-light);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  margin-bottom: 10px; overflow: hidden;
}
.faq-item summary {
  cursor: pointer; padding: 13px 16px; font-weight: 600;
  list-style: none; display: flex; justify-content: space-between; gap: 14px;
  transition: background-color .2s ease;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--primary); font-size: 19px; line-height: 1; }
.faq-item[open] summary::after { content: "−"; }
.faq-item summary:hover { background: var(--bg); }
.faq-body { padding: 0 16px 14px; color: var(--muted); }

/* ---------- Auth ---------- */
.auth-wrap {
  min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr;
  background: var(--bg);
}
.auth-side {
  background: var(--primary); color: #fff;
  display: flex; flex-direction: column; justify-content: center;
  padding: 48px; position: relative; overflow: hidden;
}
.auth-side h2 { color: #fff; }
.auth-side p { color: rgba(255,255,255,.86); }

/* Minh hoạ SVG trong khối xanh — đặt trên cùng, nội dung đẩy xuống dưới */
.auth-side-art {
  position: absolute; top: 0; left: 0; right: 0;
  opacity: .9; pointer-events: none;
}
.auth-side-art svg { display: block; width: 100%; height: auto; }
.auth-side-body { position: relative; z-index: 1; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--primary-light); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 26px; }
.auth-title { font-size: 22px; margin-bottom: 4px; }
.auth-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 20px; }

/* ---------- Tiện ích ---------- */
.text-muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-sm { font-size: 12.5px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 14px; }
.mt-3 { margin-top: 20px; }
.mt-4 { margin-top: 28px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 14px; }
.mb-3 { margin-bottom: 20px; }
.mb-4 { margin-bottom: 28px; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 14px; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; display: inline-block; vertical-align: middle; }
.divider { height: 1px; background: #EDF2FA; margin: 16px 0; border: 0; }

.empty-state { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty-state svg { width: 40px; height: 40px; color: var(--primary-light); margin-bottom: 10px; }

/* =========================================================
   Khối trang phụ (page blocks) — thay nền trắng phẳng
   ========================================================= */

/* Hero-compact: khối neo đầu mỗi trang phụ, mỗi trang 1 màu riêng */
.page-hero {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--surface-tint);
  border: 1px solid var(--primary-light);
  margin-bottom: 16px;
}
.page-hero-deep { background: var(--surface-deep); border-color: var(--surface-deep); color: #fff; }
.page-hero-deep .page-hero-title { color: #fff; }
.page-hero-deep .page-hero-desc { color: rgba(255,255,255,.78); }
.page-hero-icon {
  width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.page-hero-deep .page-hero-icon { background: rgba(255,255,255,.14); }
.page-hero-icon svg { width: 20px; height: 20px; }
.page-hero-title { font-size: 16.5px; font-weight: 700; margin: 0; color: var(--text); }
.page-hero-desc { font-size: 13px; margin: 2px 0 0; color: var(--muted); }
.page-hero-body { flex: 1; min-width: 0; }
.page-hero-action { flex-shrink: 0; }

/* Avatar chữ cái đầu (trang hồ sơ) */
.profile-avatar {
  width: 56px; height: 56px; border-radius: 16px; flex-shrink: 0;
  background: var(--primary); color: #fff;
  font-size: 24px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
}
.page-hero-deep .profile-avatar { background: rgba(255,255,255,.16); }

/* Thông tin nhấn mạnh trong trang (khối tint nhỏ) */
.note-block {
  background: var(--surface-tint);
  border: 1px solid var(--primary-light);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--primary-dark);
  margin-bottom: 14px;
}
.note-block strong { font-weight: 700; }

/* Bước hướng dẫn (dùng cho trang nạp tiền) */
.step-row {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 9px 0;
}
.step-num {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary); color: #fff;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.step-text { font-size: 13px; color: var(--text); }
.step-text strong { font-weight: 600; }

/* Khối tối (deep block): CTA lớn / trạng thái trống đặc biệt */
.deep-block {
  background: var(--surface-deep);
  border-radius: var(--radius);
  padding: 26px 24px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.deep-block::after {
  content: ""; position: absolute; inset: auto -40px -60px auto;
  width: 180px; height: 180px; border-radius: 50%;
  background: rgba(30, 111, 217, .25);
}
.deep-block h3 { color: #fff; font-size: 17px; position: relative; z-index: 1; }
.deep-block p { color: rgba(255,255,255,.75); font-size: 13px; position: relative; z-index: 1; }
.deep-block .btn { position: relative; z-index: 1; }
.deep-block .btn-primary { background: #fff; color: var(--primary-dark); }
.deep-block .btn-primary:hover:not(:disabled) { background: var(--primary-light); transform: translateY(-1px); }
.deep-block.dot-pattern { background-image: url("/assets/img/pattern-deep.svg"); }

/* Empty-state có khối: minh hoạ + CTA, không còn chữ mờ trơ trọi */
.empty-block {
  text-align: center;
  padding: 34px 20px;
  background: var(--surface-tint);
  border: 1px dashed #B9D3F5;
  border-radius: var(--radius);
}
.empty-block svg { width: 44px; height: 44px; color: var(--primary); opacity: .55; margin-bottom: 10px; }
.empty-block .empty-title { font-weight: 700; color: var(--text); font-size: 14.5px; margin-bottom: 4px; }
.empty-block p { font-size: 13px; color: var(--muted); margin-bottom: 14px; }

/* ---------- Card dịch vụ (compact) ---------- */
.service-card {
  display: flex; flex-direction: column;
  padding: 12px 13px;
  gap: 8px;
}
.service-card .svc-name {
  font-size: 13px; font-weight: 700; line-height: 1.35;
  margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 35px;
}
.service-card .svc-desc {
  font-size: 11.5px; color: var(--muted); line-height: 1.4; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 32px;
}
.service-card .svc-price {
  display: flex; align-items: baseline; justify-content: space-between; gap: 6px;
  background: var(--surface-tint); border-radius: var(--radius-sm);
  padding: 7px 10px;
}
.service-card .svc-price-label { font-size: 11px; color: var(--muted); font-weight: 600; }
.service-card .svc-price-value { font-size: 15.5px; font-weight: 800; color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.service-card .svc-meta {
  display: flex; justify-content: space-between; gap: 6px;
  font-size: 11.5px; color: var(--muted);
  padding-bottom: 2px;
}
.service-card .btn { min-height: 32px; font-size: 12.5px; padding: 5px 10px; margin-top: auto; }

/* Nhãn nhóm nhỏ trong card (section label) */
.card-label {
  display: block; font-size: 11px; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 8px;
}

/* Hàng info trong card nạp tiền — hover rõ ràng */
.copy-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px;
  border: 1px solid #EDF2FA;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: #fff;
  transition: border-color .2s ease, background-color .2s ease;
}
.copy-row:hover { border-color: var(--primary); background: var(--surface-tint); }
.copy-row .copy-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.copy-row .copy-value { font-size: 13.5px; font-weight: 700; text-align: right; word-break: break-all; }

/* QR khung */
.qr-frame {
  display: inline-block; padding: 10px;
  background: #fff; border: 1px solid var(--primary-light);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}

/* Toast */
.toast-wrap { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--text); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); font-size: 13.5px; max-width: 340px;
  animation: toast-in .2s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar-open .sidebar { transform: translateX(0); }
  .main { margin-left: 0; }
  .sidebar-collapsed .main { margin-left: 0; }
  .sidebar-collapsed .sidebar { width: var(--sidebar-w); }
  .sidebar-collapsed .sidebar-brand-text,
  .sidebar-collapsed .nav-group-title,
  .sidebar-collapsed .nav-item span,
  .sidebar-collapsed .nav-badge { display: initial; }
  .sidebar-collapsed .nav-item { justify-content: flex-start; padding: 7px 10px; }
  .sidebar-collapsed .nav-item-sub { display: flex; }

  /* Header landing: logo + 2 nút Đăng nhập/Đăng ký gọn vừa khung */
  .site-header-inner { gap: 6px; padding: 0 4px; }
  .site-header-inner .site-nav { display: none; }
  .site-header-inner .btn { min-height: 32px; padding: 4px 10px; font-size: 12px; white-space: nowrap; flex-shrink: 0; letter-spacing: -.01em; }
  .site-header-inner .topbar-spacer { display: none; }
  .site-header-inner { margin-left: auto; }

  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .site-nav { display: none; }

  .dash-hero { flex-direction: column; align-items: flex-start; gap: 10px; }
  .dash-hero-art { width: 100%; max-width: 320px; align-self: flex-end; margin: -30px 0 -18px; }
  .dash-main-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .section { padding: 44px 0; }
  .hero { padding: 52px 0 44px; }
  .content { padding: 14px 12px 32px; }

  /* Header landing: logo nhỏ lại, 2 nút gọn vừa khung */
  .site-header-inner { height: 52px; }
  .site-header-inner strong { font-size: 18px !important; }
  .site-header-inner img { width: 26px !important; height: 26px !important; }
  .site-header-inner .btn { min-height: 32px; padding: 4px 9px; font-size: 11.5px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .table { min-width: 620px; }
  .hero-stats { gap: 18px; }
  .card { padding: 13px; }
  .btn { min-height: 42px; }

  .dash-hero { padding: 20px 18px; }
  .dash-hero-art { max-width: 240px; }

  /* Chống tràn ngang toàn trang */
  body { overflow-x: hidden; }

  /* Nút hành động trong hero xếp dọc, full chiều rộng */
  .dash-hero-actions { flex-direction: column; align-items: stretch; width: 100%; }
  .dash-hero-actions .btn { width: 100%; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }

  /* Nút trong card xếp dọc thay vì chen nhau */
  .flex-between.flex-wrap { flex-direction: column; align-items: stretch; gap: 10px; }
  .flex-between.flex-wrap .btn { width: 100%; }

  /* Bảng cuộn ngang trong khung, không đẩy cả trang */
  .table-wrap { margin: 0 -13px; padding: 0 13px; }

  /* Form: input full chiều rộng, chữ đủ to để iOS không zoom */
  .form-input, .form-select, .form-textarea { font-size: 16px; }

  /* Hàng copy (nội dung CK, số TK) xuống dòng thay vì tràn */
  .copy-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .copy-row .copy-value { text-align: left; }

  /* QR không vượt khung */
  .qr-frame img { max-width: 100% !important; height: auto; }

  /* Thẻ hồ sơ mini full chiều rộng */
  .dash-profile { width: 100%; }

  /* Modal / dropdown không tràn màn hình */
  [data-dropdown-menu] { right: 0 !important; left: auto !important; max-width: calc(100vw - 24px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* =========================================================
   DASHBOARD — hero chào mừng + minh hoạ + thẻ hồ sơ
   ========================================================= */

/* Hero: khối tối neo trang (như page-hero-deep nhưng cao hơn, có minh hoạ) */
.dash-hero {
  display: flex; align-items: center; gap: 20px;
  background: var(--surface-deep); color: #fff;
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  margin-bottom: 16px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-md);
}
.dash-hero-text { flex: 1; min-width: 0; position: relative; z-index: 1; }
.dash-hero-eyebrow {
  font-size: 11.5px; font-weight: 600; letter-spacing: .04em;
  color: rgba(255,255,255,.55); margin: 0 0 4px;
}
.dash-hero-title {
  font-size: clamp(19px, 2.2vw, 24px); font-weight: 800;
  letter-spacing: -.015em; margin: 0 0 6px; color: #fff;
}
.dash-hero-sub { font-size: 13px; color: rgba(255,255,255,.75); margin: 0 0 14px; max-width: 52ch; }
.dash-hero-sub strong { color: #B9D3F5; }
.dash-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Nút trên nền tối */
.btn-light { background: #fff; color: var(--surface-deep); }
.btn-light:hover:not(:disabled) { background: var(--primary-light); transform: translateY(-1px); }
.btn-light svg { width: 15px; height: 15px; }
.btn-hero-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.btn-hero-ghost:hover:not(:disabled) { background: var(--surface-deep-soft); border-color: rgba(255,255,255,.6); }

/* Minh hoạ SVG — nằm phải, hơi tràn để cảm giác "đang bay" vào khối */
.dash-hero-art { flex-shrink: 0; width: 300px; margin-right: -6px; }
.dash-hero-art svg { display: block; width: 100%; height: auto; }

/* Lưới chính: thông báo rộng + hồ sơ hẹp bên phải */
.dash-main-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 264px;
  gap: 14px; align-items: start;
}

/* Hàng thông báo: icon tròn + 2 dòng chữ */
.dash-notify {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 8px; border-radius: var(--radius-sm);
  color: inherit; text-decoration: none;
  transition: background-color .2s ease;
}
.dash-notify + .dash-notify { border-top: 1px solid #EDF2FA; }
.dash-notify:hover { background: var(--surface-tint); }
.dash-notify-icon {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px;
  background: var(--primary-light); color: var(--primary-dark);
  display: inline-flex; align-items: center; justify-content: center;
}
.dash-notify-icon svg { width: 15px; height: 15px; }
.dash-notify-admin { background: #E7F7EE; color: var(--success); }
.dash-notify-body { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dash-notify-title { font-size: 13.5px; font-weight: 600; line-height: 1.35; }
a.dash-notify:hover .dash-notify-title { color: var(--primary-dark); }
.dash-notify-meta { font-size: 12px; color: var(--muted); }

/* Thẻ hồ sơ mini bên phải */
.dash-profile {
  background: var(--card); border: 1px solid #E3ECFB; border-radius: var(--radius-lg);
  padding: 22px 16px 16px; text-align: center;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.dash-profile-avatar {
  width: 62px; height: 62px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800;
  box-shadow: 0 0 0 5px var(--primary-light);
  margin-bottom: 4px;
}
.dash-profile-name { font-size: 15px; font-weight: 700; }
.dash-profile-badge {
  font-size: 11px; font-weight: 700; color: var(--primary-dark);
  background: var(--primary-light); border-radius: 999px; padding: 2px 10px;
  margin-bottom: 8px;
}
.dash-profile-row {
  width: 100%; display: flex; justify-content: space-between; gap: 8px;
  font-size: 13px; color: var(--muted);
  padding: 7px 2px; border-top: 1px solid #EDF2FA;
}
.dash-profile-row strong { color: var(--text); font-variant-numeric: tabular-nums; }
.dash-profile .btn { margin-top: 10px; }

/* Hàng đơn gần đây — dạng danh sách gọn thay bảng */
.dash-order-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 4px; border-top: 1px solid #EDF2FA;
}
.dash-order-row:first-of-type { border-top: none; }
.dash-order-id { font-weight: 700; font-size: 13.5px; flex-shrink: 0; }
.dash-order-service { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); }
.dash-order-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.dash-order-amount { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Link nhỏ dưới stat */
.stat-link { font-size: 12px; color: var(--primary); font-weight: 600; display: inline-block; margin-top: 2px; }
.stat-link:hover { color: var(--primary-dark); }
.stat-link-plain { color: var(--muted); cursor: default; }

/* =========================================================
   MOBILE — topbar gọn, không tràn nút (menu dùng ngăn kéo)
   ========================================================= */

/* Thẻ nền tảng trên landing — logo app thật to rõ */
.platform-card { padding: 18px 12px; }
.platform-logo-lg {
  width: 46px; height: 46px; margin: 0 auto 12px;
  border-radius: 12px; object-fit: contain; display: block;
  background: var(--primary-light);
  padding: 7px;
  transition: transform .2s ease;
}
.platform-card:hover .platform-logo-lg { transform: scale(1.08); }

/* Nạp tiền: cảnh báo dưới mức tối thiểu + trạng thái realtime */
.deposit-warn {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: 8px; padding: 9px 12px;
  background: #FDECEC; border: 1px solid #F7C9C9; border-radius: var(--radius-sm);
  color: var(--danger); font-size: 12.5px; font-weight: 600; line-height: 1.45;
}
.deposit-warn svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; }

.deposit-status {
  display: flex; align-items: center; gap: 9px;
  margin-top: 10px; padding: 10px 12px;
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  background: var(--surface-tint); border: 1px solid #C6DDFB; color: var(--primary-dark);
}
.deposit-status-success { background: #E7F7EE; border-color: #BFEACD; color: var(--success); }
.deposit-status-fail { background: #FDECEC; border-color: #F7C9C9; color: var(--danger); }
.deposit-status-dot {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary);
}
.deposit-status-success .deposit-status-dot { background: var(--success); }
.deposit-status-fail .deposit-status-dot { background: var(--danger); }
.deposit-status-dot.pulse { animation: deposit-pulse 1.4s ease-in-out infinite; }
@keyframes deposit-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(.75); }
}

@media (max-width: 1023px) {
  /* Topbar: gọn lại, không tràn nút */
  .topbar { padding: 0 10px; gap: 6px; }
  .topbar-title {
    font-size: 14px; font-weight: 700;
    max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .icon-btn { width: 34px; height: 34px; }
  .icon-btn svg { width: 17px; height: 17px; }
  .topbar-balance { padding: 5px 10px; font-size: 12px; gap: 4px; }
  .topbar-balance svg { width: 14px; height: 14px; }
}

/* =========================================================
   ADMIN DASHBOARD — việc cần xử lý + lưới trạng thái
   ========================================================= */

/* Ô "việc cần xử lý": số to + nhãn, viền đỏ khi có việc */
.admin-todo-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.admin-todo {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 14px 10px; border: 1px solid #E3ECFB; border-radius: var(--radius-sm);
  text-decoration: none; color: inherit; background: var(--bg);
  transition: border-color .2s ease, background-color .2s ease, transform .2s ease;
}
.admin-todo:hover { border-color: var(--primary); background: var(--surface-tint); transform: translateY(-1px); }
.admin-todo-hot { border-color: #F7C9C9; background: #FDECEC; }
.admin-todo-hot:hover { border-color: var(--danger); background: #FDECEC; }
.admin-todo-count { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--primary-dark); }
.admin-todo-hot .admin-todo-count { color: var(--danger); }
.admin-todo-label { font-size: 12.5px; color: var(--muted); font-weight: 600; text-align: center; }

/* Lưới trạng thái đơn — ô bấm được, đếm số */
.admin-status-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0; padding: 6px 0;
}
.admin-status-cell {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 16px; text-decoration: none; color: inherit;
  border-bottom: 1px solid #EDF2FA;
  transition: background-color .2s ease;
}
.admin-status-cell:hover { background: var(--surface-tint); }
.admin-status-num { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--primary-dark); }

