/* ==========================================================================
   TEMPLATE 2 — Demo tĩnh (ui-template-demo-4) — bản "Mềm" (lần 2, 2026-10-02)
   --------------------------------------------------------------------------
   - Bố cục: sidebar trái nổi (bo tròn) + topbar + nội dung — giữ khung đã chốt.
   - Diện mạo: mềm, bo tròn, thân thiện — nút/ô nhập/tab dạng viên thuốc, thẻ bo 24px,
     bóng đổ nhẹ pha sắc độ của màu chủ đạo, font Nunito (đầu chữ tròn, hỗ trợ tiếng Việt).
   - Trung tính: nền/viền/chữ là thang xám PHA SẮC ĐỘ (--primary-h) của màu admin chọn
     (độ bão hoà rất thấp) nên đổi màu chủ đạo thì cả giao diện ngả theo nhẹ nhàng.
     Không có màu thương hiệu cố định. Màu trạng thái (xanh lá/vàng/đỏ/xanh trời) cố định.
   - Class mới đặt tiền tố `t2-`. Class "hợp đồng" (phụ lục A FEAT-23) giữ
     đúng tên để JS/view hiện có dùng lại được.
   - Mỗi khối "SECTION" tương ứng 1 partial SCSS khi port sang
     resources/sass/template2/_*.scss.
   ========================================================================== */

/* ==========================================================================
   SECTION: variables
   ========================================================================== */
:root {
  --font-sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Consolas, monospace;

  /* Màu chủ đạo — admin chọn (ghi đè 3 biến này). Mặc định gợi ý #2563eb. */
  --primary-h: 221;
  --primary-s: 83%;
  --primary-l: 53%;

  --primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
  --primary-hover: hsl(var(--primary-h), var(--primary-s), calc(var(--primary-l) - 7%));
  --primary-active: hsl(var(--primary-h), var(--primary-s), calc(var(--primary-l) - 12%));
  --primary-soft: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.09);
  --primary-soft-2: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.16);
  --primary-ring: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.28);
  --primary-text: hsl(var(--primary-h), var(--primary-s), calc(var(--primary-l) - 8%));
  --on-primary: #ffffff;

  /* Thang xám pha sắc độ màu chủ đạo (bão hoà 8–20% — vẫn đọc là xám trung tính) */
  --n-0: #ffffff;
  --n-25: hsl(var(--primary-h), 20%, 99%);
  --n-50: hsl(var(--primary-h), 22%, 97%);
  --n-100: hsl(var(--primary-h), 20%, 94.5%);
  --n-150: hsl(var(--primary-h), 16%, 91%);
  --n-200: hsl(var(--primary-h), 14%, 86%);
  --n-300: hsl(var(--primary-h), 11%, 76%);
  --n-400: hsl(var(--primary-h), 8%, 62%);
  --n-500: hsl(var(--primary-h), 7%, 46%);
  --n-600: hsl(var(--primary-h), 8%, 36%);
  --n-700: hsl(var(--primary-h), 10%, 26%);
  --n-800: hsl(var(--primary-h), 12%, 17%);
  --n-900: hsl(var(--primary-h), 16%, 11%);

  /* Token ngữ nghĩa (đổi theo sáng/tối) */
  --bg: hsl(var(--primary-h), 24%, 96%);
  --surface: #ffffff;
  --surface-2: var(--n-50);
  --surface-3: var(--n-100);
  --border: var(--n-150);
  --border-strong: var(--n-200);
  --text: var(--n-900);
  --text-2: var(--n-600);
  --text-3: var(--n-500);
  --text-4: var(--n-400);
  --hover: var(--n-100);

  /* Trạng thái */
  --success: #059669;  --success-bg: #ecfdf5; --success-bd: #c9f2df; --success-tx: #047857;
  --warning: #d97706;  --warning-bg: #fffbeb; --warning-bd: #fbe6b0; --warning-tx: #a35a04;
  --danger:  #e11d48;  --danger-bg:  #fff1f3; --danger-bd:  #fdd0d9; --danger-tx:  #be123c;
  --info:    #0284c7;  --info-bg:    #f0f9ff; --info-bd:    #c7e8fb; --info-tx:    #0369a1;

  /* Bo góc mềm: càng lớn càng "bông" */
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 999px;

  /* Bóng đổ nhẹ, ngả sắc độ màu chủ đạo (không dùng xám thuần) */
  --shadow-rgb: 40, 44, 70;
  --sh-1: 0 1px 2px rgba(var(--shadow-rgb), 0.05), 0 1px 1px rgba(var(--shadow-rgb), 0.03);
  --sh-2: 0 2px 4px rgba(var(--shadow-rgb), 0.04), 0 10px 24px -8px rgba(var(--shadow-rgb), 0.12);
  --sh-pop: 0 24px 48px -12px rgba(var(--shadow-rgb), 0.28), 0 4px 12px rgba(var(--shadow-rgb), 0.08);

  --topbar-h: 68px;
  --container: 1320px;
  --gutter: 24px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

html.dark-mode {
  --primary-soft: hsla(var(--primary-h), var(--primary-s), calc(var(--primary-l) + 8%), 0.14);
  --primary-soft-2: hsla(var(--primary-h), var(--primary-s), calc(var(--primary-l) + 8%), 0.22);
  --primary-text: hsl(var(--primary-h), var(--primary-s), calc(var(--primary-l) + 18%));

  --shadow-rgb: 0, 0, 0;
  --bg: hsl(var(--primary-h), 14%, 8%);
  --surface: hsl(var(--primary-h), 12%, 11.5%);
  --surface-2: hsl(var(--primary-h), 12%, 14%);
  --surface-3: hsl(var(--primary-h), 12%, 17.5%);
  --border: hsl(var(--primary-h), 10%, 19%);
  --border-strong: hsl(var(--primary-h), 10%, 26%);
  --text: hsl(var(--primary-h), 15%, 93%);
  --text-2: hsl(var(--primary-h), 9%, 74%);
  --text-3: hsl(var(--primary-h), 7%, 58%);
  --text-4: hsl(var(--primary-h), 6%, 45%);
  --hover: hsl(var(--primary-h), 12%, 16%);

  --success-bg: rgba(16, 185, 129, 0.12); --success-bd: rgba(16, 185, 129, 0.28); --success-tx: #34d399;
  --warning-bg: rgba(245, 158, 11, 0.12); --warning-bd: rgba(245, 158, 11, 0.28); --warning-tx: #fbbf24;
  --danger-bg:  rgba(244, 63, 94, 0.12);  --danger-bd:  rgba(244, 63, 94, 0.30);  --danger-tx:  #fb7185;
  --info-bg:    rgba(14, 165, 233, 0.12); --info-bd:    rgba(14, 165, 233, 0.28); --info-tx:    #38bdf8;

  --sh-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --sh-2: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 18px -6px rgba(0, 0, 0, 0.5);
  --sh-pop: 0 20px 44px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--border);
  color-scheme: dark;
}

/* ==========================================================================
   SECTION: base
   ========================================================================== */
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6 { color: var(--text); font-weight: 700; letter-spacing: -0.01em; }
a { color: var(--primary-text); }
a:hover { color: var(--primary-hover); text-decoration: none; }
hr { border-color: var(--border); }
::selection { background: var(--primary-soft-2); }
code, .font-mono { font-family: var(--font-mono) !important; font-size: 0.92em; }
code { color: var(--text); background: var(--surface-3); padding: 1px 6px; border-radius: 5px; }
.tnum { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
button:focus { outline: none; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }
/* ==========================================================================
   SECTION: layout-shell (sidebar trái cố định + topbar + vùng nội dung + footer)
   Cùng khung với template Mặc định (app-layout > app-sidebar + app-main > app-topbar + app-content),
   chỉ khác diện mạo. Giữ nguyên tên class khung để port không phải đổi cấu trúc.
   ========================================================================== */
:root { --sidebar-w: 288px; --sidebar-gap: 14px; }
.t2-container { width: 100%; }

.app-layout { display: flex; min-height: 100vh; width: 100%; position: relative; background: var(--bg); }
.app-main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; min-height: 100vh; transition: margin-left .25s var(--ease); }
.app-content, .t2-main { padding: 8px 32px 32px; flex: 1; min-width: 0; }

/* ---------- Sidebar: bảng điều hướng nổi, bo tròn ---------- */
.app-sidebar {
  width: calc(var(--sidebar-w) - var(--sidebar-gap)); position: fixed; top: var(--sidebar-gap); bottom: var(--sidebar-gap); left: var(--sidebar-gap); z-index: 1040;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--sh-2);
  display: flex; flex-direction: column; overflow: hidden; transition: transform .25s var(--ease);
}
.sidebar-header { height: 76px; padding: 0 20px; display: flex; align-items: center; flex-shrink: 0; }
.brand-logo { display: flex; align-items: center; gap: 12px; color: var(--text); min-width: 0; }
.brand-logo:hover { color: var(--text); }
.brand-icon {
  width: 42px; height: 42px; border-radius: 15px; background: var(--primary); color: var(--on-primary); flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; font-size: 18px;
  box-shadow: 0 8px 16px -6px hsla(var(--primary-h), var(--primary-s), var(--primary-l), .6), inset 0 -3px 0 rgba(0,0,0,.12);
}
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.brand-text span { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { font-size: 12px; color: var(--text-3); font-weight: 600; margin-top: 2px; }

.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 14px 16px; scrollbar-width: thin; }
.nav-group-title { font-size: 12.5px; font-weight: 700; color: var(--text-3); padding: 18px 10px 6px; }
.nav-group-title:first-child { padding-top: 6px; }

.nav-item-link {
  display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px 0 8px; border-radius: var(--r-full);
  color: var(--text-2); font-weight: 700; font-size: 14px; position: relative; cursor: pointer; transition: background .15s, color .15s;
}
.nav-item-link > span:not(.badge-modern) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Biểu tượng nằm trong "viên" tròn; mục đang chọn đổ màu chủ đạo */
.nav-icon { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); display: inline-flex; align-items: center; justify-content: center; color: var(--text-3); font-size: 12.5px; flex-shrink: 0; transition: color .15s, background .15s, box-shadow .15s; }
.nav-item-link:hover { background: var(--hover); color: var(--text); }
.nav-item-link:hover .nav-icon { color: var(--text-2); background: var(--surface); box-shadow: var(--sh-1); }
.nav-item-link.active { background: var(--primary-soft); color: var(--primary-text); font-weight: 700; }
.nav-item-link.active .nav-icon { background: var(--primary); color: var(--on-primary); box-shadow: 0 6px 12px -4px hsla(var(--primary-h), var(--primary-s), var(--primary-l), .6); }
.nav-arrow, .nav-sub-arrow { font-size: 10px; color: var(--text-4); transition: transform .2s var(--ease); margin-left: auto; flex-shrink: 0; }
.nav-item-dropdown.open > .nav-item-link .nav-arrow,
.nav-sub-dropdown.open > .nav-sub-link .nav-sub-arrow { transform: rotate(90deg); }
.nav-item-dropdown.open > .nav-item-link { color: var(--text); }
.nav-item-dropdown.has-active-child > .nav-item-link { color: var(--text); }
.nav-item-dropdown.has-active-child > .nav-item-link .nav-icon { background: var(--primary-soft-2); color: var(--primary-text); }
.nav-item-link .badge-modern { height: 19px; font-size: 11px !important; padding: 0 7px !important; }
.nav-item-link .badge-modern::before { display: none; }

/* Menu con — đường dẫn dọc mảnh thay cho thụt lề dày */
.nav-submenu, .nav-sub-submenu { display: none; position: relative; margin: 2px 0 6px 22px; padding-left: 10px; border-left: 2px solid var(--border); }
.nav-item-dropdown.open > .nav-submenu, .nav-sub-dropdown.open > .nav-sub-submenu { display: block; }
.nav-sub-submenu { margin-left: 12px; }

