/* ── MODERN DARK LUXURY DESIGN SYSTEM ────────────────────────────────────── */
:root {
  --bg-dark: #07090e;
  --bg-card: rgba(15, 19, 32, 0.85);
  --bg-card-hover: rgba(24, 30, 48, 0.95);
  --bg-input: rgba(11, 14, 24, 0.9);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.4);
  --border-active: #6366f1;
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.35);
  
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #a855f7;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Auth boot — không flash admin trước khi /api/auth/me xong */
.auth-boot-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #07090e;
}

.auth-boot-inner {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.auth-boot-inner .spinner {
  margin: 0 auto 12px;
}

body.auth-pending .navbar,
body.auth-pending .main-container {
  visibility: hidden;
}

body.auth-ready .auth-boot-screen {
  display: none;
}

/* Guest mode (Spaceship-style): tra cứu free, mua cần login */
#btnGuestLogin {
  display: none;
  align-items: center;
  gap: 6px;
}

body.guest-mode #btnGuestLogin {
  display: inline-flex !important;
}

body.guest-mode #walletBadgeBtn,
body.guest-mode #userBadgeBtn,
body.guest-mode .btn-logout,
body.guest-mode #headerTaskIndicator {
  display: none !important;
}

body.guest-mode .nav-tab[data-auth="required"] {
  display: none !important;
}

body.guest-mode .header-tools .btn-primary {
  display: none !important;
}

.guest-search-hint {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12), rgba(99, 102, 241, 0.08));
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.45;
}

.guest-search-hint strong {
  color: #38bdf8;
}

.guest-search-hint em {
  font-style: normal;
  color: #fbbf24;
  font-weight: 600;
}

/* Domain suggestions — Namecheap-style cards */
.domain-suggest-panel {
  margin: 18px 0 8px;
  padding: 18px 18px 14px;
  border-radius: 14px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  background:
    radial-gradient(1200px 280px at 0% 0%, rgba(14, 165, 233, 0.10), transparent 55%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(8, 12, 22, 0.55));
}

.suggest-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.suggest-kicker {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #38bdf8;
  font-weight: 700;
  margin-bottom: 4px;
}

.suggest-head h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
}

.suggest-head h4 em {
  font-style: normal;
  color: #fbbf24;
}

.suggest-meta,
.suggest-loading {
  font-size: 12px;
  color: #94a3b8;
}

.suggest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.suggest-grid--muted {
  margin-top: 10px;
  opacity: 0.72;
}

.suggest-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 12px 10px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(2, 6, 23, 0.45);
  min-height: 118px;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.suggest-card.is-available:hover {
  border-color: rgba(16, 185, 129, 0.55);
  background: rgba(6, 78, 59, 0.18);
  transform: translateY(-1px);
}

.suggest-card.is-taken {
  border-style: dashed;
  opacity: 0.85;
}

.suggest-card.is-skeleton {
  min-height: 110px;
  background: linear-gradient(90deg, rgba(30,41,59,0.5), rgba(51,65,85,0.35), rgba(30,41,59,0.5));
  background-size: 200% 100%;
  animation: suggestShimmer 1.2s ease-in-out infinite;
  border: none;
}

@keyframes suggestShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.suggest-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.suggest-tld {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: #67e8f9;
}

.suggest-status {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
}

.suggest-card.is-available .suggest-status {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.15);
}

.suggest-card.is-taken .suggest-status {
  color: #fda4af;
  background: rgba(244, 63, 94, 0.12);
}

.suggest-name {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  word-break: break-all;
  line-height: 1.35;
}

.suggest-price {
  font-size: 15px;
  font-weight: 800;
  color: #34d399;
  font-family: var(--font-mono);
}

.suggest-card.is-taken .suggest-price {
  color: #94a3b8;
  font-size: 13px;
}

.suggest-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
}

.suggest-actions .btn {
  flex: 1;
  min-width: 0;
  justify-content: center;
}

.suggest-locked {
  font-size: 11px;
  color: #64748b;
}

.suggest-empty {
  padding: 14px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  color: #94a3b8;
  font-size: 13px;
}

.suggest-taken {
  margin-top: 14px;
}

.suggest-taken summary {
  cursor: pointer;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  user-select: none;
}

@media (max-width: 640px) {
  .suggest-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Topup VietQR — 2 bước: chọn Xu → hiện QR */
.topup-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  font-size: 12px;
}
.topup-step {
  color: var(--text-dim);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}
.topup-step.is-active {
  color: #fff;
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.15);
}
.topup-step-sep {
  color: var(--text-dim);
  opacity: 0.6;
}
.topup-amount-preview {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--accent-emerald);
  font-weight: 600;
}

/* Admin UI ẩn mặc định — chỉ bật sau khi xác thực role admin */
.nav-tab[data-role="admin"],
.admin-buy-target-group,
#adminUserManagementSection,
#pillPermAdminApproval,
section.tab-pane[data-role="admin"] {
  display: none !important;
}

body.user-is-admin .nav-tab[data-role="admin"] {
  display: inline-flex !important;
}

/* Trợ lý chỉ dùng tab Thành Viên */
body.user-is-assistant .nav-tab[data-tab="tab-members"] {
  display: inline-flex !important;
}
body.user-is-assistant section.tab-pane[data-role="admin"] {
  display: none;
}
body.user-is-assistant section#tab-members.tab-pane.active {
  display: block !important;
}

body.user-is-admin .admin-buy-target-group,
body.user-is-admin #adminUserManagementSection,
body.user-is-admin #pillPermAdminApproval {
  display: block !important;
}

body.user-is-admin section.tab-pane[data-role="admin"] {
  display: none;
}

body.user-is-admin section.tab-pane[data-role="admin"].active {
  display: block !important;
}

/* Background Ambient Glow */
.bg-glow-1 {
  position: fixed;
  top: -15%;
  left: -10%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.16) 0%, rgba(0, 0, 0, 0) 70%);
  z-index: 0;
  pointer-events: none;
}

.bg-glow-2 {
  position: fixed;
  bottom: -20%;
  right: -10%;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
  z-index: 0;
  pointer-events: none;
}

.bg-glow-3 {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 900px;
  height: 500px;
  background: radial-gradient(ellipse, rgba(168, 85, 247, 0.06) 0%, rgba(0, 0, 0, 0) 70%);
  z-index: 0;
  pointer-events: none;
}

/* ── NAVBAR ──────────────────────────────────────────────────────────────── */
/* ── NAVBAR (TWO-TIER ULTRA MODERN) ──────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 9, 14, 0.94);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 24px 8px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.navbar-top {
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  font-size: 22px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(6, 182, 212, 0.3));
  border: 1px solid var(--border-glow);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-glow);
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-text h1 {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, #ffffff 40%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.version-badge {
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.brand-text p {
  font-size: 11px;
  color: var(--text-muted);
}

.header-center-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.task-indicator-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #c7d2fe;
  transition: all 0.2s;
}

.task-indicator-pill:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: var(--primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Wallet Badge Pill */
.wallet-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(6, 182, 212, 0.15) 100%);
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 5px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.wallet-badge-pill:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(6, 182, 212, 0.25) 100%);
  border-color: var(--accent-emerald);
  transform: translateY(-1px);
}