.nav-sub-link, .nav-sub-sub-link {
  display: flex; align-items: center; gap: 9px; min-height: 34px; padding: 0 12px; border-radius: var(--r-full); color: var(--text-2); font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: background .12s, color .12s;
}
.nav-sub-link > span:not(.nav-sub-bullet):not(.t2-count), .nav-sub-sub-link > span:not(.nav-sub-sub-bullet):not(.t2-count) { flex: 1; min-width: 0; line-height: 1.35; padding: 5px 0; }
.nav-sub-link:hover, .nav-sub-sub-link:hover { background: var(--hover); color: var(--text); }
.nav-sub-link.active, .nav-sub-sub-link.active { color: var(--primary-text); font-weight: 650; background: var(--primary-soft); }
.nav-sub-bullet, .nav-sub-sub-bullet { width: 5px; height: 5px; border-radius: 50%; background: var(--n-300); flex-shrink: 0; transition: background .12s; }
html.dark-mode .nav-sub-bullet, html.dark-mode .nav-sub-sub-bullet { background: #4a4a53; }
.nav-sub-link:hover .nav-sub-bullet, .nav-sub-sub-link:hover .nav-sub-sub-bullet { background: var(--text-3); }
.nav-sub-link.active .nav-sub-bullet, .nav-sub-sub-link.active .nav-sub-sub-bullet { background: var(--primary); }
.nav-sub-dropdown.has-active-child > .nav-sub-link { color: var(--text); font-weight: 600; }
.nav-sub-link .t2-count, .nav-sub-sub-link .t2-count {
  font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 20px; height: 18px; padding: 0 6px; line-height: 18px; text-align: center;
  border-radius: var(--r-full); background: var(--surface-3); color: var(--text-3); margin-left: auto; flex: 0 0 auto;
}
.nav-sub-sub-link .t2-count.is-on { background: var(--success-bg); color: var(--success-tx); }
.nav-sub-sub-link .t2-count.is-warn { background: var(--warning-bg); color: var(--warning-tx); }

/* Thẻ số dư cuối sidebar */
.t2-side-foot { padding: 0 14px 14px; flex-shrink: 0; }
.t2-side-card { border-radius: var(--r-lg); padding: 16px; background: var(--primary-soft); position: relative; overflow: hidden; }
.t2-side-card::after { content: ""; position: absolute; right: -22px; top: -22px; width: 84px; height: 84px; border-radius: 50%; background: var(--primary-soft-2); }
.t2-side-card > * { position: relative; z-index: 1; }
.t2-side-card small { display: block; font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.t2-side-card b { display: block; font-size: 21px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; margin: 1px 0 12px; }
.t2-side-card .btn-modern { height: 36px; }

.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(10, 10, 12, .45); z-index: 1035; }
.sidebar-backdrop.active { display: block; }
body.sidebar-collapsed .app-sidebar { transform: translateX(calc(-100% - 24px)); }
body.sidebar-collapsed .app-main { margin-left: 0; }

/* ---------- Topbar ---------- */
.app-topbar {
  height: var(--topbar-h); position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 32px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar-quick-actions { display: flex; align-items: center; gap: 6px; margin-left: 6px; }

/* Nút tròn nổi trên nền, thay vì ô vuông phẳng */
.btn-sidebar-toggle, .btn-topbar-icon, .t2-icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; box-shadow: var(--sh-1);
  display: inline-flex; align-items: center; justify-content: center; position: relative; font-size: 15px; transition: background .15s, color .15s, box-shadow .15s, transform .15s; flex-shrink: 0;
}
.btn-sidebar-toggle:hover, .btn-topbar-icon:hover, .t2-icon-btn:hover, .btn-topbar-icon[aria-expanded="true"] { background: var(--surface); color: var(--primary-text); box-shadow: var(--sh-2); }
.btn-topbar-action {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: var(--r-full); color: var(--text-2); font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--sh-1); transition: box-shadow .15s, color .15s;
}
.btn-topbar-action i:first-child { color: var(--primary-text); font-size: 13px; }
.btn-topbar-action:hover, .btn-topbar-action[aria-expanded="true"] { color: var(--text); box-shadow: var(--sh-2); }
.btn-topbar-action-caret { font-size: 9px; color: var(--text-4); }
.topbar-quick-menu { min-width: 250px; max-height: 70vh; overflow-y: auto; }
.topbar-badge {
  position: absolute; top: 0; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 10px; background: var(--danger); color: #fff;
  font-size: 10.5px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 3px var(--bg);
}
.theme-icon-sun { display: none; }
html.dark-mode .theme-icon-sun { display: inline-block; }
html.dark-mode .theme-icon-moon { display: none; }

.user-quick-profile { display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px 0 4px; border-radius: var(--r-full); cursor: pointer; color: var(--text); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--sh-1); transition: box-shadow .15s; }
.user-quick-profile:hover, .user-quick-profile[aria-expanded="true"] { box-shadow: var(--sh-2); }
.user-avatar-box, .t2-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: var(--on-primary);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.t2-avatar-lg { width: 48px; height: 48px; font-size: 18px; }
.user-quick-profile .t2-uname { font-size: 13.5px; font-weight: 700; line-height: 1.2; }
.user-quick-profile .t2-ubal { font-size: 12px; color: var(--success-tx); font-weight: 700; line-height: 1.2; }
.user-profile-dropdown-menu { min-width: 280px; padding: 0; overflow: hidden; }
.user-profile-dropdown-menu .t2-user-head { padding: 16px; background: var(--primary-soft); }
.user-profile-dropdown-menu .t2-user-body { padding: 8px; }

/* ---------- Tiêu đề trang + breadcrumb ---------- */
.t2-page-head, .page-title-row { padding: 6px 0 26px; }
.t2-page-head .t2-container, .page-title-row { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.t2-crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-3); margin-bottom: 8px; flex-wrap: wrap; }
.t2-crumb a { color: var(--text-3); }
.t2-crumb a:hover { color: var(--primary-text); }
.t2-crumb .sep { color: var(--text-4); font-size: 9px; }
.t2-page-title, .page-title { font-size: 28px; font-weight: 700; margin: 0; letter-spacing: -0.02em; line-height: 1.25; }
.t2-page-sub { color: var(--text-2); margin: 6px 0 0; font-size: 14.5px; }
.t2-page-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Footer ---------- */
.t2-footer { font-size: 12px; color: var(--text-3); text-align: center; padding: 18px 16px 22px; }
.t2-footer .t2-footer-icons { display: flex; align-items: center; justify-content: center; gap: 4px; margin-bottom: 6px; }

/* Liên kết dạng thẻ (dùng ở trang danh mục demo) */
.t2-pop-link { display: flex; align-items: flex-start; gap: 12px; padding: 9px 10px; border-radius: var(--r); color: var(--text); transition: background .12s; }
.t2-pop-link:hover { background: var(--hover); color: var(--text); }
.t2-pop-link .t2-pop-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-3); color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 13px; }
.t2-pop-link:hover .t2-pop-icon { background: var(--primary-soft); color: var(--primary-text); }
.t2-pop-link b { display: block; font-weight: 600; font-size: 13px; line-height: 1.3; }
.t2-pop-link span:not(.t2-pop-icon) { display: block; font-size: 12px; color: var(--text-3); line-height: 1.4; margin-top: 2px; }

/* ==========================================================================
   SECTION: buttons (hợp đồng)
   ========================================================================== */
.btn-modern, .btn-primary-modern, .btn-white-modern, .btn-emerald-modern, .btn-amber-modern, .btn-rose-modern {
  display: inline-flex !important; align-items: center; justify-content: center; gap: 7px;
  height: 42px; padding: 0 20px !important; border-radius: var(--r-full) !important;
  font-size: 14px !important; font-weight: 600 !important; line-height: 1 !important; white-space: nowrap;
  border: 1px solid transparent !important; box-shadow: none !important;
  transition: background .15s, border-color .15s, color .15s, box-shadow .2s, transform .15s var(--ease);
  cursor: pointer;
}
.btn-modern:hover { transform: translateY(-1px); }
.btn-modern:active { transform: translateY(1px); }
.btn-modern:focus-visible { box-shadow: 0 0 0 4px var(--primary-ring) !important; outline: none; }
.btn-modern.btn-sm, .btn-sm.btn-modern { height: 34px; padding: 0 14px !important; font-size: 13px !important; gap: 6px; }
.btn-modern.btn-lg { height: 52px; padding: 0 28px !important; font-size: 15.5px !important; }
.btn-modern.btn-block { display: flex !important; width: 100%; }
.btn-modern i { font-size: .95em; }
.btn-modern .mr-1, .btn-modern .mr-2 { margin-right: 0 !important; }

/* Nút chính có bóng "phát sáng" nhẹ theo màu chủ đạo */
.btn-primary-modern { background: var(--primary) !important; color: var(--on-primary) !important; box-shadow: 0 8px 18px -8px hsla(var(--primary-h), var(--primary-s), var(--primary-l), .75), inset 0 -2px 0 rgba(0,0,0,.1) !important; }
.btn-primary-modern:hover { background: var(--primary-hover) !important; color: var(--on-primary) !important; }
.btn-primary-modern:focus-visible { box-shadow: 0 0 0 4px var(--primary-ring) !important; }

.btn-white-modern { background: var(--surface) !important; color: var(--text) !important; border-color: var(--border-strong) !important; box-shadow: var(--sh-1) !important; }
.btn-white-modern:hover { background: var(--surface) !important; color: var(--primary-text) !important; border-color: var(--primary) !important; }

.btn-emerald-modern { background: var(--success) !important; color: #fff !important; box-shadow: 0 8px 18px -8px rgba(5, 150, 105, .7) !important; }
.btn-emerald-modern:hover { filter: brightness(.93); color: #fff !important; }
.btn-amber-modern { background: var(--warning-bg) !important; color: var(--warning-tx) !important; border-color: var(--warning-bd) !important; }
.btn-amber-modern:hover { background: var(--warning-bd) !important; color: var(--warning-tx) !important; }
.btn-rose-modern { background: var(--danger) !important; color: #fff !important; box-shadow: 0 8px 18px -8px rgba(225, 29, 72, .7) !important; }
.btn-rose-modern:hover { filter: brightness(.93); color: #fff !important; }

/* Biến thể mới của Template 2 */
.t2-btn-ghost { background: transparent !important; color: var(--text-2) !important; border-color: transparent !important; }
.t2-btn-ghost:hover { background: var(--hover) !important; color: var(--text) !important; }
.t2-btn-soft { background: var(--primary-soft) !important; color: var(--primary-text) !important; }
.t2-btn-soft:hover { background: var(--primary-soft-2) !important; color: var(--primary-text) !important; }

.btn-modern:disabled, .btn-modern.disabled { opacity: .55; pointer-events: none; }

/* Nút icon nhỏ trong bảng (btn-icon-sm, btn-action-menu, copy...) */
.btn-icon-sm, .t2-icon-sm {
  width: 34px; height: 34px; padding: 0 !important; border-radius: 50% !important;
  display: inline-flex !important; align-items: center; justify-content: center; font-size: 13px !important;
  background: transparent; border: 1px solid transparent; color: var(--text-3); cursor: pointer; transition: background .12s, color .12s;
}
.btn-icon-sm:hover, .t2-icon-sm:hover { background: var(--hover); color: var(--text); }
.btn-copy-ip, .btn-copy-passwd, .btn-toggle-passwd-vps, .btn-copy-text {
  border: 0; background: transparent; color: var(--text-4); width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; cursor: pointer; vertical-align: middle;
}
.btn-copy-ip:hover, .btn-copy-passwd:hover, .btn-toggle-passwd-vps:hover, .btn-copy-text:hover { background: var(--hover); color: var(--text); }
.btn-copy-ip.is-copied, .btn-copy-passwd.is-copied, .btn-copy-text.is-copied { color: var(--success); }
.btn-action-menu { border: 1px solid var(--border-strong) !important; background: var(--surface) !important; color: var(--text-2) !important; }
.btn-action-menu:hover { color: var(--text) !important; background: var(--surface-2) !important; }

.btn-social-auth {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 48px;
  border-radius: var(--r-full); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 700; font-size: 14.5px; box-shadow: var(--sh-1);
}
.btn-social-auth:hover { border-color: var(--primary); color: var(--primary-text); }
.btn-theme-toggle { }

.btn-banner-ghost { background: transparent !important; color: inherit !important; border-color: currentColor !important; opacity: .85; }
.btn-banner-close { border: 0; background: transparent; color: inherit; opacity: .6; }
.btn-banner-close:hover { opacity: 1; }

/* ==========================================================================
   SECTION: badges (hợp đồng)
   ========================================================================== */
.badge-modern {
  display: inline-flex !important; align-items: center; gap: 6px; padding: 0 11px !important; height: 26px;
  border-radius: var(--r-full) !important; font-size: 12.5px !important; font-weight: 600 !important; line-height: 1 !important;
  border: 1px solid transparent; background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}
.badge-modern::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge-modern.t2-no-dot::before, .badge-white-modern::before { display: none; }
.badge-emerald-modern { background: var(--success-bg) !important; color: var(--success-tx) !important; border-color: var(--success-bd) !important; }
.badge-amber-modern { background: var(--warning-bg) !important; color: var(--warning-tx) !important; border-color: var(--warning-bd) !important; }
.badge-rose-modern { background: var(--danger-bg) !important; color: var(--danger-tx) !important; border-color: var(--danger-bd) !important; }
.badge-sky-modern { background: var(--info-bg) !important; color: var(--info-tx) !important; border-color: var(--info-bd) !important; }
.badge-indigo-modern { background: var(--primary-soft) !important; color: var(--primary-text) !important; border-color: var(--primary-soft-2) !important; }
.badge-white-modern { background: var(--surface) !important; color: var(--text-2) !important; border-color: var(--border-strong) !important; }

.t2-tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px; border-radius: var(--r-full); background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 700; }
.t2-tag-primary { background: var(--primary-soft); color: var(--primary-text); }

/* ==========================================================================
   SECTION: alerts & banner (hợp đồng)
   ========================================================================== */
.alert-emerald-modern, .alert-amber-modern, .alert-rose-modern, .alert-indigo-modern, .t2-alert {
  display: flex; gap: 14px; align-items: flex-start; padding: 16px 20px; border-radius: var(--r-lg) !important;
  font-size: 14px; border: 1px solid; margin-bottom: 20px;
}
.alert-emerald-modern { background: var(--success-bg) !important; border-color: var(--success-bd) !important; color: var(--success-tx) !important; }
.alert-amber-modern { background: var(--warning-bg) !important; border-color: var(--warning-bd) !important; color: var(--warning-tx) !important; }
.alert-rose-modern { background: var(--danger-bg) !important; border-color: var(--danger-bd) !important; color: var(--danger-tx) !important; }
.alert-indigo-modern { background: var(--primary-soft) !important; border-color: var(--primary-soft-2) !important; color: var(--primary-text) !important; }
.alert-emerald-modern > i, .alert-amber-modern > i, .alert-rose-modern > i, .alert-indigo-modern > i { margin-top: 3px; }
.t2-alert-title { font-weight: 700; display: block; margin-bottom: 2px; color: inherit; }
.t2-alert-body { flex: 1; min-width: 0; }
.t2-alert-body p { margin: 0; color: inherit; opacity: .92; }
.t2-alert-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; align-self: center; }

.modern-banner {
  position: relative; overflow: hidden; border-radius: var(--r-xl); border: 1px solid var(--border);
  background: var(--surface); box-shadow: var(--sh-2); padding: 28px 32px; display: flex; gap: 24px; align-items: center;
}
.modern-banner-image { max-height: 120px; }
.banner-badge { background: var(--primary-soft) !important; color: var(--primary-text) !important; border-color: transparent !important; }
.banner-highlight { color: var(--primary-text); }
.banner-alert { }
.pulse-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--success); position: relative; }
.pulse-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--success); opacity: 0; animation: t2-pulse 1.8s ease-out infinite; }
@keyframes t2-pulse { 0% { transform: scale(.5); opacity: .8; } 100% { transform: scale(1.6); opacity: 0; } }

/* ==========================================================================
   SECTION: cards (hợp đồng + t2-panel)
   ========================================================================== */
.modern-card, .t2-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl);
  box-shadow: var(--sh-2); margin-bottom: 24px; min-width: 0;
}
.modern-card.p-0, .t2-panel.p-0 { overflow: hidden; }
.modern-card > .card-body { padding: 24px; }
.card { background: var(--surface); border-color: var(--border); border-radius: var(--r-xl); color: var(--text); }
.card-header, .card-footer { background: transparent; border-color: var(--border); }

.t2-panel-head {
  display: flex; align-items: center; gap: 8px 12px; padding: 20px 24px 8px; min-height: 64px; flex-wrap: wrap;
}
.t2-panel-title { font-size: 17px; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 10px; }
.t2-panel-title > i { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-text); font-size: 13px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.t2-panel-sub { font-size: 13px; color: var(--text-3); margin: 2px 0 0; }
.t2-panel-tools { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.t2-panel-body { padding: 16px 24px 24px; }
.t2-panel-foot { padding: 16px 24px; background: var(--surface-2); border-radius: 0 0 var(--r-xl) var(--r-xl); }
.section-block-title { font-size: 15px; font-weight: 700; color: var(--text); margin: 0 0 14px; }

/* Ô số liệu (metric-card hợp đồng) — icon tròn lớn, số to */
.metric-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 20px 22px;
  box-shadow: var(--sh-2); height: 100%; display: flex; flex-direction: column; gap: 14px; position: relative; color: var(--text);
  transition: box-shadow .2s, transform .2s var(--ease);
}
a.metric-card:hover { transform: translateY(-3px); box-shadow: var(--sh-pop); color: var(--text); }
.metric-card-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.metric-card-label { font-size: 13.5px; font-weight: 700; color: var(--text-3); }
.metric-card-value { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.metric-card-value small { font-size: 15px; font-weight: 700; color: var(--text-3); margin-left: 3px; }
.metric-icon-box {
  width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-3); color: var(--text-2); font-size: 16px;
}
.metric-icon-box.bg-primary-50 { background: var(--primary-soft) !important; color: var(--primary-text) !important; }
.metric-icon-box.bg-emerald-50 { color: var(--success-tx); }
.metric-icon-box.bg-amber-50 { color: var(--warning-tx); }
.metric-icon-box.bg-rose-50 { color: var(--danger-tx); }
.metric-icon-box.bg-sky-50 { color: var(--info-tx); }
.t2-metric-foot { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; margin-top: auto; }
.t2-delta-up { color: var(--success-tx); font-weight: 600; }
.t2-delta-down { color: var(--danger-tx); font-weight: 600; }

/* ==========================================================================
   SECTION: forms (hợp đồng)
   ========================================================================== */
.form-label-modern { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.form-label-modern .t2-hint { font-weight: 400; color: var(--text-3); font-size: 12px; }
.form-label-modern.t2-label-inline { justify-content: flex-start; gap: 8px; }
.modern-input, .modern-select, .modern-textarea, .form-control {
  width: 100%; height: 46px; padding: 0 18px; border-radius: var(--r) !important; border: 1.5px solid var(--border-strong) !important;
  background: var(--surface) !important; color: var(--text) !important; font-size: 14.5px; font-weight: 600; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.modern-textarea, textarea.form-control { height: auto; min-height: 110px; padding: 14px 18px; line-height: 1.55; resize: vertical; border-radius: var(--r-lg) !important; }
.modern-select, select.form-control {
  appearance: none; -webkit-appearance: none; padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717c' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: right 16px center !important;
}
.modern-input::placeholder, .modern-textarea::placeholder, .form-control::placeholder { color: var(--text-4); font-weight: 500; }
.modern-input:hover, .modern-select:hover, .modern-textarea:hover { border-color: var(--text-4) !important; }
.modern-input:focus, .modern-select:focus, .modern-textarea:focus, .form-control:focus {
  outline: none; border-color: var(--primary) !important; box-shadow: 0 0 0 4px var(--primary-ring) !important;
}
.modern-input:disabled, .modern-input[readonly] { background: var(--surface-2) !important; color: var(--text-2) !important; }
.modern-input.is-invalid, .modern-select.is-invalid, .modern-textarea.is-invalid { border-color: var(--danger) !important; }
.t2-panel[id], .modern-card[id] { scroll-margin-top: calc(var(--topbar-h) + 16px); }
.modern-input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(225, 29, 72, .2) !important; }
.t2-field-error { font-size: 12px; color: var(--danger-tx); margin-top: 5px; display: flex; gap: 6px; align-items: center; }
.t2-field-help { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.modern-input-sm, .modern-select-sm { height: 38px !important; font-size: 13.5px !important; padding: 0 14px; border-radius: var(--r-full) !important; }
.modern-select-sm { padding-right: 34px; background-position: right 12px center !important; }

.modern-input-group { position: relative; display: flex; align-items: center; min-width: 0; }
.modern-input-group .modern-input { flex: 1; min-width: 0; }
.modern-input-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--text-4); font-size: 14px; pointer-events: none; z-index: 2; }
.modern-input-with-icon { padding-left: 46px !important; }
.modern-input-group-sm .modern-input-icon { left: 14px; font-size: 12.5px; }
.modern-input-group-sm .modern-input-with-icon { padding-left: 38px !important; }
.t2-input-addon { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }

/* Switch (custom-control hợp đồng). Bootstrap trong repo là 4.0.0-beta.3: KHÔNG có .custom-switch, và
   ::before/::after của nhãn định vị theo PADDING BOX của .custom-control (cha), left:0 — không theo nhãn.
   Vì vậy track đặt left:0 trong vùng padding-left của .custom-control (giống polyfill ở theme2/_forms.scss). */
.custom-switch { padding-left: 54px; min-height: 26px; flex-shrink: 0; display: block; }
.custom-switch:has(.custom-control-label:empty) { padding-left: 44px; }
.custom-switch .custom-control-label::before { left: 0; top: 0; width: 44px; height: 26px; border: 0; border-radius: 26px; background: var(--n-300); transition: background .2s; }
html.dark-mode .custom-switch .custom-control-label::before { background: var(--border-strong); }
.custom-switch .custom-control-label::after { left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.25); transition: transform .2s var(--ease); }
.custom-switch .custom-control-input:checked ~ .custom-control-label::before { background: var(--primary); }
.custom-switch .custom-control-input:checked ~ .custom-control-label::after { transform: translateX(18px); background-image: none; }
.custom-switch .custom-control-input:focus ~ .custom-control-label::before { box-shadow: 0 0 0 4px var(--primary-ring); }
.custom-checkbox .custom-control-label::before, .custom-radio .custom-control-label::before { top: 2px; width: 20px; height: 20px; border: 1.5px solid var(--border-strong); background: var(--surface); }
.custom-checkbox .custom-control-label::after, .custom-radio .custom-control-label::after { top: 2px; width: 20px; height: 20px; }
.custom-checkbox, .custom-radio { padding-left: 30px; }
.t2-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.t2-switch-row > div:first-child { flex: 1; min-width: 0; }
.custom-control-label { color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; }
.custom-checkbox .custom-control-label::before { border-radius: 7px; border-color: var(--border-strong); background: var(--surface); }
.custom-control-input:checked ~ .custom-control-label::before { background: var(--primary); border-color: var(--primary); }
.custom-radio .custom-control-input:checked ~ .custom-control-label::before { background: var(--primary); border-color: var(--primary); }

input[type="checkbox"].t2-check, .modern-table input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; vertical-align: middle; }

/* Select2 (đang dùng ở form hồ sơ) — chỉnh nhẹ cho khớp input */
.select2-container--default .select2-selection--single { height: 46px; border-radius: var(--r); border: 1.5px solid var(--border-strong); background: var(--surface); }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 43px; color: var(--text); padding-left: 18px; }
.select2-dropdown { background: var(--surface); border-color: var(--border-strong); border-radius: var(--r); color: var(--text); }

/* ==========================================================================
   SECTION: tables & pagination (hợp đồng)
   ========================================================================== */