.wallet-icon {
  font-size: 16px;
}

.wallet-text-group {
  display: flex;
  flex-direction: column;
}

.wallet-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  line-height: 1;
}

.wallet-amount {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent-emerald);
  font-family: var(--font-mono);
}

.wallet-add-btn {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  margin-left: 2px;
}

/* User Badge Pill */
.user-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 5px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.user-badge-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

.user-avatar-icon {
  font-size: 16px;
}

.user-text-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.user-role-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.user-role-tag.admin {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
}

.user-role-tag.assistant {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  color: #111;
}

.user-role-tag.user {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
}

body.user-is-assistant .assistant-hide {
  display: none !important;
}

.btn-icon-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
}

.btn-logout {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fb7185;
}

.btn-logout:hover {
  background: rgba(244, 63, 94, 0.25);
  border-color: var(--accent-rose);
  color: #fff;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #34d399;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
  animation: pulse 2s infinite;
}

/* ── NAVBAR BOTTOM (CATEGORIZED TABS) ────────────────────────────────────── */
.navbar-bottom {
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  overflow: visible;
}

.nav-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: flex-start;
  gap: 6px 4px;
  background: rgba(15, 20, 34, 0.8);
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  width: 100%;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.tab-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 1px 5px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ── BUTTONS & GENERAL FORM CONTROLS ──────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--radius-md);
}

.btn-icon {
  padding: 8px 14px;
}

.font-mono {
  font-family: var(--font-mono) !important;
}

/* ── MAIN CONTAINER & TAB PANES ────────────────────────────────────────────── */
.main-container {
  max-width: 1560px;
  margin: 0 auto;
  padding: 28px 24px;
  position: relative;
  z-index: 10;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.section-header h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, #ffffff 60%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── TAB 1: CONTROL PANEL & GALLERY ────────────────────────────────────────── */
.control-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 13px 44px 13px 46px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-main);
  font-size: 14px;
  font-family: var(--font-sans);
  outline: none;
  transition: all 0.2s ease;
}

.search-box input:focus {
  border-color: var(--primary);
  background: rgba(18, 22, 36, 0.95);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.btn-clear {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-btn {
  padding: 7px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35);
}

/* Templates Grid */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 22px;
}

.template-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.template-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
  box-shadow: 0 16px 36px -12px rgba(0, 0, 0, 0.7), var(--shadow-glow);
}

.card-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  background: #060912;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: #070a14;
  transition: transform 0.35s ease;
  display: block;
}

.template-card:hover .preview-img {
  transform: scale(1.03);
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(9, 13, 24, 0.8);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: opacity 0.2s ease;
  backdrop-filter: blur(4px);
  z-index: 3;
}

.template-card:hover .card-overlay {
  opacity: 1;
}

.brand-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  z-index: 4;
}