.table { color: var(--text); margin-bottom: 0; }
.table-responsive { border-radius: inherit; }
.modern-table { width: 100%; font-size: 14px; border-collapse: separate; border-spacing: 0; }
/* Đầu bảng là một dải bo tròn; hàng được hover bo tròn hai đầu */
.modern-table thead th {
  background: var(--surface-2); color: var(--text-3); font-size: 13px; font-weight: 700;
  border-top: 0 !important; border-bottom: 0 !important; padding: 12px 16px !important; white-space: nowrap; vertical-align: middle;
}
.modern-table thead th:first-child { border-radius: var(--r) 0 0 var(--r); padding-left: 24px !important; }
.modern-table thead th:last-child { border-radius: 0 var(--r) var(--r) 0; padding-right: 24px !important; }
.modern-table tbody td { padding: 16px !important; border-top: 0 !important; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text); }
.modern-table tbody td:first-child { padding-left: 24px !important; }
.modern-table tbody td:last-child { padding-right: 24px !important; }
.modern-table tbody tr:last-child td { border-bottom: 0; }
.modern-table tbody tr { transition: background .1s; }
.modern-table tbody tr:hover td { background: var(--primary-soft); border-color: transparent; }
.modern-table tbody tr:hover td:first-child { border-radius: var(--r) 0 0 var(--r); }
.modern-table tbody tr:hover td:last-child { border-radius: 0 var(--r) var(--r) 0; }
.modern-table tbody tr.t2-row-selected td { background: var(--primary-soft); }
.modern-table .t2-cell-main { font-weight: 700; color: var(--text); }
.modern-table .t2-cell-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.modern-table .t2-col-actions { text-align: right; white-space: nowrap; }
.modern-table .btn-modern { height: 32px; padding: 0 14px !important; font-size: 12.5px !important; }
.t2-empty-row td { text-align: center; padding: 48px 16px !important; color: var(--text-3); }