.badge-gg88 { background: linear-gradient(135deg, #f59e0b, #d97706); color: #000; }
.badge-c168 { background: linear-gradient(135deg, #ef4444, #b91c1c); color: #fff; }
.badge-mm88 { background: linear-gradient(135deg, #06b6d4, #0284c7); color: #fff; }
.badge-llwin { background: linear-gradient(135deg, #10b981, #059669); color: #fff; }
.badge-xx88 { background: linear-gradient(135deg, #a855f7, #7c3aed); color: #fff; }
.badge-rr88 { background: linear-gradient(135deg, #298af6, #1d4ed8); color: #fff; }
.badge-alo8 { background: linear-gradient(135deg, #ec4899, #be185d); color: #fff; }
.badge-rr88 { background: linear-gradient(135deg, #8b5cf6, #6d28d9); color: #fff; }
.badge-sv128 { background: linear-gradient(135deg, #f97316, #c2410c); color: #fff; }
.badge-tipslot { background: linear-gradient(135deg, #eab308, #ca8a04); color: #000; }
.badge-khac { background: linear-gradient(135deg, #64748b, #475569); color: #fff; }

.card-body {
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 12px;
}

.card-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  min-height: 2.8em;
  margin: 0;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
}

.tpl-chip {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(165, 180, 252, 0.28);
  border-radius: 6px;
  padding: 3px 7px;
  line-height: 1.3;
}

.tpl-live-name {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: #a5f3fc;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tpl-live-name:hover {
  color: #ecfeff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
}

.card-actions .btn {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  border-radius: 10px;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.card-actions .btn-apply {
  box-shadow: none;
}

.card-actions .btn-open-live,
.card-actions .btn-secondary.btn-open-live {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #e8eefc;
}

.card-actions .btn-open-live:hover,
.card-actions .btn-secondary.btn-open-live:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(165, 243, 252, 0.45);
  color: #fff;
}

/* legacy class hooks (nếu còn chỗ khác) */
.cname-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  background: rgba(6, 10, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
}

a.cname-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

a.cname-link:hover {
  border-color: rgba(6, 182, 212, 0.35);
  background: rgba(6, 182, 212, 0.08);
}

.cname-label {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(165, 180, 252, 0.28);
  border-radius: 6px;
  padding: 2px 8px;
  line-height: 1.4;
}

.cname-open {
  color: var(--accent-cyan);
  font-size: 12px;
  flex-shrink: 0;
  opacity: 0.85;
}

.cname-val {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: #67e8f9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-copy {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 13px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.btn-copy:hover {
  opacity: 1;
}

.card-footer {
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid var(--border-subtle);
}

.card-footer .btn {
  width: 100%;
}

.card-footer-actions {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 8px;
}

.card-footer-actions .btn {
  width: auto;
  min-height: 38px;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--text-main);
  border-color: rgba(6, 182, 212, 0.45);
  background: rgba(6, 182, 212, 0.08);
}

.btn-open-live {
  text-decoration: none;
}

/* ── TAB 2 & 3: WIZARD FORMS ──────────────────────────────────────────────── */
.wizard-container {
  max-width: 780px;
  margin: 0 auto;
}

.sub-nav-pills {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  background: var(--bg-card);
  padding: 6px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.sub-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s ease;
}

.sub-pill.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.wizard-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
}

.wizard-header {
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 16px;
}

.wizard-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.wizard-header p {
  font-size: 13px;
  color: var(--text-muted);
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.required {
  color: var(--accent-rose);
}

.form-control,
.form-select,
.input-with-button input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 14px;
  font-family: var(--font-sans);
  outline: none;
  transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus,
.input-with-button input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.input-with-button {
  display: flex;
  gap: 8px;
}

.input-with-button .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.field-hint {
  font-size: 12px;
  color: var(--text-dim);
}

.field-feedback {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
}

.field-feedback.available {
  color: var(--accent-emerald);
}

.field-feedback.unavailable {
  color: var(--accent-amber);
}

.template-inline-preview {
  margin-top: 8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
}

.template-inline-preview img {
  width: 80px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
}

.template-inline-preview-info {
  font-size: 12px;
}

.form-actions {
  margin-top: 10px;
}

.form-actions .btn {
  width: 100%;
}

/* ── TAB 4: DOMAIN MANAGER ────────────────────────────────────────────────── */
.domain-manager-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.domains-stats-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  white-space: nowrap;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.stat-label {
  color: var(--text-muted);
}

.stat-val {
  color: var(--accent-cyan);
  font-weight: 700;
  font-family: var(--font-mono);
}

.domains-table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.domains-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.domains-table th {
  background: rgba(9, 12, 20, 0.9);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.domains-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.domains-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.dom-name-link {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  transition: color 0.2s;
}

.dom-name-link:hover {
  color: var(--accent-cyan);
  text-decoration: underline;
}

.dom-target-url {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #38bdf8;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}

.dom-repo-tag {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.action-btn-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

/* ── TAB 5: INSPECTOR CARD ────────────────────────────────────────────────── */
.inspector-card {
  max-width: 860px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
}

.inspector-input-box {
  display: flex;
  gap: 10px;
}

.inspector-input-box input {
  flex: 1;
  padding: 14px 18px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 15px;
  font-family: var(--font-sans);
  outline: none;
}

.inspector-input-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.inspector-result-box {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  animation: fadeIn 0.3s ease;
}

.inspect-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.inspect-item {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
}

.inspect-item-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.inspect-item-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.inspect-actions {
  display: flex;
  gap: 10px;
}

/* ── MODALS & OVERLAYS ────────────────────────────────────────────────────── */
body.modal-open {
  overflow: hidden;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  contain: layout style;
}

.modal.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 10, 0.92);
}

.modal-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 520px;
  max-height: min(90vh, 860px);
  background: #0f1422;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(0);
  animation: modalPopIn 0.14s ease-out;
  will-change: transform, opacity;
}

@keyframes modalPopIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-lg {
  max-width: 820px;
}

.modal-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}

.modal-subtitle {
  font-size: 12px;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--text-dim);
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: #fff;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: rgba(0, 0, 0, 0.25);
}

.preview-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.preview-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.switch-notice {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid var(--border-glow);
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  color: #c7d2fe;
}

/* Progress Steps in Progress Modal */
.deploy-progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 14px;
}

.deploy-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6366f1, #06b6d4, #10b981);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.6);
}

.progress-steps-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-step-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 13px;
  transition: all 0.25s ease;
}

.progress-step-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-step-item.pending {
  opacity: 0.55;
  color: var(--text-dim);
}

.progress-step-item.active {
  border-color: #06b6d4;
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.12), rgba(99, 102, 241, 0.08));
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.25);
  animation: pulseGlow 1.8s infinite alternate;
  color: #fff;
  opacity: 1;
}

.progress-step-item.success {
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.08);
  color: #ecfdf5;
  opacity: 1;
}

.progress-step-item.failed {
  border-color: rgba(244, 63, 94, 0.5);
  background: rgba(244, 63, 94, 0.08);
  color: #ffe4e6;
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 8px rgba(6, 182, 212, 0.2); }
  100% { box-shadow: 0 0 20px rgba(6, 182, 212, 0.45); }
}

.progress-step-icon {
  font-size: 16px;
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-step-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(6, 182, 212, 0.3);
  border-top-color: #06b6d4;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

.progress-step-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.progress-step-item.active .progress-step-badge {
  background: rgba(6, 182, 212, 0.2);
  color: #22d3ee;
}

.progress-step-item.success .progress-step-badge {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.progress-result-box {
  margin-top: 14px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.15));
  border: 1px solid var(--accent-emerald);
  border-radius: var(--radius-md);
  text-align: center;
}

.progress-result-box h4 {
  color: #34d399;
  font-size: 16px;
  margin-bottom: 6px;
}

.progress-result-box a {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-decoration: underline;
}

/* ── STATE CONTAINERS & SPINNER ───────────────────────────────────────────── */
.state-container {
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  color: var(--text-muted);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-icon {
  font-size: 42px;
}

/* ── TOAST NOTIFICATIONS ──────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  max-width: min(420px, calc(100vw - 32px));
  background: #1e2538;
  border: 1px solid var(--border-glow);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.25s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.toast-icon {
  font-size: 18px;
  line-height: 1.2;
  flex-shrink: 0;
}

.toast-message {
  font-size: 13px;
  color: #fff;
  line-height: 1.45;
  font-weight: 600;
}

.toast.toast-processing {
  background: linear-gradient(135deg, #5c4310 0%, #7a5a12 55%, #8a6a14 100%);
  border-color: rgba(251, 191, 36, 0.65);
  box-shadow: 0 12px 32px rgba(180, 120, 20, 0.45), 0 0 0 1px rgba(251, 191, 36, 0.2);
}

.toast.toast-processing .toast-message {
  color: #fff7d6;
}

.toast.toast-success {
  background: linear-gradient(135deg, #0f2e24 0%, #134e3a 100%);
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow: 0 12px 32px rgba(16, 185, 129, 0.28);
}

.toast.toast-success .toast-message {
  color: #d1fae5;
}

.toast.toast-error {
  background: linear-gradient(135deg, #3f1218 0%, #5c1520 100%);
  border-color: rgba(244, 63, 94, 0.55);
  box-shadow: 0 12px 32px rgba(244, 63, 94, 0.25);
}

.toast.toast-error .toast-message {
  color: #ffe4e6;
}

.toast.toast-info {
  background: #1e2538;
  border-color: var(--border-glow);
}

/* ── 11. SMART BATCH PARSER & DEPLOY STYLES ────────────────────────────── */
.batch-parser-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}

.batch-input-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.batch-quick-actions {
  display: flex;
  gap: 8px;
}

.batch-textarea {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  resize: vertical;
  min-height: 120px;
  margin-bottom: 16px;
}

.batch-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

.batch-parser-actions {
  display: flex;
  justify-content: flex-end;
}

.batch-result-section {
  animation: fadeIn 0.3s ease;
}

.batch-master-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
  gap: 20px;
  flex-wrap: wrap;
}

.batch-mode-selector {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.radio-label:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary);
}

.radio-label input[type="radio"]:checked + span {
  color: var(--accent-cyan);
  font-weight: 600;
}

.batch-bulk-assign {
  display: flex;
  align-items: center;
  gap: 10px;
}

.batch-global-picker-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.batch-global-thumb {
  width: 48px;
  height: 34px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-glow);
  cursor: pointer;
  background: #000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

.batch-global-thumb:hover {
  transform: scale(1.1);
  border-color: var(--accent-cyan);
}

.batch-global-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.batch-table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 20px;
  overflow-x: auto;
}

.batch-table-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 0 4px;
}

.batch-stats-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.batch-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.batch-table th {
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.batch-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.batch-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.batch-table input[type="text"],
.batch-table select {
  width: 100%;
  padding: 7px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.batch-table input[type="text"]:focus,
.batch-table select:focus {
  outline: none;
  border-color: var(--primary);
}

.batch-tpl-select-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.batch-execution-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
  text-align: center;
}

.batch-progress-wrapper {
  margin-bottom: 16px;
  text-align: left;
}

.batch-progress-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
}

.batch-progress-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
}

.batch-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent-cyan));
  border-radius: 99px;
  transition: width 0.3s ease;
}

.batch-run-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.batch-log-box {
  background: #090c15;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #a5b4fc;
  max-height: 250px;
  overflow-y: auto;
}

.batch-log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-weight: 600;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}

.batch-log-line {
  padding: 3px 0;
  line-height: 1.4;
}

.batch-log-line.success {
  color: var(--accent-emerald);
}

.batch-log-line.error {
  color: var(--accent-rose);
}

.batch-log-line.step {
  color: var(--accent-cyan);
}

/* ── RESPONSIVE / MOBILE ──────────────────────────────────────────────────── */
/* Không ẩn section — chỉ xếp lại layout để đủ chỗ trên điện thoại */

@media (max-width: 1100px) {
  .navbar {
    padding: 10px 14px 8px;
  }

  .header-center-info {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .templates-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 992px) {
  .nav-container {
    flex-direction: column;
    align-items: stretch;
  }

  .navbar-top {
    gap: 12px;
  }

  .brand-text p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .nav-actions {
    flex: 1 1 auto;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
  }

  .btn-icon-text span,
  .btn-logout span:last-child {
    display: inline;
  }

  /* Tab bar: cuộn ngang — mọi tab vẫn hiện, không bị cắt mất */
  .navbar-bottom {
    margin: 0 -14px;
    padding: 0 14px;
  }

  .nav-menu {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.45) transparent;
    padding: 8px;
    gap: 6px;
    scroll-snap-type: x proximity;
    mask-image: linear-gradient(90deg, #000 92%, transparent);
    -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent);
  }

  .nav-menu::-webkit-scrollbar {
    height: 3px;
  }

  .nav-menu::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.45);
    border-radius: 99px;
  }

  .nav-tab {
    flex: 0 0 auto;
    scroll-snap-align: start;
    padding: 9px 12px;
    font-size: 12px;
  }

  .main-container {
    padding: 18px 14px 96px;
  }

  .section-header {
    flex-direction: column;
    align-items: stretch;
  }

  .header-tools {
    flex-wrap: wrap;
  }

  .control-panel,
  .filter-bar,
  .cloner-input-box,
  .batch-parser-actions,
  .batch-run-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .cloner-input-box input,
  .cloner-input-box .btn,
  .batch-parser-actions .btn,
  .batch-run-buttons .btn {
    width: 100%;
  }

  .form-grid {
    grid-template-columns: 1fr !important;
  }

  .wizard-card {
    padding: 16px;
  }

  .templates-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* Template card: overlay luôn dùng được trên touch (không phụ thuộc hover) */
  .template-card .card-overlay {
    opacity: 1;
    background: linear-gradient(180deg, transparent 35%, rgba(7, 9, 14, 0.92) 100%);
    align-items: flex-end;
    padding: 12px;
    pointer-events: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .template-card .card-overlay .btn {
    pointer-events: auto;
    width: auto;
  }

  .domains-table-wrapper,
  .batch-table-wrapper {
    margin-left: -2px;
    margin-right: -2px;
    border-radius: var(--radius-md);
    padding: 12px;
  }

  /* Domains: giữ đủ cột, cuộn ngang mượt — không ẩn cột */
  .domains-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .domains-table {
    min-width: 720px;
  }

  .batch-master-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 14px;
  }

  .batch-mode-selector {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .radio-label {
    width: 100%;
    justify-content: flex-start;
    padding: 12px 14px;
  }

  .batch-bulk-assign {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .batch-bulk-assign .control-label {
    font-size: 13px;
  }

  .batch-global-picker-group {
    flex-direction: column;
    align-items: stretch;
  }

  .batch-global-picker-group .form-control,
  .batch-global-picker-group .btn {
    width: 100%;
    max-width: none !important;
  }

  .batch-global-thumb {
    width: 100%;
    height: 72px;
  }

  .batch-table-header-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .batch-stats-info {
    flex-wrap: wrap;
  }

  /* Batch rows → card stack: mọi field vẫn hiện đủ */
  .batch-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 12px;
  }

  .batch-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .batch-table tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .batch-table tr.batch-row-card,
  .batch-table tbody tr {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    grid-template-areas:
      "check stt del"
      "domain domain domain"
      "link link link"
      "tele tele tele"
      "tpl tpl tpl"
      "status status status";
    gap: 8px 10px;
    width: 100%;
    margin: 0;
    padding: 14px;
    background: rgba(15, 19, 32, 0.95);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  }

  .batch-table tr.batch-row-card:hover {
    background: rgba(24, 30, 48, 0.98);
  }

  .batch-table td {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    border: none !important;
    padding: 0 !important;
    text-align: left !important;
  }

  .batch-table td::before {
    content: attr(data-label);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-dim);
  }

  .batch-table td.batch-cell-check {
    grid-area: check;
    align-items: center;
    justify-content: center;
  }

  .batch-table td.batch-cell-check::before {
    display: none;
  }

  .batch-table td.batch-cell-stt {
    grid-area: stt;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    font-size: 13px !important;
    color: var(--accent-cyan) !important;
  }

  .batch-table td.batch-cell-domain { grid-area: domain; }
  .batch-table td.batch-cell-link { grid-area: link; }
  .batch-table td.batch-cell-tele { grid-area: tele; }
  .batch-table td.batch-cell-tpl { grid-area: tpl; }
  .batch-table td.batch-cell-status { grid-area: status; }

  .batch-table td.batch-cell-del {
    grid-area: del;
    align-items: flex-end;
  }

  .batch-table td.batch-cell-del::before {
    display: none;
  }

  .batch-table input[type="text"],
  .batch-table select {
    width: 100%;
    min-height: 42px;
    font-size: 14px;
  }

  .batch-tpl-select-cell {
    width: 100%;
  }

  .batch-tpl-select-cell select {
    flex: 1;
  }

  .batch-execution-card {
    padding: 14px;
  }

  .batch-log-box {
    max-height: 240px;
  }

  .modal-content,
  .modal-lg {
    max-width: calc(100vw - 16px) !important;
    margin: 8px;
    max-height: calc(100dvh - 16px);
  }

  .modal-body {
    max-height: min(70dvh, 560px);
  }

  .pagination-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .pagination-controls {
    justify-content: center;
    flex-wrap: wrap;
  }

  .task-item-card {
    padding: 14px;
  }

  .cloner-hero-card {
    padding: 16px;
  }
}

@media (max-width: 640px) {
  .navbar {
    padding: 8px 12px calc(8px + env(safe-area-inset-top, 0px));
  }

  .brand-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .brand-text h1 {
    font-size: 13px;
  }

  .version-badge {
    font-size: 9px;
  }

  .brand-text p {
    font-size: 10px;
  }

  .wallet-badge-pill,
  .user-badge-pill {
    padding: 6px 10px;
    font-size: 12px;
  }

  .wallet-label,
  .user-role-tag {
    font-size: 9px;
  }

  .btn-icon-text {
    padding: 8px 10px;
  }

  .btn-icon-text span:last-child,
  .btn-logout span:last-child {
    display: none;
  }

  .section-header h2 {
    font-size: 18px;
  }

  .main-container {
    padding: 14px 12px calc(88px + env(safe-area-inset-bottom, 0px));
  }

  .nav-tab-icon {
    font-size: 14px;
  }

  /* Touch target rõ hơn */
  .btn,
  .filter-btn,
  .nav-tab,
  .radio-label {
    min-height: 42px;
  }

  .sub-pill {
    white-space: nowrap;
  }

  /* Sub-nav cuộn ngang, không mất pill */
  .sub-nav-pills {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .sub-nav-pills .sub-pill {
    flex: 0 0 auto;
  }
}

/* Landscape phone */
@media (max-width: 900px) and (orientation: landscape) {
  .navbar {
    position: sticky;
  }

  .nav-menu {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .modal-body {
    max-height: 60dvh;
  }
}

/* ── USER AUTH & WALLET PILL ────────────────────────────────────────────── */
.user-auth-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-badge-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
  font-weight: 600;
}

.user-badge-pill:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.user-role-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--primary);
  color: #fff;
}