.table-toolbar-top { padding: 16px 24px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.border-bottom { border-bottom: 1px solid var(--border) !important; }
.border-top { border-top: 1px solid var(--border) !important; }
.border-slate-100, .border-slate-200 { border-color: var(--border) !important; }

.table-pagination-bar { padding: 16px 24px; background: var(--surface); font-size: 13.5px; color: var(--text-3); border-radius: 0 0 var(--r-xl) var(--r-xl); }
.table-pagination-bar.is-hidden { display: none !important; }
.table-pagination-bottom { display: flex !important; flex-direction: row !important; align-items: center !important; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.table-pagination-info { font-size: 12.5px; color: var(--text-3); }
.table-pagination-info span { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.page-size-select { width: auto !important; display: inline-block; }

.pagination { margin: 0; gap: 4px; flex-wrap: wrap; }
.pagination .page-link, .pagination li > a, .pagination li > span {
  min-width: 36px; height: 36px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-full) !important; border: 1px solid var(--border) !important; background: var(--surface) !important;
  color: var(--text-2) !important; font-size: 13.5px; font-weight: 700; margin: 0 !important; line-height: 1; font-variant-numeric: tabular-nums;
}
.pagination .page-link:hover { background: var(--primary-soft) !important; color: var(--primary-text) !important; border-color: transparent !important; }
.pagination .page-item.active .page-link { background: var(--primary) !important; border-color: var(--primary) !important; color: var(--on-primary) !important; }
.pagination .page-item.disabled .page-link { opacity: .5; }
.pagination .page-link:focus { box-shadow: 0 0 0 3px var(--primary-ring) !important; }
.page-btn { }

/* Tabs trạng thái (t2-tabs) */
.t2-tabs { display: flex; gap: 6px; padding: 14px 20px 6px; overflow-x: auto; scrollbar-width: none; }
.t2-tabs::-webkit-scrollbar { display: none; }
/* Tab dạng viên thuốc: mục đang chọn đổ màu chủ đạo */
.t2-tab {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; color: var(--text-2); font-weight: 700; font-size: 14px;
  border: 0; border-radius: var(--r-full); white-space: nowrap; background: transparent; transition: background .15s, color .15s;
}
.t2-tab:hover { color: var(--text); background: var(--hover); }
.t2-tab.active { color: var(--on-primary); background: var(--primary); box-shadow: 0 8px 16px -8px hsla(var(--primary-h), var(--primary-s), var(--primary-l), .8); }
.t2-tab .t2-count { font-size: 12px; padding: 0 8px; line-height: 20px; border-radius: var(--r-full); background: var(--surface-3); color: var(--text-3); font-variant-numeric: tabular-nums; }
.t2-tab.active .t2-count { background: rgba(255,255,255,.22); color: var(--on-primary); }

/* Phân đoạn (segmented control) */
.t2-segment { display: inline-flex; padding: 4px; gap: 2px; background: var(--surface-3); border-radius: var(--r-full); }
.t2-segment button {
  border: 0; background: transparent; color: var(--text-2); font-weight: 700; font-size: 13.5px; padding: 0 16px; height: 36px; border-radius: var(--r-full);
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.t2-segment button:hover { color: var(--text); }
.t2-segment button.active { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }
.t2-segment .t2-save { font-size: 11px; color: var(--success-tx); font-weight: 700; }

/* ==========================================================================
   SECTION: modals (hợp đồng)
   ========================================================================== */
.modal-backdrop.show { opacity: .45; background: hsl(var(--primary-h), 30%, 8%); }
.modal-content, .modal-content-modern {
  background: var(--surface) !important; color: var(--text); border: 0 !important;
  border-radius: 32px !important; box-shadow: var(--sh-pop) !important; overflow: hidden;
}
.modal-header, .modal-header-modern { padding: 24px 28px 8px !important; border-bottom: 0 !important; align-items: center; }
.modal-title, .modal-title-modern { font-size: 19px !important; font-weight: 600 !important; color: var(--text); display: flex; align-items: center; gap: 12px; }
.modal-body, .modal-body-modern { padding: 12px 28px 24px !important; }
.modal-footer, .modal-footer-modern { padding: 16px 28px 24px !important; border-top: 0 !important; background: transparent; gap: 10px; }
.modal-footer > * { margin: 0 !important; }
.close { color: var(--text-3); opacity: 1; text-shadow: none; font-weight: 400; font-size: 22px; width: 38px; height: 38px; border-radius: 50%; background: var(--surface-3); display: inline-flex; align-items: center; justify-content: center; padding: 0 !important; margin: -4px -6px -4px auto !important; }
.close:hover { color: var(--text); background: var(--hover); opacity: 1; }
.t2-modal-icon { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }

/* ==========================================================================
   SECTION: dropdowns & notifications (hợp đồng)
   ========================================================================== */
.dropdown-menu {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-pop);
  padding: 8px; font-size: 14px; color: var(--text); margin-top: 8px !important; min-width: 220px;
}
.dropdown-item { border-radius: var(--r); padding: 10px 12px; color: var(--text); font-weight: 700; display: flex; align-items: center; gap: 12px; }
.dropdown-item i { width: 18px; text-align: center; color: var(--text-3); }
.dropdown-item:hover, .dropdown-item:focus { background: var(--primary-soft); color: var(--primary-text); }
.dropdown-item:hover i { color: var(--primary-text); }
.dropdown-item.t2-danger, .dropdown-item.t2-danger i { color: var(--danger-tx); }
.dropdown-item.t2-danger:hover { background: var(--danger-bg); }
.dropdown-divider { border-color: var(--border); margin: 8px 0; }
.dropdown-header { font-size: 13px; color: var(--text-3); font-weight: 700; padding: 8px 12px 4px; }

.t2-noti-menu { width: 400px; padding: 0; overflow: hidden; }
.t2-noti-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 12px; }
.t2-noti-head b { font-size: 16px; font-weight: 700; }
.t2-noti-list { max-height: 360px; overflow-y: auto; padding: 0 8px; }
.notification-item { display: flex; gap: 14px; padding: 12px; border-radius: var(--r); color: var(--text); position: relative; }
.notification-item:hover { background: var(--surface-2); color: var(--text); }
.notification-item.unread { background: var(--primary-soft); }
.notification-item.unread::after { content: ""; position: absolute; right: 14px; top: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.notification-icon-box { width: 38px; height: 38px; border-radius: 50%; background: var(--surface-3); color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 14px; }
.notification-text-title { font-size: 13.5px; font-weight: 700; line-height: 1.4; padding-right: 16px; }
.notification-text-time { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.t2-noti-foot { display: block; text-align: center; padding: 14px; margin-top: 8px; font-size: 13.5px; font-weight: 700; border-top: 1px solid var(--border); background: var(--surface-2); }

.t2-user-card { display: flex; gap: 12px; align-items: center; padding: 10px 10px 12px; }
.t2-user-card b { display: block; font-size: 14px; }
.t2-user-card span { font-size: 12px; color: var(--text-3); }

/* ==========================================================================
   SECTION: toast (hợp đồng — showModernToast)
   ========================================================================== */
.toast-container-modern { position: fixed; right: 20px; bottom: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast-modern {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; min-width: 280px; max-width: 420px; padding: 12px 20px 12px 12px;
  background: var(--n-900); color: #f4f4f5; border-radius: var(--r-full); box-shadow: var(--sh-pop); font-size: 14px; font-weight: 700;
  animation: t2-toast-in .25s var(--ease);
}
html.dark-mode .toast-modern { background: var(--surface-3); border: 1px solid var(--border-strong); }
.toast-modern.is-leaving { animation: t2-toast-out .2s ease forwards; }
.toast-icon { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.toast-modern.success .toast-icon { background: #059669; color: #fff; }
.toast-modern.error .toast-icon { background: #e11d48; color: #fff; }
.toast-modern.warning .toast-icon { background: #d97706; color: #fff; }
.toast-modern.info .toast-icon { background: var(--primary); color: #fff; }
.toast-body-text { flex: 1; }
@keyframes t2-toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes t2-toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ==========================================================================
   SECTION: auth (hợp đồng auth-*)
   ========================================================================== */
.auth-page-wrapper { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--surface); }
.auth-form-panel { display: flex; flex-direction: column; padding: 28px 40px; min-height: 100vh; }
.auth-form-panel .t2-auth-top { display: flex; align-items: center; justify-content: space-between; }
.t2-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); font-weight: 700; font-size: 17px; line-height: 1.15; }
.t2-brand:hover { color: var(--text); }
.t2-brand small { display: block; font-size: 12px; font-weight: 600; color: var(--text-3); margin-top: 2px; }
.t2-brand-mark { width: 42px; height: 42px; border-radius: 15px; background: var(--primary); color: var(--on-primary); display: inline-flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; box-shadow: 0 8px 16px -6px hsla(var(--primary-h), var(--primary-s), var(--primary-l), .6), inset 0 -3px 0 rgba(0,0,0,.12); }
.auth-container { width: 100%; max-width: 400px; margin: auto; padding: 32px 0; }
.auth-container-narrow { max-width: 380px; }
.auth-form-header { margin-bottom: 28px; }
.auth-form-title { font-size: 32px; font-weight: 700; letter-spacing: -0.025em; margin: 0 0 8px; }
.auth-form-subtitle { color: var(--text-2); font-size: 15px; margin: 0; }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--text-4); font-size: 13px; font-weight: 700; margin: 22px 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-input-icon-btn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--text-3); width: 34px; height: 34px; border-radius: 50%; }
.auth-input-icon-btn:hover { background: var(--hover); color: var(--text); }
.t2-auth-foot { font-size: 12.5px; color: var(--text-3); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.auth-hero-panel {
  position: relative; overflow: hidden; margin: 14px; border-radius: 40px; padding: 48px;
  background: hsl(var(--primary-h), min(var(--primary-s), 55%), 24%); color: #f4f4f5; display: flex; flex-direction: column; justify-content: space-between; min-height: calc(100vh - 28px);
}
/* Các "bong bóng" mềm nhiều lớp thay cho lưới kỹ thuật */
.auth-hero-panel::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(520px 420px at 90% 8%, hsla(var(--primary-h), var(--primary-s), var(--primary-l), .75), transparent 62%),
    radial-gradient(460px 380px at 0% 100%, hsla(var(--primary-h), var(--primary-s), calc(var(--primary-l) + 10%), .35), transparent 62%);
}
.auth-hero-panel::after {
  content: ""; position: absolute; width: 360px; height: 360px; border-radius: 50%; right: -120px; bottom: 90px;
  border: 56px solid rgba(255,255,255,.07);
}
.auth-hero-panel > * { position: relative; z-index: 1; }
.auth-hero-brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 18px; color: #fff; }
.auth-hero-logo { width: 42px; height: 42px; border-radius: 15px; background: rgba(255,255,255,.18); display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.auth-hero-logo-img { max-height: 42px; }
.auth-hero-title { font-size: 40px; line-height: 1.18; font-weight: 700; letter-spacing: -0.03em; color: #fff; margin: 0 0 16px; max-width: 520px; }
.auth-hero-desc { color: rgba(255, 255, 255, .8); font-size: 16px; max-width: 480px; margin: 0; }
.auth-hero-pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.auth-hero-pill-item { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: var(--r-full); background: rgba(255,255,255,.14); font-size: 13.5px; font-weight: 700; color: #fff; }
.t2-hero-card {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.16); border-radius: var(--r-xl); padding: 20px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); max-width: 420px;
}
.t2-hero-card .t2-hero-row { display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; padding: 8px 0; color: rgba(255,255,255,.9); }
.t2-hero-card .t2-hero-row + .t2-hero-row { border-top: 1px solid rgba(255,255,255,.08); }
.t2-hero-card code { background: rgba(255,255,255,.08); color: #fff; }

/* Trang auth phụ (quên/đặt lại mật khẩu, 2FA): 1 cột căn giữa, không có panel hero */
.t2-auth-single { min-height: 100vh; display: flex; flex-direction: column; padding: 24px; background: var(--bg); }
.t2-auth-card { width: 100%; max-width: 440px; margin: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 32px; box-shadow: var(--sh-pop); padding: 40px; }
.t2-auth-icon { width: 60px; height: 60px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-text); display: inline-flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 20px; }
@media (max-width: 575.98px) { .t2-auth-single { padding: 16px; } .t2-auth-card { padding: 22px; } }

/* ==========================================================================
   SECTION: utilities (hợp đồng text-*, bg-*, font-*)
   ========================================================================== */
.text-primary { color: var(--primary-text) !important; }
.text-emerald { color: var(--success-tx) !important; }
.text-amber { color: var(--warning-tx) !important; }
.text-rose { color: var(--danger-tx) !important; }
.text-sky { color: var(--info-tx) !important; }
.text-slate-900, .text-slate-800 { color: var(--text) !important; }
.text-slate-700, .text-slate-600 { color: var(--text-2) !important; }
.text-slate-500 { color: var(--text-3) !important; }
.text-slate-400 { color: var(--text-4) !important; }
.text-muted { color: var(--text-3) !important; }
.bg-primary { background: var(--primary) !important; color: var(--on-primary); }
.bg-primary-50 { background: var(--primary-soft) !important; }
.bg-emerald-50 { background: var(--success-bg) !important; }
.bg-amber-50 { background: var(--warning-bg) !important; }
.bg-rose-50 { background: var(--danger-bg) !important; }
.bg-sky-50 { background: var(--info-bg) !important; }
.bg-amber { background: var(--warning) !important; }
.bg-rose { background: var(--danger) !important; }
.bg-light { background: var(--surface-2) !important; }
.font-size-11 { font-size: 11px !important; } .font-size-12 { font-size: 12px !important; } .font-size-13 { font-size: 13px !important; }
.font-size-14 { font-size: 14px !important; } .font-size-15 { font-size: 15px !important; } .font-size-16 { font-size: 16px !important; }
.font-size-18 { font-size: 18px !important; } .font-size-24 { font-size: 24px !important; }
.font-weight-500 { font-weight: 500 !important; } .font-weight-600 { font-weight: 600 !important; }
.font-weight-700 { font-weight: 600 !important; } .font-weight-800 { font-weight: 600 !important; }
.cursor-pointer { cursor: pointer; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.t2-muted { color: var(--text-3); }
.t2-divider { height: 1px; background: var(--border); margin: 16px 0; }
.t2-min-0 { min-width: 0; }

/* Spinner & trạng thái đang tạo (hợp đồng vong-xoay, vps-progressing) */
.vong-xoay { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--border-strong); border-top-color: var(--primary); border-radius: 50%; animation: t2-spin .7s linear infinite; vertical-align: -2px; }
@keyframes t2-spin { to { transform: rotate(360deg); } }
.vps-progressing { color: var(--info-tx); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }

/* ==========================================================================
   SECTION: t2 components (riêng Template 2)
   ========================================================================== */
/* Danh sách key-value */
.t2-kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 0; font-size: 14px; }
.t2-kv > dt { color: var(--text-3); font-weight: 600; padding: 12px 0; border-bottom: 2px dotted var(--border); }
.t2-kv > dd { margin: 0; padding: 12px 0; border-bottom: 2px dotted var(--border); color: var(--text); font-weight: 700; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
.t2-kv > dt:nth-last-child(2), .t2-kv > dd:last-child { border-bottom: 0; }

/* Thanh tiến độ */
.t2-bar { height: 10px; background: var(--surface-3); border-radius: var(--r-full); overflow: hidden; }
.t2-bar > span { display: block; height: 100%; background: var(--primary); border-radius: var(--r-full); }
.t2-bar.is-warn > span { background: var(--warning); }
.t2-bar.is-danger > span { background: var(--danger); }

/* Danh sách đơn giản */
.t2-list { list-style: none; margin: 0; padding: 0; }
.t2-list > li { display: flex; align-items: center; gap: 14px; padding: 14px 24px; border-bottom: 1px solid var(--border); }
.t2-list > li:last-child { border-bottom: 0; }
.t2-list-title { font-weight: 700; font-size: 14px; color: var(--text); display: block; line-height: 1.4; }
.t2-list-meta { font-size: 12px; color: var(--text-3); }
a.t2-list-title:hover { color: var(--primary-text); }

/* Gói dịch vụ */
.t2-plan {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 26px; height: 100%; box-shadow: var(--sh-1);
  display: flex; flex-direction: column; gap: 20px; position: relative; transition: border-color .15s, box-shadow .2s, transform .2s var(--ease);
}
.t2-plan:hover { box-shadow: var(--sh-pop); transform: translateY(-3px); }
.t2-plan.is-popular { border: 2px solid var(--primary); box-shadow: 0 0 0 6px var(--primary-soft), var(--sh-2); }
.t2-plan-ribbon { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); height: 28px; padding: 0 14px; border-radius: var(--r-full); background: var(--primary); color: var(--on-primary); font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.t2-plan-name { font-size: 18px; font-weight: 700; margin: 0; }
.t2-plan-desc { font-size: 13.5px; color: var(--text-3); margin: 3px 0 0; }
.t2-plan-price { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.t2-plan-price b { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.t2-plan-price span { color: var(--text-3); font-size: 14px; font-weight: 600; }
.t2-plan-price s { color: var(--text-4); font-size: 13px; width: 100%; }
.t2-plan-specs { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; font-size: 14px; }
.t2-plan-specs li { display: flex; align-items: center; gap: 12px; color: var(--text-2); font-weight: 600; }
.t2-plan-specs li i { width: 26px; height: 26px; border-radius: 50%; background: var(--primary-soft); display: inline-flex; align-items: center; justify-content: center; color: var(--primary-text); font-size: 11px; flex-shrink: 0; }
.t2-plan-specs li b { color: var(--text); font-weight: 700; }
.t2-plan .btn-modern { margin-top: auto; }

/* Thẻ lựa chọn (OS, phương thức thanh toán...) */
.t2-choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.t2-choice {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 36px 14px 14px; border-radius: var(--r-lg);
  border: 1.5px solid var(--border-strong); background: var(--surface); cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s; margin: 0;
}
.t2-choice:hover { border-color: var(--text-4); }
.t2-choice input { position: absolute; opacity: 0; pointer-events: none; }
.t2-choice-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-3); display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); font-size: 18px; flex-shrink: 0; }
.t2-choice b { display: block; font-size: 14px; font-weight: 700; line-height: 1.3; }
.t2-choice small { display: block; font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.t2-choice::after {
  content: "\f00c"; font-family: "Font Awesome 5 Free"; font-weight: 900; font-size: 10px; position: absolute; top: 12px; right: 12px;
  width: 20px; height: 20px; border-radius: 50%; display: none; align-items: center; justify-content: center; background: var(--primary); color: #fff;
}
.t2-choice.is-checked, .t2-choice:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); background: var(--primary-soft); }
.t2-choice.is-checked::after, .t2-choice:has(input:checked)::after { display: inline-flex; }
.t2-choice.is-checked .t2-choice-icon, .t2-choice:has(input:checked) .t2-choice-icon { background: var(--surface); color: var(--primary-text); }

/* Bộ tăng giảm số lượng */
.t2-stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--border-strong); border-radius: var(--r-full); background: var(--surface); height: 46px; overflow: hidden; padding: 0 4px; }
.t2-stepper button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--surface-3); color: var(--text-2); }
.t2-stepper button:hover { background: var(--primary-soft); color: var(--primary-text); }
.t2-stepper input { width: 56px; height: 100%; border: 0; text-align: center; background: transparent; color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.t2-stepper input:focus { outline: none; }

/* Các bước (stepper tiến trình đặt hàng) */
.t2-steps { display: flex; align-items: center; gap: 8px; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.t2-steps li { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; color: var(--text-3); }
.t2-steps li .t2-step-no { width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; background: var(--surface); }
.t2-steps li.is-done .t2-step-no { background: var(--success); border-color: var(--success); color: #fff; }
.t2-steps li.is-current { color: var(--text); }
.t2-steps li.is-current .t2-step-no { background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.t2-steps .t2-step-line { width: 48px; height: 3px; border-radius: 3px; background: var(--border-strong); }

/* Bảng tóm tắt đơn hàng */
.t2-summary { position: sticky; top: calc(var(--topbar-h) + 20px); }
.t2-sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 14px; font-weight: 600; color: var(--text-2); }
.t2-sum-row b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.t2-sum-total { border-top: 2px dotted var(--border-strong); margin-top: 10px; padding-top: 16px; display: flex; justify-content: space-between; align-items: baseline; }
.t2-sum-total span { font-weight: 700; }
.t2-sum-total b { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--primary-text); }

/* QR */
.t2-qr-box { border: 1px solid var(--border); border-radius: var(--r-xl); padding: 16px; background: #fff; width: 220px; height: 220px; margin: 0 auto; display: flex; align-items: center; justify-content: center; }
.t2-qr-box svg { width: 100%; height: 100%; }
.t2-copy-field { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-radius: var(--r-lg); background: var(--surface-2); }
.t2-copy-field + .t2-copy-field { margin-top: 10px; }
.t2-copy-field small { display: block; font-size: 12px; font-weight: 600; color: var(--text-3); }
.t2-copy-field b { font-size: 14.5px; font-weight: 700; font-variant-numeric: tabular-nums; word-break: break-all; }

/* Trạng thái nguồn VPS */
.t2-power { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13.5px; }
.t2-power::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 20%, transparent); }
.t2-power.on { color: var(--success-tx); }
.t2-power.off { color: var(--text-3); }
.t2-power.busy { color: var(--info-tx); }

/* Thẻ thông số VPS (trang chi tiết) */
.t2-spec-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.t2-spec { border-radius: var(--r-lg); padding: 18px; background: var(--surface-2); }
.t2-spec small { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); font-weight: 700; }
.t2-spec b { display: block; font-size: 24px; font-weight: 700; margin: 8px 0 10px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.t2-spec b span { font-size: 13.5px; color: var(--text-3); font-weight: 700; }

/* Dòng thời gian (nhật ký thao tác / ticket) */
.t2-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.t2-timeline > li { position: relative; padding: 0 0 18px 28px; }
.t2-timeline > li::before { content: ""; position: absolute; left: 7px; top: 20px; bottom: 0; width: 2px; border-radius: 2px; background: var(--border); }
.t2-timeline > li:last-child::before { display: none; }
.t2-timeline .t2-tl-dot { position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; border: 4px solid var(--surface); background: var(--n-300); box-shadow: 0 0 0 2px var(--border-strong); }
.t2-timeline .t2-tl-dot.is-success { background: var(--success); }
.t2-timeline .t2-tl-dot.is-primary { background: var(--primary); }
.t2-timeline .t2-tl-dot.is-warn { background: var(--warning); }
.t2-tl-title { font-size: 14px; font-weight: 700; }
.t2-tl-time { font-size: 12px; color: var(--text-3); }

/* Hội thoại ticket */
.t2-thread { display: flex; flex-direction: column; gap: 18px; }
.t2-msg { display: flex; gap: 12px; max-width: 760px; }
.t2-msg-body { flex: 1; min-width: 0; }
.t2-msg-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.t2-msg-head b { font-size: 14px; font-weight: 700; }
.t2-msg-head span { font-size: 12.5px; color: var(--text-3); }
.t2-msg-bubble { border: 1px solid var(--border); background: var(--surface); border-radius: 6px var(--r-xl) var(--r-xl) var(--r-xl); padding: 16px 20px; font-size: 14.5px; color: var(--text); box-shadow: var(--sh-1); }
.t2-msg-bubble p:last-child { margin-bottom: 0; }
.t2-msg.is-staff .t2-msg-bubble { background: var(--primary-soft); border-color: var(--primary-soft-2); }
.t2-msg.is-staff .t2-avatar { background: var(--primary); color: var(--on-primary); }
.t2-attach { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 14px; border-radius: var(--r-full); border: 1px solid var(--border); background: var(--surface); font-size: 12.5px; color: var(--text-2); }

/* Trạng thái trống */
.t2-empty { text-align: center; padding: 40px 20px; color: var(--text-3); }
.t2-empty-icon { width: 68px; height: 68px; border-radius: 50%; background: var(--primary-soft); display: inline-flex; align-items: center; justify-content: center; font-size: 24px; color: var(--primary-text); margin-bottom: 14px; }
.t2-empty b { display: block; color: var(--text); font-size: 16px; font-weight: 700; margin-bottom: 4px; }

/* Thanh chọn nhiều (bulk) */
.t2-bulkbar { display: none; align-items: center; gap: 10px; padding: 10px 18px; margin: 0 16px 8px; border-radius: var(--r-full); background: var(--primary-soft); font-size: 13.5px; font-weight: 600; }
.t2-bulkbar.show { display: flex; }
.t2-bulkbar b { color: var(--primary-text); }

/* Liên kết cộng đồng */
.t2-social { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.t2-social a { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1.5px solid var(--border); border-radius: var(--r-full); color: var(--text); font-weight: 700; font-size: 13.5px; transition: border-color .15s, background .15s; }
.t2-social a:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--text); }
.t2-social a i { font-size: 16px; width: 18px; text-align: center; }