.user-role-tag.assistant {
  background: #f59e0b;
  color: #111;
}

.user-role-tag.user {
  background: var(--accent-cyan);
  color: #000;
}

.wallet-badge-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
}

.wallet-badge-pill:hover {
  background: rgba(16, 185, 129, 0.25);
  transform: translateY(-1px);
}

/* ── TASK QUEUE CARDS & PROGRESS ──────────────────────────────────────────── */
.task-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin-bottom: 14px;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.task-item-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.5);
}

.task-item-card.running {
  border-left: 4px solid var(--accent-cyan);
}

.task-item-card.success {
  border-left: 4px solid var(--accent-emerald);
}

.task-item-card.failed {
  border-left: 4px solid var(--accent-rose);
}

.task-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  overflow: hidden;
  margin: 12px 0 8px 0;
}

.task-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent-cyan) 100%);
  border-radius: 10px;
  transition: width 0.4s ease;
}

.task-progress-bar.success {
  background: var(--accent-emerald);
}

.task-progress-bar.failed {
  background: var(--accent-rose);
}

.task-step-log {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(0,0,0,0.3);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  max-height: 160px;
  overflow-y: auto;
  line-height: 1.6;
}

/* ── VIP WEB CLONER ───────────────────────────────────────────────────────── */
.cloner-hero-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(6, 182, 212, 0.08) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin-bottom: 25px;
}

.cloner-input-box {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

/* ── 1-CLICK MODE SWITCHER BUTTON ────────────────────────────────────────── */
.btn-switch-mode {
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--accent-cyan);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-switch-mode:hover {
  background: rgba(6, 182, 212, 0.3);
  border-color: var(--accent-cyan);
  color: #fff;
}

.dir-jump-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.dir-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.dir-stat {
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
}

.dir-stat-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.dir-stat-value {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
}

.dir-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.dir-search {
  flex: 1 1 260px;
  min-width: 200px;
}

.dir-select {
  flex: 0 1 170px;
  min-width: 140px;
}

.pagination-host {
  padding: 12px 16px 16px;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
}

.pagination-info {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination-page {
  min-width: 72px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

.pagination-btn[disabled] {
  opacity: 0.35;
  pointer-events: none;
}

/* ── BASE COMPONENTS (class đã dùng trong HTML/JS) ───────────────────────── */
.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 14px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-group > input:not([class]):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="range"]):not([type="color"]),
.form-group > textarea:not([class]) {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 14px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group > input:not([class]):focus,
.form-group > textarea:not([class]):focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-input::placeholder,
.form-control::placeholder,
.form-group > input::placeholder,
.form-group > textarea::placeholder {
  color: var(--text-dim);
}

textarea.form-input {
  resize: vertical;
  line-height: 1.55;
}

select.form-input,
select.form-control,
.form-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  cursor: pointer;
}

select option {
  background: #0f1422;
  color: var(--text-main);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.full-width {
  grid-column: 1 / -1;
}

.modal-md {
  max-width: 600px;
}

.modal-xl {
  max-width: 1100px;
}

.table-wrapper,
.table-container {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table th {
  background: rgba(9, 12, 20, 0.9);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.badge,
.badge-status,
.badge-success,
.badge-warning,
.badge-danger,
.dom-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.badge-success,
.dom-tag.active,
.dom-tag.lp {
  background: rgba(16, 185, 129, 0.14);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.35);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.14);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.35);
}

.badge-danger,
.dom-tag.inactive {
  background: rgba(244, 63, 94, 0.13);
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.35);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.13);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fda4af;
}

.btn-danger:hover {
  background: rgba(244, 63, 94, 0.28);
  color: #fff;
}

.btn[disabled],
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
}

.btn-group {
  display: inline-flex;
  gap: 4px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 16px;
  color: var(--text-muted);
  text-align: center;
}

.filter-tab {
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  font-family: var(--font-sans);
  white-space: nowrap;
  cursor: pointer;
}

.filter-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.modal-content > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.modal-content > form > .modal-body {
  flex: 1 1 auto;
  min-height: 0;
}

/* ── POPUP GÁN TÊN MIỀN ──────────────────────────────────────────────────── */
.mh-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mh-icon {
  flex: 0 0 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 19px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(6, 182, 212, 0.18));
  border: 1px solid rgba(129, 140, 248, 0.35);
}

.mh-sub {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.assign-modal {
  max-width: 640px;
}

.assign-modal .modal-body {
  max-height: none;
  gap: 14px;
  padding: 18px 20px;
}

.assign-step {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
}

.assign-step-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.assign-step-no {
  flex: 0 0 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18);
}

.assign-step-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.assign-step-text b {
  font-size: 14px;
  color: #fff;
}