/* Thẻ thống kê dịch vụ theo loại (dashboard) */
.t2-svc-row { display: grid; grid-template-columns: minmax(0, 1fr) 60px; gap: 12px; align-items: center; padding: 10px 0; }
.t2-svc-row + .t2-svc-row { border-top: 1px dashed var(--border); }
.t2-svc-name { font-size: 14px; font-weight: 700; display: flex; justify-content: space-between; margin-bottom: 6px; }
.t2-svc-name span { color: var(--text-3); font-weight: 500; font-size: 12.5px; }
.t2-svc-row > b { text-align: right; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Thanh hướng dẫn nhanh / CTA */
.t2-cta { display: flex; align-items: center; gap: 18px; padding: 22px 26px; border-radius: var(--r-xl); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--sh-2); position: relative; overflow: hidden; }
.t2-cta::before { content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%; right: -70px; top: -90px; background: var(--primary-soft); pointer-events: none; }
.t2-cta > * { position: relative; }

/* Menu phụ dọc (trang Tài khoản) */
.t2-subnav { position: sticky; top: calc(var(--topbar-h) + 20px); display: flex; flex-direction: column; gap: 2px; margin-bottom: 20px; }
.t2-subnav a { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-radius: var(--r-full); color: var(--text-2); font-weight: 700; font-size: 14px; }
.t2-subnav a i { width: 18px; text-align: center; color: var(--text-4); }
.t2-subnav a:hover { background: var(--hover); color: var(--text); }
.t2-subnav a.active { background: var(--primary); color: var(--on-primary); box-shadow: 0 8px 16px -8px hsla(var(--primary-h), var(--primary-s), var(--primary-l), .8); }
.t2-subnav a.active i { color: var(--on-primary); }
.t2-subnav .t2-subnav-badge { margin-left: auto; }
@media (max-width: 991.98px) {
  .t2-subnav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); gap: 4px; padding-bottom: 8px; }
  .t2-subnav a { white-space: nowrap; }
}

/* Widget liên hệ nổi (thay contact-fixed của template Mặc định) */
.t2-contact { position: fixed; right: 20px; bottom: 20px; z-index: 1980; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.t2-contact-btn {
  width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--primary); color: var(--on-primary); font-size: 22px;
  box-shadow: 0 12px 28px -6px hsla(var(--primary-h), var(--primary-s), var(--primary-l), .6); display: inline-flex; align-items: center; justify-content: center;
  transition: transform .15s var(--ease), background .15s;
}
.t2-contact-btn:hover { background: var(--primary-hover); transform: translateY(-1px); }
.t2-contact-btn .fa-times { display: none; }
.t2-contact.open .t2-contact-btn .fa-times { display: inline-block; }
.t2-contact.open .t2-contact-btn .fa-comment-dots { display: none; }
.t2-contact-menu {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--sh-pop); padding: 8px; min-width: 220px;
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .16s, transform .16s, visibility .16s;
}
.t2-contact.open .t2-contact-menu { opacity: 1; visibility: visible; transform: none; }
.t2-contact-menu a { display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; border-radius: var(--r-full); color: var(--text); font-weight: 700; font-size: 14px; }
.t2-contact-menu a:hover { background: var(--hover); color: var(--text); }
.t2-contact-menu a span { width: 34px; height: 34px; border-radius: 50%; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.toast-container-modern { bottom: 84px; }

/* ==========================================================================
   SECTION: dark-mode tinh chỉnh riêng
   ========================================================================== */
html.dark-mode .t2-qr-box { background: #fff; }
html.dark-mode .modal-backdrop.show { opacity: .7; }
html.dark-mode .badge-white-modern { background: var(--surface-2) !important; }

/* ==========================================================================
   SECTION: responsive
   ========================================================================== */
@media (max-width: 1199.98px) {
  .t2-spec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .btn-topbar-action-label { display: none; }
}
@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(calc(-100% - 24px)); box-shadow: var(--sh-pop); }
  .app-sidebar.sidebar-open { transform: none; }
  .app-main { margin-left: 0; }
  body.sidebar-collapsed .app-sidebar { transform: translateX(calc(-100% - 24px)); }
  body.sidebar-collapsed .app-sidebar.sidebar-open { transform: none; }
  .app-content, .t2-main { padding: 4px 16px 24px; }
  .app-topbar { padding: 0 16px; }
  .user-quick-profile .t2-udetail, .user-quick-profile .t2-caret, .t2-hide-md { display: none; }
  .t2-page-head, .page-title-row { padding-bottom: 16px; }
  .t2-page-title, .page-title { font-size: 21px; }
  .auth-page-wrapper { grid-template-columns: 1fr; }
  .auth-hero-panel { display: none; }
  .auth-form-panel { padding: 20px; }
  .t2-summary { position: static; }
  .t2-noti-menu { width: min(380px, calc(100vw - 24px)); }
}
@media (max-width: 575.98px) {
  .t2-hide-sm { display: none !important; }
  .topbar-quick-actions { display: none; }
  .t2demo-fab { max-width: calc(100vw - 84px); overflow-x: auto; scrollbar-width: none; }
  .t2demo-swatch:nth-of-type(n+6) { display: none; }
  .t2-contact { right: 12px; bottom: 12px; }
  .t2-page-actions { margin-left: 0; width: 100%; }
  .t2-page-actions .btn-modern { flex: 1; }
  .t2-kv { grid-template-columns: 110px minmax(0, 1fr); }
  .t2-spec-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .t2-social { grid-template-columns: 1fr; }
  .t2-tabs { padding: 0 6px; }
  .toast-container-modern { left: 12px; right: 12px; align-items: stretch; }
  .toast-modern { min-width: 0; max-width: none; }
  .alert-amber-modern, .alert-rose-modern, .alert-emerald-modern, .alert-indigo-modern { flex-wrap: wrap; }
  .t2-alert-actions { width: 100%; padding-left: 26px; }
}

/* ==========================================================================
   SECTION: DEMO ONLY — thanh công cụ demo (KHÔNG port sang production)
   ========================================================================== */