.assign-step-text small {
  font-size: 12px;
  color: var(--text-muted);
}

.assign-count {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.assign-count b {
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

.assign-search {
  position: relative;
}

.assign-search > svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.assign-search input {
  width: 100%;
  padding: 10px 12px 10px 38px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
}

.assign-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.assign-dd {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 5;
  max-height: 240px;
  overflow-y: auto;
  padding: 6px;
  background: #121829;
  border: 1px solid rgba(129, 140, 248, 0.35);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

.assign-dd-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.assign-dd-item:hover {
  background: rgba(99, 102, 241, 0.16);
}

.assign-dd-item em {
  flex: 0 0 auto;
  font-style: normal;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent-cyan);
}

.assign-dd-item.is-added {
  opacity: 0.5;
  cursor: default;
}

.assign-dd-item.is-added em {
  color: var(--text-dim);
}

.assign-dd-empty {
  padding: 12px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.assign-textarea {
  min-height: 110px;
  resize: vertical;
  font-size: 13px;
  line-height: 1.6;
}

.assign-hint {
  font-size: 12px;
  color: var(--accent-amber);
}

.assign-hint:empty {
  display: none;
}

.assign-hint code {
  font-family: var(--font-mono);
  color: #fcd34d;
}

.assign-user-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
  padding: 2px;
  margin: 0 -2px;
}

.au-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: rgba(11, 14, 24, 0.6);
  color: var(--text-main);
  font-family: var(--font-sans);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.au-item:hover {
  border-color: rgba(129, 140, 248, 0.45);
  background: rgba(99, 102, 241, 0.08);
}

.au-item.is-selected {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.16);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.au-item.is-locked {
  opacity: 0.6;
}

.au-avatar {
  flex: 0 0 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 12.5px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #0891b2, #06b6d4);
}

.au-avatar.au-admin {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.au-avatar.au-assistant {
  background: linear-gradient(135deg, #d97706, #f59e0b);
}

.au-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.au-main b,
.au-main small {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.au-main b {
  font-size: 14px;
  font-weight: 700;
}

.au-main small {
  font-size: 12px;
  color: var(--text-muted);
}

.au-meta {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.au-meta small {
  font-size: 11.5px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.au-role {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(6, 182, 212, 0.14);
  color: #67e8f9;
}

.au-role-admin {
  background: rgba(99, 102, 241, 0.2);
  color: #c7d2fe;
}

.au-role-assistant {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
}

.au-check {
  flex: 0 0 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(148, 163, 184, 0.35);
}

.au-item.is-selected .au-check {
  border-color: var(--primary);
  background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.assign-footer {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.assign-summary {
  min-width: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.assign-summary b {
  color: #fff;
}

.assign-actions {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

/* ── MOBILE APP SHELL ─────────────────────────────────────────────────────── */
.mnav,
.msheet {
  display: none;
}

@keyframes sheetUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@media (max-width: 760px) {
  /* Nền phát sáng 700–900px làm layout viewport rộng hơn màn hình → popup/toast lệch */
  .bg-glow-1,
  .bg-glow-2,
  .bg-glow-3 {
    display: none;
  }

  body {
    background:
      radial-gradient(120% 50% at 0% 0%, rgba(99, 102, 241, 0.13), transparent 60%),
      radial-gradient(100% 45% at 100% 100%, rgba(6, 182, 212, 0.09), transparent 60%),
      var(--bg-dark);
    -webkit-tap-highlight-color: transparent;
  }

  /* Header gọn: logo + ví; điều hướng chuyển xuống thanh đáy */
  .navbar {
    padding: calc(8px + env(safe-area-inset-top, 0px)) 14px 8px;
    gap: 0;
  }

  .navbar-top {
    flex-wrap: nowrap;
    gap: 10px;
  }

  .brand {
    flex: 1 1 auto;
    min-width: 0;
    gap: 10px;
  }

  .brand-icon {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    font-size: 17px;
    border-radius: 10px;
  }

  .brand-text {
    min-width: 0;
  }

  .brand-text h1 {
    font-size: 14px;
    letter-spacing: 0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand-text p,
  .version-badge,
  .header-center-info,
  .user-badge-pill,
  #globalRefreshBtn,
  .btn-logout,
  .navbar-bottom {
    display: none !important;
  }

  .nav-actions {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .wallet-badge-pill {
    gap: 6px;
    padding: 6px 8px 6px 10px;
    border-radius: 999px;
  }

  .wallet-label {
    display: none;
  }

  .wallet-icon {
    font-size: 14px;
  }

  .wallet-amount {
    font-size: 13px;
  }

  .wallet-add-btn {
    display: none;
  }

  .wallet-badge-pill {
    padding: 6px 12px;
  }

  /* Khung nội dung */
  .main-container {
    padding: 16px 14px calc(96px + env(safe-area-inset-bottom, 0px));
  }

  .section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 16px;
  }

  .section-header h2 {
    font-size: 19px;
    line-height: 1.3;
  }

  .section-desc {
    font-size: 12.5px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .header-tools {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px !important;
    width: 100%;
  }

  .header-tools > * {
    width: 100%;
    min-width: 0;
    justify-content: center;
  }

  .header-tools > :only-child,
  .header-tools > :last-child:nth-child(odd),
  .header-tools > .btn-group {
    grid-column: 1 / -1;
  }

  .header-tools > .btn-group ~ * {
    grid-column: 1 / -1;
  }

  .header-tools > .btn-group {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px !important;
  }

  .card {
    padding: 14px !important;
    border-radius: 14px;
  }

  .btn {
    min-height: 42px;
    padding: 9px 14px;
    font-size: 13.5px;
    border-radius: 11px;
  }

  .btn-sm {
    min-height: 38px;
    padding: 7px 12px;
    font-size: 12.5px;
  }

  .btn:hover,
  .btn-primary:hover {
    transform: none;
  }

  /* ≥16px để iOS không tự zoom khi chạm ô nhập */
  input[type="text"],
  input[type="search"],
  input[type="number"],
  input[type="password"],
  input[type="url"],
  input[type="email"],
  input[type="tel"],
  select,
  textarea {
    font-size: 16px !important;
  }

  .search-box input {
    padding: 12px 40px 12px 42px;
    border-radius: 12px;
  }

  .input-with-button .btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .input-with-button input {
    min-width: 0;
  }

  [style*="grid-template-columns: 1fr 1"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #pickerTemplatesGrid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .form-actions > div[style*="display: flex"] {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .form-actions > div[style*="display: flex"] > .btn-primary:first-child {
    grid-column: 1 / -1;
  }

  .topup-amount-row {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .topup-amount-row > input {
    grid-column: 1 / -1;
  }

  .topup-amount-row > .btn {
    padding: 6px 4px;
  }

  .topup-qr-grid {
    grid-template-columns: 1fr !important;
  }

  .form-group > div[style*="space-between"] {
    flex-direction: column;
    align-items: stretch !important;
    gap: 8px;
  }

  .inspector-card {
    padding: 16px;
  }

  .inspector-input-box {
    flex-direction: column;
  }

  .inspector-input-box .btn {
    width: 100%;
  }

  .wizard-header h3 {
    font-size: 16px;
    line-height: 1.35;
  }

  .wizard-header p {
    font-size: 12.5px;
  }

  .filter-tabs,
  .sub-nav-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .filter-tabs::-webkit-scrollbar,
  .sub-nav-pills::-webkit-scrollbar {
    display: none;
  }

  .filter-btn,
  .filter-tab {
    flex: 0 0 auto;
    white-space: nowrap;
    min-height: 36px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12.5px;
  }

  .domain-manager-panel {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .domains-stats-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 14px;
    padding: 10px 12px;
    white-space: normal;
  }

  .stat-item {
    justify-content: space-between;
    min-width: 0;
    font-size: 12px;
  }

  .wallet-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
  }

  .wallet-summary > .card:first-child {
    grid-column: 1 / -1;
  }

  .wallet-summary > .card div[id] {
    font-size: 20px !important;
  }

  .wallet-summary > .card:first-child div[id] {
    font-size: 26px !important;
  }

  .dir-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .dir-stat {
    padding: 12px;
  }

  .dir-stat-value {
    font-size: 19px;
  }

  .dir-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .dir-search {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .dir-select {
    min-width: 0;
  }

  .dir-toolbar > .btn:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .pagination-host {
    padding: 12px 0 4px;
  }

  /* Bảng → danh sách thẻ (nhãn cột gắn bởi labelTablesForCards) */
  .domains-table-wrapper,
  .table-wrapper,
  .table-container {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible;
    border-radius: 0;
  }

  table.mc-table {
    min-width: 0 !important;
    width: 100%;
  }

  table.mc-table:not([style*="none"]) {
    display: block !important;
  }

  table.mc-table > thead {
    display: none;
  }

  table.mc-table > tbody {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  table.mc-table > tbody > tr {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    padding: 14px;
    background: linear-gradient(180deg, rgba(20, 26, 44, 0.92), rgba(13, 17, 30, 0.92));
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  }

  table.mc-table > tbody > tr > td {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    min-width: 0;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    text-align: left !important;
    font-size: 13px;
    overflow-wrap: anywhere;
  }

  table.mc-table > tbody > tr > td::before {
    content: attr(data-label);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-dim);
  }

  table.mc-table > tbody > tr > td[data-label=""]::before,
  table.mc-table > tbody > tr > td.mc-title::before,
  table.mc-table > tbody > tr > td.mc-idx::before,
  table.mc-table > tbody > tr > td.mc-actions::before {
    display: none;
  }

  table.mc-table > tbody > tr > td.mc-title {
    grid-column: 1 / -1;
    order: -2;
    padding: 0 48px 10px 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
  }

  table.mc-table > tbody > tr > td.mc-idx {
    position: absolute;
    top: 14px;
    right: 14px;
    font-size: 11px !important;
    font-family: var(--font-mono);
    color: var(--text-dim) !important;
  }

  table.mc-table > tbody > tr > td.mc-wide,
  table.mc-table > tbody > tr > td.mc-actions {
    grid-column: 1 / -1;
  }

  table.mc-table > tbody > tr > td.mc-empty {
    display: none !important;
  }

  table.mc-table > tbody > tr > td.mc-actions {
    order: 99;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 10px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
  }

  table.mc-table td.mc-actions > div,
  table.mc-table td.mc-actions .action-btn-group {
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px !important;
    width: 100%;
    justify-content: stretch;
  }

  table.mc-table td.mc-actions .btn,
  table.mc-table td.mc-actions .btn-switch-mode {
    flex: 1 1 calc(50% - 8px);
    min-height: 40px;
    justify-content: center;
  }

  table.mc-table > tbody > tr.mc-row-full {
    display: block;
    text-align: center;
  }

  table.mc-table > tbody > tr.mc-row-full > td {
    display: block;
    width: 100%;
    text-align: center !important;
  }

  table.mc-table > tbody > tr.mc-row-full > td::before {
    display: none;
  }

  .dom-target-url {
    max-width: 100%;
    white-space: normal;
    word-break: break-all;
  }

  /* Popup → bottom sheet */
  .modal {
    align-items: flex-end;
    padding: 0;
  }

  .modal-content,
  .modal-lg,
  .modal-md,
  .modal-xl,
  .assign-modal {
    width: 100%;
    max-width: 100% !important;
    margin: 0 !important;
    max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px));
    border-radius: 20px 20px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    animation: sheetUp 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .modal-header {
    position: relative;
    padding: 18px 16px 12px;
    gap: 10px;
  }

  .modal-header::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 50%;
    width: 38px;
    height: 4px;
    margin-left: -19px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.18);
  }

  .modal-header h3 {
    font-size: 16px;
  }

  .modal-close {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
  }

  .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none !important;
    padding: 16px;
  }

  .modal-footer {
    padding: 12px 16px;
  }

  .modal-footer .btn {
    flex: 1;
  }

  .mh-sub {
    font-size: 12px;
  }

  .assign-modal .modal-body {
    padding: 14px;
    gap: 12px;
  }

  .assign-step {
    padding: 12px;
  }

  .assign-user-list {
    max-height: 260px;
  }

  .assign-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .assign-summary {
    text-align: center;
  }

  .assign-actions {
    margin-left: 0;
  }

  .assign-actions .btn {
    flex: 1;
  }

  .toast {
    left: 12px;
    right: 12px;
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    max-width: none;
  }

  body.modal-open .toast {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .task-item-card {
    padding: 14px;
    border-radius: 14px;
  }

  /* Thanh tab đáy */
  .mnav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 960;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    background: rgba(9, 12, 20, 0.94);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid var(--border-subtle);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.35);
  }

  body.auth-pending .mnav,
  body.modal-open .mnav {
    display: none;
  }

  .mnav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 52px;
    padding: 4px 2px;
    border: 0;
    border-radius: 12px;
    background: none;
    color: var(--text-dim);
    font-family: var(--font-sans);
    font-size: 10.5px;
    font-weight: 600;
    cursor: pointer;
  }

  .mnav-item.active {
    color: #fff;
  }

  .mnav-ic {
    position: relative;
    display: grid;
    place-items: center;
    width: 46px;
    height: 28px;
    border-radius: 999px;
    transition: background 0.2s ease;
  }

  .mnav-item.active .mnav-ic {
    color: #c7d2fe;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.38), rgba(6, 182, 212, 0.2));
  }

  .mnav-lb {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mnav-badge {
    position: absolute;
    top: -5px;
    right: 2px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 99px;
    background: var(--accent-rose);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 17px;
    text-align: center;
    box-shadow: 0 0 0 2px #0a0d16;
  }

  .mnav-dot {
    position: absolute;
    top: 1px;
    right: 9px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-rose);
    box-shadow: 0 0 0 2px #0a0d16;
  }

  /* Menu "Thêm" */
  .msheet {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 950;
    pointer-events: none;
  }

  .msheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 5, 10, 0.6);
    opacity: 0;
    transition: opacity 0.2s ease;
  }

  .msheet-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 86dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px 16px calc(84px + env(safe-area-inset-bottom, 0px));
    background: #0e1322;
    border-top: 1px solid rgba(129, 140, 248, 0.3);
    border-radius: 22px 22px 0 0;
    transform: translateY(100%);
    visibility: hidden;
    transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.26s;
  }

  .msheet.open {
    pointer-events: auto;
  }

  .msheet.open .msheet-panel {
    visibility: visible;
    transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .msheet.open .msheet-backdrop {
    opacity: 1;
  }

  .msheet.open .msheet-panel {
    transform: none;
  }

  body.msheet-open {
    overflow: hidden;
  }

  .msheet-grip {
    width: 40px;
    height: 4px;
    margin: 4px auto 14px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.2);
  }

  .msheet-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
  }

  .msheet-avatar {
    flex: 0 0 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #06b6d4);
  }

  .msheet-uinfo {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
  }

  .msheet-uinfo b {
    font-size: 15px;
    color: #fff;
  }

  .msheet-uinfo small {
    font-size: 12px;
    color: var(--text-muted);
  }

  .msheet-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .msheet-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-height: 80px;
    padding: 12px 6px;
    border-radius: 14px;
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    cursor: pointer;
  }

  .msheet-item.active {
    color: #fff;
    border-color: rgba(129, 140, 248, 0.55);
    background: rgba(99, 102, 241, 0.14);
  }

  .msheet-item .mnav-ic {
    width: 40px;
    height: 30px;
  }

  .msheet-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
  }

  .msheet-act {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
  }

  .msheet-act svg {
    width: 20px;
    height: 20px;
  }

  .msheet-act.is-danger {
    color: #fda4af;
    border-color: rgba(244, 63, 94, 0.3);
  }

  .msheet-act.is-primary {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
  }
}

/* ── Lịch sử: cột Hành động rộng + lọc cột kiểu Excel ── */
.history-table th.hcol-action,
.history-table td.hcol-action {
  width: 270px;
  min-width: 270px;
}

.hist-action-tag {
  display: inline-block;
  background: rgba(99, 102, 241, 0.15);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  padding: 6px 11px;
  white-space: normal;
}

.hf-th {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.hf-btn {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
}

.hf-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.hf-btn.is-active {
  color: #0b0f19;
  background: #fbbf24;
  border-color: #fbbf24;
}

.hf-btn[data-sort="asc"]::after,
.hf-btn[data-sort="desc"]::after {
  position: absolute;
  right: -9px;
  top: 3px;
  font-size: 9px;
  color: #fbbf24;
}

.hf-btn[data-sort="asc"]::after {
  content: "▲";
}

.hf-btn[data-sort="desc"]::after {
  content: "▼";
}

.hf-cols {
  display: none;
}

.hf-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 4px 12px;
}

.hf-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.1);
  border-radius: 999px;
  overflow: hidden;
  font-size: 12px;
}

.hf-chip button {
  background: none;
  border: 0;
  color: #fde68a;
  cursor: pointer;
  font: inherit;
  padding: 5px 10px;
}

.hf-chip-open {
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hf-chip .hf-chip-x {
  padding: 3px 10px 4px 2px;
  font-size: 16px;
  line-height: 1;
}

.hf-clear-all {
  background: none;
  border: 0;
  color: var(--accent-rose);
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
}

.hf-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-dim);
}

.hf-pop {
  position: fixed;
  z-index: 1200;
  width: 300px;
  max-height: min(480px, 80vh);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: #141824;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

.hf-pop-head {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.hf-sort {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.hf-sort button {
  padding: 6px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-size: 12px;
  cursor: pointer;
}

.hf-sort button.is-active {
  border-color: #fbbf24;
  color: #fbbf24;
}

.hf-search {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 13px;
}

.hf-list {
  flex: 1;
  min-height: 80px;
  overflow: auto;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.hf-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--text-main);
  cursor: pointer;
}

.hf-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.hf-item input {
  flex-shrink: 0;
  accent-color: #fbbf24;
}

.hf-all {
  font-weight: 600;
}

.hf-val {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hf-cnt {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

.hf-note {
  padding: 4px 6px;
  font-size: 11px;
  color: var(--text-dim);
}

.hf-foot {
  display: flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 760px) {
  .hf-cols {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 4px 2px 8px;
    scrollbar-width: none;
  }

  .hf-col-btn {
    flex-shrink: 0;
    padding: 6px 11px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font-size: 12px;
    white-space: nowrap;
  }

  .hf-col-btn.is-active {
    color: #0b0f19;
    background: #fbbf24;
    border-color: #fbbf24;
    font-weight: 700;
  }

  .hf-count {
    margin-left: 0;
  }

  .hf-pop {
    left: 0 !important;
    right: 0;
    top: auto !important;
    bottom: 0;
    width: auto;
    max-height: 82vh !important;
    border-radius: 16px 16px 0 0;
    padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
  }

  .hf-search {
    font-size: 16px;
  }

  .hf-item {
    padding: 9px 6px;
    font-size: 14px;
  }

  .history-table td.hcol-action {
    width: auto;
    min-width: 0;
  }
}

.ns-results {
  margin-top: 18px;
}

.ns-summary {
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--text-dim);
}

/* PC: bảng lịch sử cuộn ngang thay vì bị cắt cột (mobile giữ nguyên) */
@media (min-width: 993px) {
  .domains-table-wrapper {
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
  }

  .domains-table-wrapper::-webkit-scrollbar {
    height: 8px;
  }

  .domains-table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 8px;
  }

  .history-table {
    min-width: 1360px;
  }

  .history-table th,
  .history-table td:last-child .btn {
    white-space: nowrap;
  }

  .history-table td:last-child .action-btn-group {
    flex-wrap: nowrap;
  }
}

.strange-login-popup {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.62);
}

.strange-login-card {
  width: min(460px, 100%);
  padding: 22px 22px 18px;
  border-radius: 16px;
  border: 1px solid rgba(248, 113, 113, 0.7);
  background: #1a1020;
  color: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.strange-login-kicker {
  margin: 0 0 6px;
  color: #fca5a5;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.strange-login-card h3 {
  margin: 0 0 14px;
  font-size: 20px;
}

.strange-login-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.strange-login-list article {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 13px;
}

.strange-login-prev {
  color: #fcd34d;
}