.t2demo-fab {
  position: fixed; left: 20px; bottom: 20px; z-index: 1990; display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px;
  background: var(--n-900); color: #fff; border-radius: var(--r-full); box-shadow: var(--sh-pop); font-size: 12px; font-weight: 600;
}
html.dark-mode .t2demo-fab { background: #26262c; border: 1px solid #3a3a42; }
.t2demo-fab .t2demo-label { opacity: .7; font-size: 11.5px; }
.t2demo-swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); cursor: pointer; padding: 0; }
.t2demo-swatch.active { border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.t2demo-fab input[type="color"] { width: 26px; height: 26px; border: 0; padding: 0; background: transparent; cursor: pointer; }
.t2demo-fab a.t2demo-link { display: inline-flex; align-items: center; gap: 6px; color: #fff; background: rgba(255,255,255,.1); height: 28px; padding: 0 10px; border-radius: var(--r-full); font-size: 12px; font-weight: 600; white-space: nowrap; }
.t2demo-fab a.t2demo-link:hover { background: rgba(255,255,255,.18); color: #fff; }
.t2demo-fab a.t2demo-home { background: var(--primary); }
@media (max-width: 575.98px) { .t2demo-fab a.t2demo-home span { display: none; } }
.t2demo-fab .t2demo-sep { width: 1px; height: 18px; background: rgba(255,255,255,.2); }
.t2demo-fab button.t2demo-btn { border: 0; background: rgba(255,255,255,.1); color: #fff; height: 28px; padding: 0 10px; border-radius: var(--r-full); font-size: 12px; font-weight: 600; }
.t2demo-fab button.t2demo-btn:hover { background: rgba(255,255,255,.18); }
@media (max-width: 575.98px) { .t2demo-fab { left: 12px; bottom: 12px; } .t2demo-fab .t2demo-label { display: none; } }

/* Bootstrap gắn mũi tên ::after cho .dropdown-toggle — topbar tự có mũi tên riêng nên ẩn đi */
.btn-topbar-action.dropdown-toggle::after, .user-quick-profile.dropdown-toggle::after { display: none; }
@media (min-width: 992px) { .t2demo-fab { left: calc(var(--sidebar-w) + 12px); } body.sidebar-collapsed .t2demo-fab { left: 20px; } }
@media (max-height: 760px) { .t2-side-foot { display: none; } }

/* ==========================================================================
   TEMPLATE 5 — "Gọn, đậm thông tin" (khối ghi đè phủ lên bản gốc ở trên)
   --------------------------------------------------------------------------
   Khác Template 4: bo góc nhỏ, thẻ phẳng viền mảnh (không đổ bóng), chữ nhỏ-đậm vừa,
   bảng mật độ cao, tab gạch chân, sidebar sát mép nền tối. Cùng cơ chế màu (--primary-h/s/l).
   ========================================================================== */
:root {
  --r-sm: 4px; --r: 6px; --r-lg: 8px; --r-xl: 10px; --r-full: 6px;
  --sh-1: none;
  --sh-2: 0 1px 2px rgba(var(--shadow-rgb), .05);
  --sh-pop: 0 12px 28px -8px rgba(var(--shadow-rgb), .3), 0 0 0 1px var(--border);
  --topbar-h: 56px;
  --sidebar-w: 256px; --sidebar-gap: 0px;
  --bg: hsl(var(--primary-h), 14%, 95.5%);
  --border: hsl(var(--primary-h), 12%, 88%);
}
html.dark-mode { --bg: hsl(var(--primary-h), 14%, 7%); --border: hsl(var(--primary-h), 10%, 17%); }
body { font-size: 14px; line-height: 1.5; }
h1, h2, h3, h4, h5, h6 { letter-spacing: -0.005em; }

/* Sidebar: sát mép, nền tối — đặt lại token trong phạm vi sidebar để mọi thành phần con tự đổi màu */
.app-sidebar {
  --surface: hsl(var(--primary-h), 26%, 11%); --surface-2: hsl(var(--primary-h), 24%, 14%); --surface-3: rgba(255,255,255,.07);
  --text: #eef0f6; --text-2: hsl(var(--primary-h), 14%, 76%); --text-3: hsl(var(--primary-h), 10%, 62%); --text-4: hsl(var(--primary-h), 8%, 50%);
  --hover: rgba(255,255,255,.07); --border: rgba(255,255,255,.09); --n-300: hsl(var(--primary-h), 10%, 40%);
  --primary-text: hsl(var(--primary-h), var(--primary-s), 72%); --primary-soft: hsla(var(--primary-h), var(--primary-s), 60%, .2); --primary-soft-2: hsla(var(--primary-h), var(--primary-s), 60%, .3);
  color: var(--text); top: 0; bottom: 0; left: 0; width: var(--sidebar-w); border: 0; border-right: 1px solid var(--border); border-radius: 0; box-shadow: none;
}
.sidebar-header { height: var(--topbar-h); padding: 0 16px; border-bottom: 1px solid var(--border); }
.brand-icon { width: 32px; height: 32px; border-radius: 7px; font-size: 14px; box-shadow: none; }
.brand-text span { font-size: 15px; font-weight: 700; }
.brand-text small { font-size: 11.5px; font-weight: 500; }
.sidebar-nav { padding: 8px 10px 14px; }
.nav-group-title { font-size: 11.5px; font-weight: 600; color: var(--text-4); padding: 14px 10px 5px; }
.nav-item-link { height: 36px; padding: 0 10px; gap: 10px; font-size: 13.5px; font-weight: 500; border-radius: var(--r); }
.nav-icon { width: 20px; height: 20px; border-radius: 0; background: transparent; font-size: 13.5px; }
.nav-item-link:hover .nav-icon { background: transparent; box-shadow: none; }
.nav-item-link.active { font-weight: 600; box-shadow: inset 3px 0 0 var(--primary); border-radius: 0 var(--r) var(--r) 0; margin-left: -10px; padding-left: 20px; }
.nav-item-link.active .nav-icon { background: transparent; color: var(--primary-text); box-shadow: none; }
.nav-item-dropdown.has-active-child > .nav-item-link .nav-icon { background: transparent; }
.nav-submenu, .nav-sub-submenu { border-left-width: 1px; margin-left: 19px; }
.nav-sub-link, .nav-sub-sub-link { min-height: 30px; font-size: 13px; font-weight: 500; border-radius: var(--r-sm); }
.t2-side-foot { padding: 10px; border-top: 1px solid var(--border); }
.t2-side-card { border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--border); padding: 12px; }
.t2-side-card::after { display: none; }
.t2-side-card b { font-size: 18px; margin-bottom: 10px; }
.t2-side-card small { font-size: 12px; }

/* Topbar: thanh phẳng có viền dưới */
.app-topbar { padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--border); backdrop-filter: none; -webkit-backdrop-filter: none; }
.app-content, .t2-main { padding: 20px 24px 28px; }
.btn-sidebar-toggle, .btn-topbar-icon, .t2-icon-btn { width: 34px; height: 34px; border-radius: var(--r); border-color: transparent; background: transparent; box-shadow: none; }
.btn-sidebar-toggle:hover, .btn-topbar-icon:hover, .t2-icon-btn:hover, .btn-topbar-icon[aria-expanded="true"] { background: var(--hover); box-shadow: none; color: var(--text); }
.btn-topbar-action { height: 34px; padding: 0 10px; font-weight: 500; font-size: 13.5px; border-color: transparent; background: transparent; box-shadow: none; }
.btn-topbar-action:hover, .btn-topbar-action[aria-expanded="true"] { background: var(--hover); box-shadow: none; }
.btn-topbar-action i:first-child { color: var(--text-3); }
.topbar-badge { top: 2px; right: 1px; box-shadow: 0 0 0 2px var(--surface); }
.user-quick-profile { height: 40px; padding: 0 8px 0 5px; border-radius: var(--r); border-color: transparent; background: transparent; box-shadow: none; }
.user-quick-profile:hover, .user-quick-profile[aria-expanded="true"] { background: var(--hover); box-shadow: none; }
.user-avatar-box, .t2-avatar { width: 30px; height: 30px; border-radius: 6px; font-size: 12.5px; }
.t2-avatar-lg { width: 40px; height: 40px; font-size: 15px; }
.user-quick-profile .t2-uname { font-size: 13px; font-weight: 600; }
.user-profile-dropdown-menu .t2-user-head { background: var(--surface-2); }

/* Tiêu đề trang */
.t2-page-head, .page-title-row { padding: 0 0 16px; }
.t2-page-title, .page-title { font-size: 22px; font-weight: 700; }
.t2-page-sub { font-size: 13.5px; margin-top: 3px; }
.t2-crumb { font-size: 12.5px; font-weight: 500; margin-bottom: 4px; }

/* Nút: chữ nhật bo nhẹ, không phát sáng */
.btn-modern, .btn-primary-modern, .btn-white-modern, .btn-emerald-modern, .btn-amber-modern, .btn-rose-modern { height: 34px; padding: 0 14px !important; font-size: 13.5px !important; font-weight: 600 !important; }
.btn-modern:hover { transform: none; }
.btn-modern.btn-sm, .btn-sm.btn-modern { height: 28px; padding: 0 10px !important; font-size: 12.5px !important; }
.btn-modern.btn-lg { height: 42px; padding: 0 20px !important; font-size: 14.5px !important; }
.btn-primary-modern, .btn-emerald-modern, .btn-rose-modern { box-shadow: none !important; }
.btn-white-modern:hover { color: var(--text) !important; border-color: var(--text-4) !important; background: var(--surface-2) !important; }
.btn-icon-sm, .t2-icon-sm { width: 28px; height: 28px; border-radius: var(--r) !important; }
.btn-social-auth { height: 40px; border-radius: var(--r); font-weight: 600; box-shadow: none; }
.btn-social-auth:hover { border-color: var(--text-4); color: var(--text); }

/* Badge: vuông bo nhẹ, chữ nhỏ */
.badge-modern { height: 22px; padding: 0 8px !important; font-size: 12px !important; font-weight: 600 !important; border: 1px solid var(--border-strong); background: var(--surface-2); }
.t2-tag { height: 20px; border-radius: 4px; font-size: 11.5px; font-weight: 600; }

/* Thẻ: phẳng, viền mảnh */
.alert-emerald-modern, .alert-amber-modern, .alert-rose-modern, .alert-indigo-modern, .t2-alert { padding: 11px 14px; font-size: 13.5px; gap: 10px; margin-bottom: 14px; }
.modern-card, .t2-panel { border-radius: var(--r-lg) !important; box-shadow: none; margin-bottom: 16px; }
.modern-banner { border-radius: var(--r-lg); box-shadow: none; padding: 20px 24px; }
.card { border-radius: var(--r-lg); }
.t2-panel-head { padding: 12px 16px; border-bottom: 1px solid var(--border); min-height: 48px; }
.t2-panel-title { font-size: 14.5px; font-weight: 600; gap: 8px; }
.t2-panel-title > i { width: auto; height: auto; background: transparent; color: var(--text-3); font-size: 13px; border-radius: 0; }
.t2-panel-sub { font-size: 12.5px; margin-top: 1px; }
.t2-panel-body { padding: 16px; }
.t2-panel-foot { padding: 10px 16px; border-top: 1px solid var(--border); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.section-block-title { font-size: 13px; font-weight: 600; }
.metric-card { border-radius: var(--r-lg); box-shadow: none; padding: 14px 16px; gap: 8px; }
a.metric-card:hover { transform: none; box-shadow: none; border-color: var(--text-4); }
.metric-card-label { font-size: 12.5px; font-weight: 500; }
.metric-card-value { font-size: 24px; font-weight: 700; }
.metric-card-value small { font-size: 13px; font-weight: 600; }
.metric-icon-box { width: 30px; height: 30px; border-radius: var(--r); font-size: 13px; }

/* Form: ô nhập thấp, viền mảnh */
.form-label-modern { font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.modern-input, .modern-select, .modern-textarea, .form-control { height: 36px; padding: 0 11px; border-width: 1px !important; border-radius: var(--r) !important; font-size: 13.5px; font-weight: 400; }
.modern-textarea, textarea.form-control { height: auto; min-height: 88px; padding: 8px 11px; border-radius: var(--r) !important; }
.modern-select, select.form-control { padding-right: 30px; background-position: right 10px center !important; }
.modern-input:focus, .modern-select:focus, .modern-textarea:focus, .form-control:focus { box-shadow: 0 0 0 3px var(--primary-ring) !important; }
.modern-input-sm, .modern-select-sm { height: 30px !important; font-size: 13px !important; border-radius: var(--r) !important; padding: 0 10px; }
.modern-input-icon { left: 11px; font-size: 13px; }
.modern-input-with-icon { padding-left: 33px !important; }
.modern-input-group-sm .modern-input-icon { left: 10px; }
.modern-input-group-sm .modern-input-with-icon { padding-left: 30px !important; }
.custom-switch { padding-left: 42px; min-height: 20px; }
.custom-switch:has(.custom-control-label:empty) { padding-left: 34px; }
.custom-switch .custom-control-label::before { width: 34px; height: 20px; border-radius: 20px; }
.custom-switch .custom-control-label::after { left: 2px; top: 2px; width: 16px; height: 16px; }
.custom-switch .custom-control-input:checked ~ .custom-control-label::after { transform: translateX(14px); }
.custom-checkbox .custom-control-label::before, .custom-radio .custom-control-label::before { top: 2px; width: 16px; height: 16px; border-width: 1px; }
.custom-checkbox .custom-control-label::after, .custom-radio .custom-control-label::after { top: 2px; width: 16px; height: 16px; }
.custom-checkbox, .custom-radio { padding-left: 26px; }
.custom-checkbox .custom-control-label::before { border-radius: 4px; }
.custom-control-label { font-size: 13.5px; font-weight: 400; }
.select2-container--default .select2-selection--single { height: 36px; border-width: 1px; }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 34px; padding-left: 11px; }

/* Bảng: mật độ cao, đầu bảng phẳng, hàng kẻ ngang */
.modern-table { font-size: 13.5px; }
.modern-table thead th { font-size: 12.5px; font-weight: 600; padding: 9px 12px !important; border-bottom: 1px solid var(--border) !important; border-top: 1px solid var(--border) !important; }
.modern-table thead th:first-child, .modern-table thead th:last-child { border-radius: 0; }
.modern-table thead th:first-child { padding-left: 16px !important; }
.modern-table thead th:last-child { padding-right: 16px !important; }
.modern-table tbody td { padding: 9px 12px !important; }
.modern-table tbody td:first-child { padding-left: 16px !important; }
.modern-table tbody td:last-child { padding-right: 16px !important; }
.modern-table tbody tr:hover td { background: var(--surface-2); border-color: var(--border); }
.modern-table tbody tr:hover td:first-child, .modern-table tbody tr:hover td:last-child { border-radius: 0; }
.modern-table .t2-cell-main { font-weight: 600; }
.modern-table .btn-modern { height: 26px; padding: 0 9px !important; font-size: 12px !important; }
.table-toolbar-top { padding: 10px 16px; }
.table-pagination-bar { padding: 10px 16px; border-radius: 0 0 var(--r-lg) var(--r-lg); font-size: 13px; }
.pagination .page-link, .pagination li > a, .pagination li > span { min-width: 30px; height: 30px; border-radius: var(--r) !important; font-size: 13px; font-weight: 600; }
.pagination .page-link:hover { background: var(--surface-2) !important; color: var(--text) !important; border-color: var(--border-strong) !important; }
.t2-bulkbar { margin: 0; border-radius: 0; padding: 8px 16px; border-bottom: 1px solid var(--primary-soft-2); }

/* Tab gạch chân + phân đoạn vuông */
.t2-tabs { gap: 2px; padding: 0 12px; border-bottom: 1px solid var(--border); }
.t2-tab { height: auto; padding: 11px 10px 10px; border-radius: 0; font-size: 13.5px; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.t2-tab:hover { background: transparent; color: var(--text); }
.t2-tab.active { background: transparent; color: var(--text); font-weight: 600; box-shadow: none; border-bottom-color: var(--primary); }
.t2-tab .t2-count { font-size: 11.5px; padding: 0 6px; line-height: 18px; border-radius: 4px; }
.t2-tab.active .t2-count { background: var(--primary-soft); color: var(--primary-text); }
.t2-segment { padding: 3px; border-radius: var(--r); border: 1px solid var(--border); }
.t2-segment button { height: 28px; padding: 0 11px; border-radius: 4px; font-size: 13px; font-weight: 500; }
.t2-segment button.active { font-weight: 600; }

/* Modal / dropdown / thông báo / toast */
.modal-content, .modal-content-modern { border: 1px solid var(--border) !important; border-radius: var(--r-xl) !important; }
.modal-header, .modal-header-modern { padding: 14px 18px !important; border-bottom: 1px solid var(--border) !important; }
.modal-title, .modal-title-modern { font-size: 16px !important; font-weight: 600 !important; }
.modal-body, .modal-body-modern { padding: 18px !important; }
.modal-footer, .modal-footer-modern { padding: 12px 18px !important; border-top: 1px solid var(--border) !important; background: var(--surface-2); }
.close { width: 28px; height: 28px; border-radius: var(--r); background: transparent; }
.t2-modal-icon { width: 34px; height: 34px; border-radius: var(--r); }
.dropdown-menu { border-radius: var(--r-lg); padding: 5px; margin-top: 4px !important; font-size: 13.5px; }
.dropdown-item { padding: 7px 10px; font-weight: 500; border-radius: var(--r-sm); gap: 10px; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--hover); color: var(--text); }
.dropdown-item:hover i { color: var(--text-2); }
.dropdown-header { font-size: 12px; font-weight: 600; padding: 6px 10px 3px; }
.t2-noti-menu { width: 360px; }
.t2-noti-head { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.t2-noti-head b { font-size: 14px; font-weight: 600; }
.t2-noti-list { padding: 0; }
.notification-item { padding: 11px 14px; border-radius: 0; border-bottom: 1px solid var(--border); gap: 12px; }
.notification-item:last-child { border-bottom: 0; }
.notification-item.unread { background: transparent; }
.notification-icon-box { width: 32px; height: 32px; border-radius: var(--r); font-size: 12.5px; }
.notification-text-title { font-size: 13px; font-weight: 500; }
.t2-noti-foot { margin-top: 0; padding: 10px; font-size: 13px; font-weight: 600; }
.toast-modern { border-radius: var(--r-lg); padding: 10px 14px 10px 10px; font-size: 13.5px; font-weight: 500; }
.toast-icon { width: 22px; height: 22px; font-size: 11px; }

/* Auth: panel giới thiệu phẳng tối, lưới kỹ thuật */
.auth-form-title { font-size: 26px; font-weight: 700; }
.auth-form-subtitle { font-size: 14px; }
.auth-divider { font-weight: 500; font-size: 12.5px; }
.auth-input-icon-btn { width: 28px; height: 28px; border-radius: var(--r); right: 5px; }
.auth-hero-panel { margin: 0; border-radius: 0; padding: 40px; min-height: 100vh; background: hsl(var(--primary-h), 28%, 11%); }
.auth-hero-panel::before { background: radial-gradient(560px 380px at 85% 8%, hsla(var(--primary-h), var(--primary-s), var(--primary-l), .5), transparent 62%); }
.auth-hero-panel::after { content: ""; position: absolute; inset: 0; width: auto; height: auto; border-radius: 0; right: auto; bottom: auto; border: 0; opacity: .1;
  background-image: linear-gradient(rgba(255,255,255,.6) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.6) 1px, transparent 1px); background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse at 70% 30%, #000 0%, transparent 70%); mask-image: radial-gradient(ellipse at 70% 30%, #000 0%, transparent 70%); }
.auth-hero-brand { font-size: 16px; font-weight: 700; }
.auth-hero-logo { width: 34px; height: 34px; border-radius: 8px; background: var(--primary); }
.auth-hero-title { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; }
.auth-hero-desc { font-size: 15px; }
.auth-hero-pill-item { height: 30px; border-radius: 6px; font-size: 13px; font-weight: 500; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); }
.t2-hero-card { border-radius: var(--r-lg); padding: 14px; background: rgba(255,255,255,.06); }
.t2-hero-card .t2-hero-row { font-size: 13px; padding: 6px 0; }
.t2-auth-card { border-radius: var(--r-xl); box-shadow: var(--sh-2); padding: 28px; max-width: 420px; }
.t2-auth-icon { width: 44px; height: 44px; border-radius: 10px; font-size: 17px; margin-bottom: 16px; }
.t2-brand { font-size: 15px; font-weight: 700; gap: 10px; }
.t2-brand-mark { width: 32px; height: 32px; border-radius: 7px; font-size: 14px; box-shadow: none; }

/* Thành phần riêng t2-* */
.t2-kv { grid-template-columns: 140px minmax(0, 1fr); font-size: 13.5px; }
.t2-kv > dt { padding: 8px 0; font-weight: 500; border-bottom: 1px solid var(--border); }
.t2-kv > dd { padding: 8px 0; font-weight: 500; border-bottom: 1px solid var(--border); }
.t2-bar { height: 6px; }
.t2-list > li { padding: 10px 16px; gap: 12px; }
.t2-list-title { font-size: 13.5px; font-weight: 600; }
.t2-plan { padding: 18px; border-radius: var(--r-lg); box-shadow: none; gap: 14px; }
.t2-plan:hover { transform: none; box-shadow: none; border-color: var(--text-4); }
.t2-plan.is-popular { border: 1px solid var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.t2-plan-ribbon { top: -11px; left: 16px; transform: none; height: 22px; padding: 0 9px; font-size: 11.5px; font-weight: 600; border-radius: 4px; }
.t2-plan-name { font-size: 15px; font-weight: 600; }
.t2-plan-desc { font-size: 12.5px; }
.t2-plan-price b { font-size: 26px; font-weight: 700; }
.t2-plan-price span { font-size: 13px; font-weight: 400; }
.t2-plan-specs { gap: 8px; font-size: 13.5px; }
.t2-plan-specs li { gap: 10px; font-weight: 400; }
.t2-plan-specs li i { width: 16px; height: auto; background: transparent; border-radius: 0; color: var(--text-4); font-size: 12px; }
.t2-plan-specs li b { font-weight: 600; }
.t2-choice { padding: 10px 28px 10px 10px; border-width: 1px; border-radius: var(--r-lg); gap: 10px; }
.t2-choice:hover { border-color: var(--text-4); }
.t2-choice-icon { width: 34px; height: 34px; border-radius: var(--r); font-size: 15px; }
.t2-choice b { font-size: 13.5px; font-weight: 600; }
.t2-choice small { font-size: 12px; font-weight: 400; }
.t2-choice::after { top: 8px; right: 8px; width: 16px; height: 16px; font-size: 9px; border-radius: 4px; }
.t2-choice.is-checked, .t2-choice:has(input:checked) { box-shadow: 0 0 0 2px var(--primary-ring); }
.t2-stepper { height: 36px; border-width: 1px; border-radius: var(--r); padding: 0; }
.t2-stepper button { width: 34px; height: 100%; border-radius: 0; background: transparent; }
.t2-stepper input { width: 48px; font-weight: 600; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
.t2-steps li { font-size: 13px; font-weight: 500; gap: 8px; }
.t2-steps li .t2-step-no { width: 24px; height: 24px; border-width: 1px; border-radius: 6px; font-size: 12px; }
.t2-steps .t2-step-line { width: 32px; height: 1px; border-radius: 0; }
.t2-sum-row { padding: 6px 0; font-size: 13.5px; font-weight: 400; }
.t2-sum-row b { font-weight: 600; }
.t2-sum-total { border-top: 1px solid var(--border); padding-top: 12px; }
.t2-sum-total b { font-size: 22px; font-weight: 700; color: var(--text); }
.t2-qr-box { border-radius: var(--r-lg); padding: 12px; }
.t2-copy-field { padding: 8px 12px; border-radius: var(--r); border: 1px solid var(--border); }
.t2-copy-field b { font-size: 14px; font-weight: 600; }
.t2-power { font-size: 13px; font-weight: 600; }
.t2-spec { border-radius: var(--r-lg); padding: 12px 14px; border: 1px solid var(--border); background: var(--surface); }
.t2-spec small { font-size: 12.5px; font-weight: 500; }
.t2-spec b { font-size: 20px; font-weight: 700; margin: 4px 0 6px; }
.t2-spec b span { font-size: 12.5px; font-weight: 500; }
.t2-timeline .t2-tl-dot { width: 14px; height: 14px; border-width: 3px; box-shadow: 0 0 0 1px var(--border-strong); }
.t2-timeline > li::before { width: 1px; left: 6.5px; top: 16px; }
.t2-tl-title { font-size: 13.5px; font-weight: 600; }
.t2-msg-bubble { border-radius: 4px var(--r-lg) var(--r-lg) var(--r-lg); padding: 11px 14px; font-size: 13.5px; box-shadow: none; }
.t2-msg-head b { font-size: 13.5px; font-weight: 600; }
.t2-attach { border-radius: var(--r); padding: 5px 10px; }
.t2-empty-icon { width: 48px; height: 48px; border-radius: 10px; font-size: 18px; background: var(--surface-3); color: var(--text-3); }
.t2-empty b { font-size: 14px; font-weight: 600; }
.t2-social a { border-width: 1px; border-radius: var(--r); padding: 9px 12px; font-size: 13px; font-weight: 600; }
.t2-social a:hover { background: var(--surface-2); border-color: var(--text-4); }
.t2-svc-name { font-size: 13.5px; font-weight: 600; }
.t2-svc-row > b { font-size: 18px; font-weight: 700; }
.t2-cta { padding: 16px 18px; border-radius: var(--r-lg); box-shadow: none; }
.t2-cta::before { width: 100%; height: 100%; border-radius: 0; right: 0; top: 0; background: linear-gradient(100deg, var(--primary-soft), transparent 55%); }
.t2-subnav a { padding: 8px 12px; border-radius: var(--r); font-size: 13.5px; font-weight: 500; }
.t2-subnav a.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: none; border: 1px solid var(--border); padding: 7px 11px; }
.t2-subnav a.active i { color: var(--primary-text); }
.t2-contact-btn { width: 48px; height: 48px; font-size: 19px; border-radius: 10px; box-shadow: 0 6px 16px -4px hsla(var(--primary-h), var(--primary-s), var(--primary-l), .5); }
.t2-contact-menu { border-radius: var(--r-lg); padding: 5px; }
.t2-contact-menu a { padding: 7px 10px 7px 8px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 500; }
.t2-contact-menu a span { width: 28px; height: 28px; border-radius: 6px; }
.t2-pop-link .t2-pop-icon { width: 36px; height: 36px; border-radius: var(--r); }

body.sidebar-collapsed .app-sidebar { transform: translateX(-100%); }
@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-100%); }
  .app-content, .t2-main { padding: 14px 14px 24px; }
  .t2-panel-head { padding: 12px 14px; }
  .t2-panel-body { padding: 14px; }
}
@media (max-width: 991.98px) { .app-sidebar.sidebar-open, body.sidebar-collapsed .app-sidebar.sidebar-open { transform: none; } }
