/* ============================================
   MODERN THEME - SYNCED WITH WEB UI
   Primary: #6366f1 → #8b5cf6 (Indigo → Purple)
   ============================================ */

/* Import SF Pro Display Font */
@font-face {
  font-family: "SFProDisplay";
  src:
    url("../fonts/SFProDisplay-Regular.woff2") format("woff2"),
    url("../fonts/SFProDisplay-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SFProDisplay";
  src:
    url("../fonts/SFProDisplay-Medium.woff2") format("woff2"),
    url("../fonts/SFProDisplay-Medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SFProDisplay";
  src:
    url("../fonts/SFProDisplay-Bold.woff2") format("woff2"),
    url("../fonts/SFProDisplay-Bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
  /* Primary Gradient */
  --primary-start: #6366f1;
  --primary-end: #8b5cf6;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

  /* Dạng RGB rời của hai màu trên — dùng cho rgba(): bóng đổ và nền mờ.
     CSS không tách được kênh màu từ một biến dạng #hex, nên phải khai riêng.
     Mọi nơi đều viết rgba(var(--primary-rgb, 99, 102, 241), .x) để nếu biến vắng
     mặt thì vẫn ra đúng màu gốc — đổi thương hiệu là no-op tuyệt đối với nền tảng.
     public/js/branding.js chịu trách nhiệm đặt lại hai biến này theo màu đại lý. */
  --primary-rgb: 99, 102, 241;
  --primary-end-rgb: 139, 92, 246;

  /* Secondary Gradient */
  --secondary-start: #ec4899;
  --secondary-end: #f43f5e;
  --secondary-gradient: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);

  /* Accent Gradient */
  --accent-start: #06b6d4;
  --accent-end: #0ea5e9;
  --accent-gradient: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 100%);

  /* Status Colors */
  --success: #10b981;
  --success-light: #34d399;
  --warning: #f59e0b;
  --warning-light: #fbbf24;
  --danger: #ef4444;
  --danger-light: #f87171;
  --info: #3b82f6;

  /* Accent Colors */
  --purple: #8b5cf6;
  --blue: #3b82f6;
  --cyan: #06b6d4;
  --pink: #ec4899;
  --green: #10b981;
  --orange: #f59e0b;

  /* Background & Surface */
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-hover: rgba(var(--primary-rgb, 99, 102, 241), 0.04);
  --bg-active: rgba(var(--primary-rgb, 99, 102, 241), 0.08);

  /* Text Colors */
  --text-primary: #232e3d;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-white: #ffffff;

  /* Border */
  --border-color: rgba(0, 0, 0, 0.08);
  --border-light: rgba(0, 0, 0, 0.05);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-xl:
    0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
  --shadow-primary: 0 4px 14px rgba(var(--primary-rgb, 99, 102, 241), 0.25);
  --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.12);

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-pill: 50px;
  --radius-circle: 50%;

  /* Transitions */
  --transition-fast: all 0.15s ease;
  --transition-normal: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   BASE STYLES
   ============================================ */
html {
  font-size: 14px;
}

body {
  font-family:
    "SFProDisplay",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif !important;
  font-weight: 500;
  background: var(--bg-body);
  color: var(--text-primary);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Override AG-Grid font */
[class*="ag-theme-"] {
  font-family:
    "SFProDisplay",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif !important;
}

/* ============================================
   MAIN APP CONTAINER
   ============================================ */
#app {
  padding: 38px 10px 10px 10px !important;
  background: var(--primary-gradient) !important;
  background-image: var(
    --primary-gradient,
    linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)
  ) !important;
  min-height: 100vh;
}

#app[data="popup"] {
  padding: 20px !important;
  background: var(--primary-gradient) !important;
  background-image: var(
    --primary-gradient,
    linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)
  ) !important;
}

#app[data="ads"],
#app[data="bm"],
#app[data="clone"],
#app[data="page"],
#app[data="via"] {
  padding: 38px 10px 10px 10px !important;
  background: var(--primary-gradient) !important;
  background-image: var(
    --primary-gradient,
    linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)
  ) !important;
}

/* ============================================
   HEADER STYLES
   ============================================ */
#header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 38px;
  color: var(--text-white);
  padding: 0 16px;
  z-index: 100;
  display: flex;
  align-items: center;
}

.header-top {
  height: 38px;
  width: 100%;
}

.header-top a:hover {
  transform: translateY(-1px);
}

.header-bottom {
  height: 40px;
  background: rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border-top-left-radius: var(--radius-sm);
  border-top-right-radius: var(--radius-sm);
  width: calc(100vw - 400px);
}

.titleBar {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.appVersion {
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.65rem;
  font-weight: 500;
  backdrop-filter: blur(4px);
}

/* Header Navigation Pills - Floating Cards Style */
#header .nav-pills-container,
#header .rounded.row {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-radius: 0;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
  height: auto;
  width: fit-content !important;
  max-width: 100%;
  gap: 7px;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

#header .nav-pills-container a,
#header .rounded.row a {
  border-radius: 8px !important;
  font-weight: 600;
  font-size: 0.82rem;
  -webkit-text-stroke: 0;
  transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
  padding: 6px 13px !important;
  margin: 0 !important;
  height: 28px;
  line-height: 14px;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.2px;
  text-transform: none;
  gap: 6px;
  flex: 0 0 auto;
  z-index: 1;
  color: rgba(255, 255, 255, 0.85);
  /* Frosted glass button */
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(255, 255, 255, 0.08) 100%
  );
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Icon trong nav pill */
#header .nav-pills-container a .nav-pill-ic {
  font-size: 14.5px;
  line-height: 1;
  flex-shrink: 0;
  font-weight: normal !important;
  -webkit-text-stroke: 0 !important;
  -webkit-font-smoothing: antialiased;
}

/* Gradient border animation on hover */
#header .nav-pills-container a::before,
#header .rounded.row a::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary-start, #6366f1), var(--primary-end, #8b5cf6), #06b6d4, var(--primary-start, #6366f1));
  background-size: 300% 300%;
  z-index: -2;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#header .nav-pills-container a::after,
#header .rounded.row a::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 7px;
  background: linear-gradient(
    135deg,
    rgba(var(--primary-rgb, 99, 102, 241), 0.2) 0%,
    rgba(var(--primary-end-rgb, 139, 92, 246), 0.1) 100%
  );
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Hover state - gradient border reveal */
#header .nav-pills-container a:not(.active):hover::before,
#header .rounded.row a:not(.bg-white):hover::before {
  opacity: 1;
  animation: gradientShift 2s linear infinite;
}

#header .nav-pills-container a:not(.active):hover::after,
#header .rounded.row a:not(.bg-white):hover::after {
  opacity: 1;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

#header .nav-pills-container a:not(.active):hover,
#header .rounded.row a:not(.bg-white):hover {
  color: #ffffff;
  transform: translateY(-3px) scale(1.02);
  border-color: transparent;
  box-shadow:
    0 8px 25px rgba(var(--primary-rgb, 99, 102, 241), 0.25),
    0 4px 10px rgba(0, 0, 0, 0.15);
}

/* Active state - Solid gradient background */
#header .nav-pills-container a.active,
#header .rounded.row a.bg-white {
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%) !important;
  color: var(--primary-start, #6366f1) !important;
  font-weight: 700;
  border: none !important;
  box-shadow:
    0 4px 20px rgba(var(--primary-rgb, 99, 102, 241), 0.4),
    0 2px 8px rgba(0, 0, 0, 0.1),
    inset 0 -2px 0 rgba(var(--primary-rgb, 99, 102, 241), 0.1);
  transform: translateY(-1px);
}

/* Active state decorators */
#header .nav-pills-container a.active::before,
#header .rounded.row a.bg-white::before {
  opacity: 0;
}

#header .nav-pills-container a.active::after,
#header .rounded.row a.bg-white::after {
  display: none;
}

/* Press down effect */
#header .nav-pills-container a:active,
#header .rounded.row a:active {
  transform: scale(0.95) translateY(0);
  transition: transform 0.1s ease;
}

/* ============================================
   APP WRAPPER & CARDS
   ============================================ */
.app-wrapper {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow:
    0 18px 50px -12px rgba(var(--primary-rgb, 99, 102, 241), 0.45),
    0 4px 14px rgba(15, 23, 42, 0.08),
    inset 0 1px 2px rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

.account-wrapper {
  width: calc(100% - 350px);
  height: calc(100vh - 48px);
}

#app[data="clone"] .account-wrapper {
  width: 100% !important;
}

/* Home dashboard: full width (no side panel) */
#app[data="via"] .account-wrapper {
  width: 100% !important;
}

/* ============================================
   MODERN CARDS
   ============================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Stats Cards with Icons */
.card .rounded-circle {
  transition: var(--transition-normal);
}

.card:hover .rounded-circle {
  transform: scale(1.05);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  font-weight: 600;
  border-radius: var(--radius-md);
  padding: 10px 20px;
  transition: var(--transition-normal);
  border: none;
  font-size: 0.875rem;
}

.btn-primary {
  background: var(--primary-gradient);
  box-shadow: var(--shadow-primary);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(var(--primary-rgb, 99, 102, 241), 0.35);
  background: linear-gradient(135deg, #5558e8 0%, #7c4fe6 100%);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
  color: white;
}

.btn-secondary {
  background: var(--bg-body);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Control Buttons */
.control-btn {
  padding: 0 14px 0 10px;
  display: flex;
  align-items: center;
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: var(--radius-md) !important;
  border: 1px solid var(--border-light) !important;
  background: var(--bg-card);
  transition: var(--transition-normal);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.control-btn:hover {
  background: var(--bg-card);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
  border-color: var(--border-color) !important;
}

.control-btn i {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  color: var(--text-white);
  border-radius: 6px;
  font-weight: 400;
  font-size: 12px;
}

/* Icon-only control buttons */
.control-btn.px-2 i {
  margin-right: 0;
  width: 20px;
  height: 20px;
  background: transparent !important;
  color: var(--text-secondary) !important;
  font-size: 18px;
  /* .btn kế thừa line-height:1.5 → line-box (26px) cao hơn glyph (18px) nên glyph lệch LÊN
     trong nút cao (vd 2 nút #userInfo h-100). line-height:1 để glyph căn giữa đúng. */
  line-height: 1;
}

.control-btn.px-2:hover i {
  color: var(--primary-start) !important;
}

.control-btn i.ri-play-fill {
  background: none !important;
  color: #10b981 !important;
}

.control-btn i.ri-stop-fill {
  background: none !important;
  color: #ef4444 !important;
}

/* ============================================
   FORM CONTROLS
   ============================================ */
.form-control,
.form-select {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  background-color: var(--bg-card);
  transition: var(--transition-normal);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-start);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 99, 102, 241), 0.15);
  outline: none;
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-label {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  font-size: 0.875rem;
}

/* Form Switch - Sleek Minimal Style */
.form-switch .form-check-input {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  border: 2px solid #c7d2e0;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23c7d2e0'/%3e%3c/svg%3e");
  background-position: 2px center;
  background-size: 16px;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
  cursor: pointer;
}

.form-switch .form-check-input:checked {
  border-color: var(--primary-start, #6366f1);
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%236366f1'/%3e%3c/svg%3e");
  background-position: calc(100% - 2px) center;
}

.form-switch .form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 99, 102, 241), 0.15);
  outline: none;
  border-color: var(--primary-start, #6366f1);
}

.form-switch .form-check-input:hover {
  border-color: #a5b4c8;
}

.form-switch .form-check-input:checked:hover {
  border-color: #4f46e5;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%234f46e5'/%3e%3c/svg%3e");
}

/* Checkbox & Radio */
.form-check-input {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: var(--transition-normal);
}

.form-check-input:checked {
  background: var(--primary-gradient);
  border-color: var(--primary-start);
}

.form-check-input[type="radio"] {
  border-radius: var(--radius-circle);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
  font-weight: 600;
  padding: 3.5px 6.5px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  letter-spacing: 0.3px;
}

.badge.rounded-pill {
  border-radius: var(--radius-pill);
  padding: 4px 10px;
}

.text-bg-primary,
.badge-primary {
  background: var(--primary-gradient) !important;
}

.text-bg-success,
.badge-success {
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%) !important;
}

.text-bg-danger,
.badge-danger {
  background: linear-gradient(135deg, #ef4444 0%, #f87171 100%) !important;
}

.text-bg-warning,
.badge-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%) !important;
  color: white !important;
}

.text-bg-info,
.badge-info {
  background: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 100%) !important;
}

/* ============================================
   PANELS & SIDEBARS
   ============================================ */
#panel,
#adPanel {
  background: var(--bg-body);
  border-left: 1px solid var(--border-light);
}

/* Adjust height to stop above footer bar */
#adPanel {
  top: 98px !important; /* Move up a bit */
  height: calc(
    100% - 153px
  ) !important; /* Adjusted to align with table bottom */
  z-index: 10;
}

/* Footer bar - must be above sidebar */
.account-wrapper > .border-top.p-3.py-2 {
  position: relative;
  z-index: 20;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* Footer stats labels - make all labels bold */
.account-wrapper
  > .border-top.p-3.py-2
  span
  > span:not(.badge):not(.rounded-circle) {
  font-weight: 600;
}

#adPanel > .flex-grow-1 {
  background: var(--bg-body);
}

/* Panel Cards - Sidebar Options */
#adPanel .card,
[data-tool] .card {
  background: var(--bg-card) !important;
  border: none !important;
  border-radius: var(--radius-lg) !important;
  margin-bottom: 12px;
  overflow: hidden;
  transition: var(--transition-normal);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.05),
    0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

#adPanel .card:hover,
[data-tool] .card:hover {
  box-shadow:
    0 4px 12px rgba(var(--primary-rgb, 99, 102, 241), 0.1),
    0 2px 4px rgba(0, 0, 0, 0.05) !important;
  transform: translateY(-1px);
}

/* Panel Toggle Headers */
#adPanel .card > .p-3:first-child,
[data-tool] .card > .p-3:first-child {
  background: transparent;
  padding: 16px !important;
}

/* Panel Icons - Simple colored icons without background */
#adPanel .form-check-label i,
[data-tool] .form-check-label i {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  font-size: 20px;
  margin-right: 12px !important;
}

/* Colorful Icons - dùng inline style trên HTML, không dùng nth-child vì card có thể reorder */

/* Toggle switch in side panel - ad-switch-slider style */
#adPanel .form-switch .form-check-input,
[data-tool] .form-switch .form-check-input {
  width: 36px !important;
  height: 20px !important;
  border-radius: 20px !important;
  background-color: #d1d5db !important;
  border: none !important;
  background-image: none !important;
  box-shadow: none !important;
  transition: 0.25s ease !important;
  cursor: pointer;
  position: relative;
  -webkit-appearance: none;
  appearance: none;
}
#adPanel .form-switch .form-check-input::before,
[data-tool] .form-switch .form-check-input::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 2px;
  top: 2px;
  background-color: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: 0.25s ease;
}
#adPanel .form-switch .form-check-input:checked,
[data-tool] .form-switch .form-check-input:checked {
  background: linear-gradient(135deg, var(--primary-end, #8b5cf6), #a855f7) !important;
}
#adPanel .form-switch .form-check-input:checked::before,
[data-tool] .form-switch .form-check-input:checked::before {
  transform: translateX(16px);
}

/* Toolbar Icons - simple colored style */
.control-btn i.ri-filter-line {
  background: transparent !important;
  color: var(--primary-start, #6366f1) !important;
}
.control-btn i.ri-menu-add-fill {
  background: transparent !important;
  color: #10b981 !important;
}
.control-btn i.ri-loop-left-fill {
  background: transparent !important;
  color: #3b82f6 !important;
}
.control-btn i.ri-layout-line {
  background: transparent !important;
  color: var(--primary-end, #8b5cf6) !important;
}
.control-btn i.ri-customer-service-line {
  background: transparent !important;
  color: #f59e0b !important;
}
.control-btn i.ri-equalizer-line {
  background: transparent !important;
  color: #06b6d4 !important;
}
.control-btn i.ri-search-line {
  background: transparent !important;
  color: #ec4899 !important;
}

/* Panel Switch Labels */
#adPanel .form-check-label .fw-bold,
[data-tool] .form-check-label .fw-bold {
  color: var(--text-primary);
  font-weight: 600 !important;
  font-size: 0.9rem;
}

/* Panel Inner Content */
#adPanel .border-top,
[data-tool] .border-top {
  border-color: var(--border-light) !important;
  background: rgba(248, 250, 252, 0.5);
  padding: 16px !important;
}

#foldButton {
  position: absolute;
  width: 24px;
  height: 48px;
  background: var(--bg-card);
  right: 349px;
  top: 50%;
  margin-top: -24px;
  border-top-left-radius: var(--radius-md);
  border-bottom-left-radius: var(--radius-md);
  font-size: 24px;
  line-height: 48px;
  text-align: left;
  cursor: pointer;
  z-index: 99;
  box-shadow: -4px 0 10px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-light);
  border-right: none;
  transition: var(--transition-normal);
  color: var(--text-secondary);
}

#foldButton:hover {
  color: var(--primary-start);
  background: var(--bg-hover);
}

/* ============================================
   CONTENT AREA
   ============================================ */
#viaPanel {
  background: var(--bg-body) !important;
  padding: 24px !important;
}

/* ============================================
   MODALS
   ============================================ */
.modal-content {
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.modal-header {
  background: var(--bg-body);
  border-bottom: 1px solid var(--border-light);
  padding: 20px 24px;
}

.modal-title {
  font-weight: 700;
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  background: var(--bg-body);
  border-top: 1px solid var(--border-light);
  padding: 10px 24px;
}

.btn-close {
  opacity: 0.5;
  transition: var(--transition-normal);
}

.btn-close:hover {
  opacity: 1;
}

/* ============================================
   DROPDOWNS
   ============================================ */
.dropdown-menu {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  animation: fadeInDown 0.2s ease;
}

.dropdown-item {
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-weight: 500;
  transition: var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--primary-start);
}

/* ============================================
   TABS
   ============================================ */
.cat-item,
.tool-item,
#addCategory {
  border: 0;
  padding: 12px 24px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  height: 45px;
  display: inline-block;
  background: transparent;
  font-size: 0.875rem;
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
  position: relative;
  transition: var(--transition-normal);
}

.cat-item.active,
.tool-item.active {
  color: var(--text-primary);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.cat-item:not(.active):hover,
.tool-item:not(.active):hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

/* ============================================
   LOADING STATES
   ============================================ */
#loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* .loader - Moved to style.css */
/*
.loader {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-circle);
  border: 4px solid var(--border-light);
  border-top-color: var(--primary-start);
  animation: spin 0.8s linear infinite;
}
*/

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#loadingData strong {
  color: var(--text-secondary);
  font-weight: 500;
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-body);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: var(--radius-sm);
  transition: var(--transition-normal);
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ============================================
   CONTEXT MENU
   ============================================ */
#contextMenu,
#contextMenuCategory,
#contextMenuPhoi,
#contextMenuWhatsApp,
#contextMenuInsta {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 9999999 !important;
  position: fixed;
  padding: 8px;
  animation: fadeInScale 0.15s ease;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Context menu BM — 2 cột: "Dữ liệu & Clipboard" | "Kiểm tra" */
#contextMenu.ctx-2col {
  display: flex;
  gap: 16px;
  align-items: stretch;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
/* Nền card vẽ bằng ::after để "mụn ruồi" (::before, z-index:-1) nằm SAU nền menu,
   chỉ ló ra ở góc. ::after luôn paint trên ::before (cùng z-index) nên che được chấm. */
#contextMenu.ctx-2col::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}
/* Chấm tròn trắng trang trí góc trên-trái (đồng bộ với các menu khác) */
#contextMenu.ctx-2col::before {
  content: "";
  position: absolute;
  top: -7px;
  left: -7px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  z-index: -1;
}
#contextMenu.ctx-2col .ctx-col {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 0 0 224px;
  width: 224px;
  box-sizing: border-box;
  background: #f4f6fb;
  border: 1px solid rgba(var(--primary-rgb, 99, 102, 241), 0.12);
  border-radius: 12px;
  padding: 6px;
}
/* Mỗi cột đã có card riêng → bỏ đường kẻ ngăn ở giữa cho gọn. */
#contextMenu.ctx-2col .ctx-col + .ctx-col::before {
  display: none;
}
#contextMenu.ctx-2col .ctx-col-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 4px 12px 10px;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--text-primary);
  white-space: nowrap;
  border-bottom: 1px solid var(--border-light);
}
#contextMenu.ctx-2col .ctx-col-head i {
  font-size: 17px;
  color: var(--primary-start, #6366f1);
}
#contextMenu.ctx-2col .dropdown-menu {
  position: static !important;
  display: block !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  min-width: 0 !important;
  background: transparent !important;
  animation: none !important;
}
/* Item trên card cột — hover nổi lên như nút bấm */
#contextMenu.ctx-2col .dropdown-item:hover {
  background: #ffffff;
  color: var(--primary-start);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}
/* Dark mode: card cột + hover */
[data-bs-theme="dark"] #contextMenu.ctx-2col .ctx-col {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}
[data-bs-theme="dark"] #contextMenu.ctx-2col .dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

/* ============================================
   AVATAR
   ============================================ */
.avatar-letter {
  width: 32px;
  height: 32px;
  min-width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: white;
  font-weight: 700;
  font-size: 14px;
  font-family: "SFProDisplay", "Microsoft YaHei", "Segoe UI", sans-serif;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  flex-shrink: 0;
  background-color: #6c757d; /* Màu nền mặc định cho ký tự đặc biệt */
}

/* ============================================
   SELECT2 OVERRIDES
   ============================================ */
.select2-container .select2-selection--single {
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition-normal);
}

.select2-container--default .select2-selection--single:focus,
.select2-container--open .select2-selection--single {
  border-color: var(--primary-start);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 99, 102, 241), 0.15);
}

.select2-container--default
  .select2-selection--single
  .select2-selection__rendered {
  line-height: 40px;
  color: var(--text-primary);
  font-weight: 500;
}

.select2-dropdown {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.select2-results__option--selected {
  background: var(--bg-hover) !important;
}

.select2-results__option--highlighted {
  background: var(--primary-gradient) !important;
}

/* ============================================
   SWEETALERT2 OVERRIDES
   ============================================ */
.swal2-popup {
  border-radius: var(--radius-xl) !important;
  box-shadow: var(--shadow-xl) !important;
  border: none !important;
  padding: 20px !important;
}

.swal2-title {
  font-weight: 700 !important;
  color: var(--text-primary) !important;
}

.swal2-html-container {
  color: var(--text-secondary) !important;
}

.swal2-confirm {
  background: var(--primary-gradient) !important;
  border-radius: var(--radius-md) !important;
  font-weight: 600 !important;
  box-shadow: var(--shadow-primary) !important;
}

.swal2-deny {
  border-radius: var(--radius-md) !important;
  font-weight: 600 !important;
}

.swal2-cancel {
  background: var(--bg-body) !important;
  color: var(--text-secondary) !important;
  border-radius: var(--radius-md) !important;
}

.swal2-container {
  background: rgba(0, 0, 0, 0.5) !important;
  backdrop-filter: blur(4px);
}

/* ============================================
   SUPPORT POPUP
   ============================================ */
.support-popup {
  padding: 0 !important;
  border-radius: 20px !important;
  overflow: hidden;
}

.support-popup .swal2-close {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #f1f5f9 !important;
  color: #64748b !important;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  top: 10px;
  right: 10px;
  z-index: 2;
  opacity: 1;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.support-popup .swal2-close:hover {
  background: #e2e8f0 !important;
  color: #1b2433 !important;
  transform: scale(1.05);
}

.support-popup .swal2-close:focus {
  box-shadow: 0 0 0 2px rgba(var(--primary-end-rgb, 139, 92, 246), 0.3);
}

.support-popup .swal2-html-container {
  padding: 0 !important;
  margin: 0 !important;
}

.sp-wrapper {
  text-align: left;
  padding-top: 8px;
}

.sp-section {
  padding: 16px 20px 4px;
}

.sp-section:last-child {
  padding-bottom: 16px;
}

.sp-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sp-section-label i {
  font-size: 0.85rem;
  color: var(--primary-end, #8b5cf6);
}

.sp-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  text-decoration: none !important;
  color: #232e3d !important;
  background: #f8fafc;
  border: 1px solid rgba(0, 0, 0, 0.04);
  margin-bottom: 8px;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.sp-item:last-child {
  margin-bottom: 0;
}

.sp-item:hover {
  background: #f1f5f9;
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.sp-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sp-item-icon.sp-zalo {
  background: #e8f4fd;
}

.sp-item-icon.sp-admin1 {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: white;
  font-size: 1.1rem;
}

.sp-item-icon.sp-admin2 {
  background: linear-gradient(135deg, var(--primary-end, #8b5cf6), #a855f7);
  color: white;
  font-size: 1.1rem;
}

.sp-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sp-item-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1b2433;
}

.sp-item-desc {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 500;
}

.sp-item-arrow {
  color: #cbd5e1;
  font-size: 1rem;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.sp-item:hover .sp-item-arrow {
  color: var(--primary-end, #8b5cf6);
}

/* ============================================
   AG-GRID OVERRIDES
   ============================================ */
[class*="ag-theme-"] {
  font-family: "SFProDisplay", sans-serif !important;
}

.ag-root-wrapper.ag-layout-normal {
  border: none !important;
  border-radius: var(--radius-lg);
}

.ag-header {
  background: var(--bg-body) !important;
  border-bottom: 1.5px solid rgba(0, 0, 0, 0.12) !important;
  min-height: 40px !important;
}

.ag-header-row {
  height: 40px !important;
}

.ag-header-cell {
  font-weight: 800 !important;
  font-size: 0.86rem !important;
  color: var(--text-secondary);
  height: 40px !important;
}

/* Sortable column khi chưa sort → hiện ⇅ ở đúng vị trí sort icon, opacity nhẹ
   Khi đã sort (asc/desc) → ag-Grid render icon riêng, pseudo-element bị tắt
   Dùng aria-sort thay vì class vì ag-Grid không gắn class .ag-header-cell-sorted-* lên outer cell */
.ag-theme-balham .ag-header-cell.ag-header-cell-sortable:not([aria-sort="ascending"]):not([aria-sort="descending"]) .ag-sort-indicator-container::after {
  content: "⇅";
  display: inline-block;
  opacity: 0.4;
  font-size: 12px;
  margin-left: 2px;
  line-height: 1;
  color: inherit;
}

/* Progressive pin icon — boundary giữa pinned và unpinned */
.pin-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  cursor: pointer;
  opacity: 0.6;
  font-size: 15px;
  line-height: 1;
  color: var(--primary-start, #6366f1);
  transition: opacity 0.15s ease, transform 0.15s ease, color 0.15s ease;
  user-select: none;
}
.pin-toggle-btn:hover {
  opacity: 1;
  transform: scale(1.2);
}
.pin-toggle-btn[data-action="unpin"] {
  opacity: 0.9;
  color: var(--primary-end, #8b5cf6);
}
.pin-toggle-btn[data-action="unpin"]:hover {
  opacity: 1;
  color: #ef4444;
}
.pin-toggle-btn svg {
  width: 1em;
  height: 1em;
  display: block;
  vertical-align: middle;
}
/* Chỉ stroke path có fill="currentColor" — tránh stroke cả viewBox path nền tạo box */
.pin-toggle-btn svg path[fill="currentColor"] {
  stroke: currentColor;
  stroke-width: 0.6;
  stroke-linejoin: round;
}

/* ============================================
   COLUMN FILTER — 3-dot button + popup
   ============================================ */
/* Note: ag-Grid .ag-header-cell đã có position: absolute (cho column virtualization)
   → đủ làm positioning context cho .col-filter-btn absolute, KHÔNG override position của cell */

/* Reserve 24px ở mép phải header để 3-dot button (position:absolute) không đè lên text/sort/pin */
.ag-theme-balham .ag-header-cell .ag-header-cell-label,
.ag-theme-balham .ag-header-cell .ag-cell-label-container {
  padding-right: 22px;
}
/* Pin button (in flex flow) cần margin-left tối thiểu để cách sort indicator */
.pin-toggle-btn { margin-left: 6px; }

/* Cột "Trạng thái" trong SKIP_HEADER_NAMES (không có filter-btn 3-dot) →
   không cần padding-right 22px reserved cho filter-btn. Bỏ padding để đủ chỗ
   text + sort + pin in-flow, chữ "Trạng thái" không bị che. */
.ag-header-cell[col-id="status"] .ag-cell-label-container { padding-right: 0 !important; }

.col-filter-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  margin: 0;
  background: transparent !important;
  border: 0 !important;
  outline: 0 !important;
  cursor: pointer;
  opacity: 0.45;
  color: #6b7280;
  z-index: 5;
  pointer-events: auto;
  transition: opacity 0.15s ease, color 0.15s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  font-family: inherit;
  line-height: 1;
  box-shadow: none !important;
}
.col-filter-btn:hover { opacity: 1; color: var(--primary-start, #6366f1); }
.col-filter-btn:focus, .col-filter-btn:active { outline: 0 !important; box-shadow: none !important; background: transparent !important; }
/* Đang lọc — 3-dot đỏ rực */
.col-filter-btn.has-filter { opacity: 1; color: #ef4444 !important; }
.col-filter-btn.has-filter:hover { color: #dc2626 !important; }
.col-filter-btn::-moz-focus-inner { border: 0; }
.col-filter-btn svg { display: block; pointer-events: none; }

.col-filter-popup {
  position: fixed;
  width: 420px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08), 0 16px 40px rgba(0, 0, 0, 0.14);
  z-index: 1080;
  font-family: inherit;
  font-size: 13px;
  color: #1f2937;
  /* KHÔNG dùng overflow:hidden vì sẽ clip dropdown menu khi mở; thay vào đó border-radius rõ ràng cho footer */
}
.cfp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  gap: 8px;
}
.cfp-title {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.2px;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cfp-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.cfp-clear-link {
  background: none;
  border: none;
  cursor: pointer;
  color: #ef4444;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  padding: 4px 10px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.cfp-clear-link:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
}
.cfp-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  display: flex;
  align-items: center;
  padding: 2px;
  border-radius: 50%;
  transition: color 0.15s, background 0.15s;
}
.cfp-close:hover {
  color: #ef4444;
}
.cfp-close svg { display: block; }
.cfp-body {
  padding: 0 16px 12px;
}
/* Custom dropdown — thay native select, styling được phần menu options */
.cfp-dd {
  position: relative;
  display: inline-block;
  font-family: inherit;
}
.cfp-dd-combinator { display: block; width: 100%; }
.cfp-dd-op { flex: 0 0 124px; }
.cfp-dd-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 12.5px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  color: #1f2937;
  appearance: none;
  -webkit-appearance: none;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cfp-dd-combinator .cfp-dd-trigger { padding: 9px 12px; font-size: 13px; }
.cfp-dd-trigger:hover { border-color: #d1d5db; }
.cfp-dd.open .cfp-dd-trigger {
  border-color: var(--primary-end, #8b5cf6);
  box-shadow: 0 0 0 3px rgba(var(--primary-end-rgb, 139, 92, 246), 0.12);
}
.cfp-dd-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cfp-dd-caret {
  flex-shrink: 0;
  color: #6b7280;
  transition: transform 0.18s ease;
}
.cfp-dd.open .cfp-dd-caret { transform: rotate(180deg); }
.cfp-dd-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: 100%;
  margin: 0;
  padding: 5px;
  list-style: none;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08), 0 12px 32px rgba(0, 0, 0, 0.12);
  z-index: 1090;
  max-height: 220px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0.18s;
  pointer-events: none;
}
.cfp-dd.open .cfp-dd-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.cfp-dd-menu li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12.5px;
  color: #374151;
  transition: background 0.12s ease, color 0.12s ease;
}
.cfp-dd-combinator .cfp-dd-menu li { font-size: 13px; padding: 8px 10px; }
.cfp-dd-menu li + li { margin-top: 1px; }
.cfp-dd-menu li:hover {
  background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.08);
  color: #1f2937;
}
.cfp-dd-menu li.active {
  background: linear-gradient(135deg, rgba(var(--primary-rgb, 99, 102, 241), 0.1), rgba(var(--primary-end-rgb, 139, 92, 246), 0.1));
  color: var(--primary-start, #6366f1);
  font-weight: 600;
}
.cfp-dd-text { flex: 1; }
.cfp-dd-check { margin-left: auto; color: var(--primary-start, #6366f1); flex-shrink: 0; }
.cfp-divider {
  border: none;
  border-top: 1px solid #f3f4f6;
  margin: 12px 0;
}
.cfp-conditions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cfp-condition {
  display: flex;
  align-items: center;
  gap: 6px;
}
/* (cfp-op cũ đã thay bằng custom dropdown .cfp-dd-op) */
.cfp-inputs {
  flex: 1;
  display: flex;
  gap: 4px;
  align-items: center;
  min-width: 0;
}
.cfp-value, .cfp-value2 {
  flex: 1;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  font-family: inherit;
  color: #1f2937;
  min-width: 0;
  background: #fff;
}
.cfp-value:focus, .cfp-value2:focus {
  border-color: var(--primary-end, #8b5cf6);
  box-shadow: 0 0 0 3px rgba(var(--primary-end-rgb, 139, 92, 246), 0.12);
}
.cfp-hidden { display: none !important; }
.cfp-del {
  flex: 0 0 auto;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #9ca3af;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.cfp-del:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}
.cfp-del svg { display: block; }
.cfp-add-condition {
  background: none;
  border: none;
  color: var(--primary-end, #8b5cf6);
  font-weight: 600;
  font-size: 13px;
  padding: 10px 0 4px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.cfp-add-condition:hover { color: var(--primary-start, #6366f1); }

/* Mode VALUES — danh sách giá trị có sẵn (compact & polished) */
.cfp-values-wrap { margin-top: 4px; }
.cfp-values-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.cfp-values-search-wrap {
  flex: 1;
  position: relative;
  min-width: 0;
}
.cfp-values-search-icon {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
  z-index: 1;
}
.cfp-values-search {
  width: 100%;
  padding: 7px 10px 7px 30px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: 12.5px;
  outline: none;
  font-family: inherit;
  color: #1f2937;
  background: #fff;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cfp-values-search::-webkit-search-cancel-button,
.cfp-values-search::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.cfp-values-search::placeholder { color: #9ca3af; }
.cfp-values-search:focus {
  border-color: var(--primary-end, #8b5cf6);
  box-shadow: 0 0 0 3px rgba(var(--primary-end-rgb, 139, 92, 246), 0.12);
}
.cfp-values-search-wrap:focus-within .cfp-values-search-icon { color: var(--primary-end, #8b5cf6); }
.cfp-values-all, .cfp-values-none {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  color: #4b5563;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s, background 0.15s, box-shadow 0.15s;
}
.cfp-values-all:hover {
  border-color: var(--primary-end, #8b5cf6);
  color: var(--primary-end, #8b5cf6);
  background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.06);
}
.cfp-values-none:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.06);
}
.cfp-values-count {
  font-size: 11px;
  color: var(--primary-start, #6366f1);
  font-weight: 700;
  background: linear-gradient(135deg, rgba(var(--primary-end-rgb, 139, 92, 246), 0.14), rgba(var(--primary-rgb, 99, 102, 241), 0.14));
  padding: 4px 9px;
  border-radius: 12px;
  letter-spacing: 0.2px;
  flex-shrink: 0;
}
.cfp-values-list {
  display: block;
  max-height: 220px;
  overflow-y: auto;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  padding: 3px;
  background: #fff;
}
.cfp-value-item {
  display: flex !important;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 6px 9px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12.5px;
  color: #374151;
  transition: background 0.1s, color 0.1s;
  box-sizing: border-box;
}
.cfp-value-item + .cfp-value-item { margin-top: 1px; }
.cfp-value-item.cfp-value-hidden { display: none !important; }
.cfp-value-item:hover { background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.06); }
.cfp-value-item:has(.cfp-value-cb:checked) {
  background: rgba(var(--primary-rgb, 99, 102, 241), 0.07);
  color: var(--primary-start, #6366f1);
  font-weight: 600;
}
.cfp-value-cb {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--primary-end, #8b5cf6);
  margin: 0;
}
.cfp-value-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cfp-values-list::-webkit-scrollbar { width: 5px; }
.cfp-values-list::-webkit-scrollbar-track { background: transparent; }
.cfp-values-list::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
.cfp-values-list::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* Toggle cards (Loại trừ / Tự động tích chọn) — clone style của ID filter */
.cfp-toggles {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.cfp-toggle-card {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
  user-select: none;
  min-width: 0;
}
.cfp-toggle-card:hover { border-color: #d1d5db; background: #fafafa; }
.cfp-toggle-card.active {
  border-color: var(--primary-end, #8b5cf6);
  background: linear-gradient(135deg, rgba(var(--primary-end-rgb, 139, 92, 246), 0.06), rgba(var(--primary-rgb, 99, 102, 241), 0.06));
  box-shadow: 0 1px 4px rgba(var(--primary-end-rgb, 139, 92, 246), 0.1);
}
.cfp-toggle-info { flex: 1; min-width: 0; }
.cfp-toggle-title { font-size: 12px; font-weight: 600; color: #1f2937; line-height: 1.3; }
.cfp-toggle-card.active .cfp-toggle-title { color: var(--primary-start, #6366f1); }
.cfp-toggle-desc { font-size: 10px; color: #6b7280; margin-top: 2px; line-height: 1.3; }
.cfp-switch {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
  flex-shrink: 0;
}
.cfp-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.cfp-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #d1d5db;
  border-radius: 18px;
  transition: background 0.18s;
}
.cfp-switch-slider::before {
  content: "";
  position: absolute;
  height: 14px;
  width: 14px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.cfp-switch input:checked + .cfp-switch-slider { background: linear-gradient(135deg, var(--primary-end, #8b5cf6), #a855f7); }
.cfp-switch input:checked + .cfp-switch-slider::before { transform: translateX(14px); }
.cfp-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #fafafa;
  border-top: 1px solid #f3f4f6;
  border-radius: 0 0 16px 16px;
}
/* 3 nút footer — 1 dải gradient liên tục từ violet → indigo → teal → green,
   chạy từ "Bỏ lọc" (trái) qua "Chỉ tích chọn" (giữa) đến "Lọc" (phải).
   Mỗi nút pick up màu từ chỗ nút trước kết thúc → seam liền mạch. */
.cfp-clear, .cfp-apply, .cfp-deny {
  flex: 1;
  color: #fff;
  border: none;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s, filter 0.15s;
}
.cfp-clear {
  background: linear-gradient(to right, var(--primary-end, #8b5cf6), var(--primary-start, #6366f1));
  box-shadow: 0 4px 12px rgba(var(--primary-end-rgb, 139, 92, 246), 0.26);
}
.cfp-clear:hover { opacity: 0.94; box-shadow: 0 6px 16px rgba(var(--primary-end-rgb, 139, 92, 246), 0.38); }
.cfp-deny {
  background: linear-gradient(to right, var(--primary-start, #6366f1), #14b8a6);
  box-shadow: 0 4px 12px rgba(var(--primary-rgb, 99, 102, 241), 0.26);
}
.cfp-deny:hover { opacity: 0.94; box-shadow: 0 6px 16px rgba(20, 184, 166, 0.38); }
.cfp-apply {
  background: linear-gradient(to right, #14b8a6, #10b981);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.26);
}
.cfp-apply:hover { opacity: 0.94; box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4); }
.cfp-clear:active, .cfp-apply:active, .cfp-deny:active { transform: scale(0.97); }
.pin-toggle-btn i {
  font-size: inherit;
  line-height: 1;
}

.ag-header-cell-text {
  font-weight: 800 !important;
  font-size: 0.86rem !important;
}

.ag-row {
  border-color: var(--border-light) !important;
  transition: var(--transition-fast);
}

.ag-row:hover {
  background: var(--bg-hover) !important;
}

.ag-row-selected {
  background: var(--bg-active) !important;
}

/* ============================================
   POPUP SPECIFIC STYLES
   ============================================ */
#app[data="popup"] {
  border-radius: var(--radius-xl);
}

#app[data="popup"] .rounded {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(8px);
  border-radius: var(--radius-xl) !important;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-lg);
}

#app[data="popup"] .border-bottom {
  border-color: var(--border-light) !important;
}

/* Popup Icons - Simple colored icons without background */
#app[data="popup"] strong i {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  font-size: 18px;
}

/* Different colors for each popup menu item - no background */
#app[data="popup"] .border-bottom:nth-child(1) strong i {
  color: var(--primary-start, #6366f1) !important;
}
#app[data="popup"] .border-bottom:nth-child(2) strong i {
  color: #10b981 !important;
}
#app[data="popup"] .border-bottom:nth-child(3) strong i {
  color: #f59e0b !important;
}
#app[data="popup"] .border-bottom:nth-child(4) strong i {
  color: #3b82f6 !important;
}
#app[data="popup"] .border-bottom:nth-child(5) strong i {
  color: #ec4899 !important;
}
#app[data="popup"] .border-bottom:nth-child(6) strong i {
  color: #06b6d4 !important;
}
#app[data="popup"] .border-bottom:nth-child(7) strong i {
  color: var(--primary-end, #8b5cf6) !important;
}
#app[data="popup"] .border-bottom:nth-child(8) strong i {
  color: #ef4444 !important;
}

/* Popup Icon Style */
.popup-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.popup-icon i {
  color: white !important;
}

.popup-item {
  transition: var(--transition-fast);
}

.popup-item:hover {
  background: rgba(var(--primary-rgb, 99, 102, 241), 0.03);
}

/* ============================================
   SETTING PAGE
   ============================================ */
#app[data="setting"] {
  background: var(--bg-card) !important;
  padding: 0;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Status dot — chấm trạng thái phát ring nháy (giống .nh-quality 'Live ads ko sao cả')
   Target trực tiếp pattern .bg-X.rounded-circle trong cell (bm.js render inline ko qua createStatusBadge).
   Set color = bg để box-shadow currentColor match màu dot, sau đó animate spread 0→5px fade. */
.ag-theme-balham .ag-cell span.d-flex.rounded-circle.bg-success,
.ag-theme-balham .ag-cell span.d-flex.rounded-circle.bg-danger,
.ag-theme-balham .ag-cell span.d-flex.rounded-circle.bg-warning,
.ag-theme-balham .ag-cell span.d-flex.rounded-circle.bg-info,
.ag-theme-balham .ag-cell span.d-flex.rounded-circle.bg-primary,
.ag-theme-balham .ag-cell span.d-flex.rounded-circle.bg-secondary {
  animation: status-dot-glow 1.6s ease-out infinite;
}
.ag-theme-balham .ag-cell span.d-flex.rounded-circle.bg-success { color: #198754; }
.ag-theme-balham .ag-cell span.d-flex.rounded-circle.bg-danger { color: #dc3545; }
.ag-theme-balham .ag-cell span.d-flex.rounded-circle.bg-warning { color: #ffc107; }
.ag-theme-balham .ag-cell span.d-flex.rounded-circle.bg-info { color: #0dcaf0; }
.ag-theme-balham .ag-cell span.d-flex.rounded-circle.bg-primary { color: #0d6efd; }
.ag-theme-balham .ag-cell span.d-flex.rounded-circle.bg-secondary { color: #6c757d; }
@keyframes status-dot-glow {
  0% {
    box-shadow: 0 0 0 0 currentColor;
  }
  100% {
    box-shadow: 0 0 0 5px transparent;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-gradient {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bg-gradient-primary {
  background: var(--primary-gradient) !important;
}

.bg-gradient-secondary {
  background: var(--secondary-gradient) !important;
}

.bg-gradient-accent {
  background: var(--accent-gradient) !important;
}

.shadow-primary {
  box-shadow: var(--shadow-primary) !important;
}

.hover-lift {
  transition: var(--transition-normal);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* Text Colors using new palette */
.text-primary-new {
  color: var(--primary-start) !important;
}

/* Border helpers */
.border-light-new {
  border-color: var(--border-light) !important;
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */
[data-bs-theme="dark"] {
  --bg-body: #1b2433;
  --bg-card: #232e3d;
  --bg-sidebar: #232e3d;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: rgba(255, 255, 255, 0.1);
  --border-light: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .card {
  background: var(--bg-card);
  border-color: var(--border-light) !important;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  background-color: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-bs-theme="dark"] .modal-content {
  background: var(--bg-card);
}

[data-bs-theme="dark"] .dropdown-menu {
  background: var(--bg-card);
  border-color: var(--border-light);
}

[data-bs-theme="dark"] ::-webkit-scrollbar-track {
  background: var(--bg-card);
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
}

/* ============================================
   DARK MODE — MỞ RỘNG cho surface hardcode (toolbar/adPanel/grid/footer/
   button/input/AG-Grid/SweetAlert). Block này nằm sau cùng modern-theme.css
   (load sau style.css) + selector [data-bs-theme=dark] đủ specificity để đè
   các rule sáng hardcode trong style.css. Bảng màu: body #1b2433 (darkest),
   surface #232e3d, elevated #2e3a4b, text #e2e8f0/#94a3b8, border rgba trắng.
   ============================================ */
[data-bs-theme="dark"] {
  --bs-body-bg: #232e3d; /* surface — dùng bởi .dark-body-bg (toolbar strip) */
  --bs-body-color: #e2e8f0;
  --bs-border-color: rgba(255, 255, 255, 0.1);
  --bs-secondary-bg: #2e3a4b;
  color-scheme: dark;
}

/* Toolbar trên + footer dưới + thanh strip bg-white */
[data-bs-theme="dark"] .border-bottom.bg-white,
[data-bs-theme="dark"] .border-top.bg-white,
[data-bs-theme="dark"] .tkqc-toolbar {
  background: #232e3d !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Panel "Chức năng" bên phải + app wrapper */
[data-bs-theme="dark"] #adPanel,
[data-bs-theme="dark"] .app-wrapper {
  background: #232e3d !important;
}
/* Viền bao cụm content (.app-wrapper rounded) — tách khỏi khung #app cùng màu,
   thay cho tương phản viền tím ở light. + divider grid|panel rõ. */
[data-bs-theme="dark"] .app-wrapper {
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  box-shadow:
    0 18px 50px -12px rgba(var(--primary-rgb, 99, 102, 241), 0.22),
    0 4px 14px rgba(0, 0, 0, 0.35),
    inset 0 1px 1px rgba(255, 255, 255, 0.07) !important;
}
[data-bs-theme="dark"] #adPanel {
  border-left-color: rgba(255, 255, 255, 0.1) !important;
}

/* Khung viền bao quanh = padding #app → ĐỒNG MÀU header tối #232e3d (user muốn
   viền mép trái/phải/dưới khớp header trong dark; light vẫn giữ gradient tím). */
[data-bs-theme="dark"] #app,
[data-bs-theme="dark"] #app[data] {
  background: #232e3d !important;
  background-image: none !important;
}
[data-bs-theme="dark"] #header {
  background: #232e3d !important;
  background-image: none !important;
}

/* ----- Patch các surface sáng còn sót (từ audit F12) ----- */
/* Header bar panel "Chức năng" (inline background:#f8f9fa) + mọi inline #f8f9fa/#fafafb sáng */
[data-bs-theme="dark"] [style*="background: #f8f9fa"],
[data-bs-theme="dark"] [style*="background:#f8f9fa"],
[data-bs-theme="dark"] [style*="background: #fafafb"],
[data-bs-theme="dark"] .bg-light {
  background-color: #232e3d !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}
/* Nút "Sắp xếp" feature panel (inline #fff) — 4 trang */
[data-bs-theme="dark"] #btnSortAdsFeatures,
[data-bs-theme="dark"] #btnSortBmFeatures,
[data-bs-theme="dark"] #btnSortPageFeatures,
[data-bs-theme="dark"] #btnSortCloneFeatures,
[data-bs-theme="dark"] #btnSortFeatures {
  background: #2e3a4b !important;
  color: #cbd5e1 !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}
/* Text tối hardcode (#374151/#1a1a1a/#475569) trong header/card/modal → sáng */
[data-bs-theme="dark"] [style*="color: #374151"],
[data-bs-theme="dark"] [style*="color:#374151"],
[data-bs-theme="dark"] [style*="color: #1a1a1a"],
[data-bs-theme="dark"] [style*="color: #475569"] {
  color: #e2e8f0 !important;
}
/* Công tắc bật/tắt (form-switch) — track lúc OFF đang xám sáng */
[data-bs-theme="dark"] .form-switch .form-check-input:not(:checked) {
  background-color: #334155 !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}
/* Avatar / vòng tròn nền trắng */
[data-bs-theme="dark"] .rounded-circle.bg-white {
  background-color: #2e3a4b !important;
}

/* ----- Nội dung CÀI ĐẶT feature khi bật/mở rộng (sidebar) — nhiều text xám + nền sáng hardcode ----- */
/* Text xám hardcode (#6c757d ×50, #666, #6b7280, #495057) → sáng hơn cho đọc được */
[data-bs-theme="dark"] [style*="color: #6c757d"],
[data-bs-theme="dark"] [style*="color:#6c757d"],
[data-bs-theme="dark"] [style*="color: #6b7280"],
[data-bs-theme="dark"] [style*="color:#6b7280"],
[data-bs-theme="dark"] [style*="color: #666"],
[data-bs-theme="dark"] [style*="color:#666"],
[data-bs-theme="dark"] [style*="color: #495057"] {
  color: #94a3b8 !important;
}
/* Nền sáng hardcode trong feature card (sub-panel / pill "Đã thêm") → tối */
[data-bs-theme="dark"] [style*="background: #f3f4f6"],
[data-bs-theme="dark"] [style*="background:#f3f4f6"],
[data-bs-theme="dark"] [style*="background: #e9ecef"],
[data-bs-theme="dark"] [style*="background: #f1f5f9"],
[data-bs-theme="dark"] [style*="background: #fafafa"],
[data-bs-theme="dark"] [style*="background: #fff3e0"] {
  background-color: #2e3a4b !important;
}
/* Nhãn + chú thích form trong feature/setting → sáng (không !important để label accent inline giữ màu) */
[data-bs-theme="dark"] .form-label,
[data-bs-theme="dark"] .form-text,
[data-bs-theme="dark"] .form-check-label,
[data-bs-theme="dark"] [data-feature] small {
  color: #cbd5e1;
}
[data-bs-theme="dark"] [data-feature] .text-muted,
[data-bs-theme="dark"] [data-feature] .text-secondary {
  color: #94a3b8 !important;
}
/* Panel cài đặt feature mở rộng (#xxxSetting .border-top, bg #f8fafc từ style.css) */
[data-bs-theme="dark"] [data-feature] .border-top {
  background-color: rgba(255, 255, 255, 0.02) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}
/* Nhãn Luồng/Delay (#64748b) hơi mờ → sáng */
[data-bs-theme="dark"] label.position-absolute.fw-medium {
  color: #94a3b8 !important;
}
/* Công tắc role=switch lúc OFF (rule .form-switch cũ chưa ăn) */
[data-bs-theme="dark"] .form-check-input[role="switch"]:not(:checked) {
  background-color: #334155 !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

/* ===== Select2 (dropdown ngôn ngữ...) — mặc định toàn trắng ===== */
[data-bs-theme="dark"] .select2-container--default .select2-selection--single,
[data-bs-theme="dark"] .select2-container--default .select2-selection--multiple {
  background-color: #1b2433 !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}
[data-bs-theme="dark"] .select2-selection__rendered,
[data-bs-theme="dark"] .select2-selection__placeholder {
  color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .select2-dropdown {
  background-color: #232e3d !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}
[data-bs-theme="dark"] .select2-results__option {
  color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .select2-results__option--highlighted.select2-results__option--selectable {
  background-color: var(--primary-start, #6366f1) !important;
}
[data-bs-theme="dark"] .select2-search__field {
  background: #1b2433 !important;
  color: #e2e8f0 !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

/* ===== SweetAlert2 close + cancel button ===== */
[data-bs-theme="dark"] .swal2-close {
  color: #94a3b8 !important;
}
[data-bs-theme="dark"] .swal2-close:hover {
  color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .swal2-cancel.swal2-styled {
  background: #2e3a4b !important;
  color: #e2e8f0 !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

/* ===== Popup "Tải dữ liệu" (Page/BM/TKQC) — class bm-*/ad-* trong .fx-load-modal.
   Các popup này dùng inline <style> tô màu sáng bằng CLASS nên rule [style*=] không bắt;
   cần override theo class khi dark. ===== */
[data-bs-theme="dark"] .fx-load-modal {
  background: #232e3d !important;
}
[data-bs-theme="dark"] .fx-load-modal .bm-modal-header,
[data-bs-theme="dark"] .fx-load-modal .ad-modal-header {
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}
[data-bs-theme="dark"] .fx-load-modal .bm-modal-header-title,
[data-bs-theme="dark"] .fx-load-modal .ad-modal-header-title {
  color: #f1f5f9 !important;
}
[data-bs-theme="dark"] .fx-load-modal .bm-modal-header-sub,
[data-bs-theme="dark"] .fx-load-modal .ad-modal-header-sub {
  color: #94a3b8 !important;
}
/* Thẻ radio / toggle / limit (nền trắng → tối) */
[data-bs-theme="dark"] .fx-load-modal .bm-radio-card .bm-radio-content,
[data-bs-theme="dark"] .fx-load-modal .ad-radio-card .ad-radio-content,
[data-bs-theme="dark"] .fx-load-modal .bm-toggle-item,
[data-bs-theme="dark"] .fx-load-modal .ad-toggle-item,
[data-bs-theme="dark"] .fx-load-modal .bm-limit-row,
[data-bs-theme="dark"] .fx-load-modal .ad-limit-row {
  background: #2e3a4b !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
[data-bs-theme="dark"] .fx-load-modal .bm-toggle-item:hover,
[data-bs-theme="dark"] .fx-load-modal .ad-toggle-item:hover {
  background: #374559 !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
}
/* Thẻ radio đang chọn */
[data-bs-theme="dark"] .fx-load-modal .bm-radio-card input[type="radio"]:checked + .bm-radio-content,
[data-bs-theme="dark"] .fx-load-modal .ad-radio-card input[type="radio"]:checked + .ad-radio-content {
  background: linear-gradient(135deg, #3a3160, #2c2550) !important;
  border-color: var(--primary-end, #8b5cf6) !important;
}
/* Chữ chính */
[data-bs-theme="dark"] .fx-load-modal .bm-radio-text,
[data-bs-theme="dark"] .fx-load-modal .ad-radio-text,
[data-bs-theme="dark"] .fx-load-modal .bm-toggle-label,
[data-bs-theme="dark"] .fx-load-modal .ad-toggle-label,
[data-bs-theme="dark"] .fx-load-modal .bm-limit-label,
[data-bs-theme="dark"] .fx-load-modal .ad-limit-label {
  color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .fx-load-modal .bm-radio-card input[type="radio"]:checked + .bm-radio-content .bm-radio-text,
[data-bs-theme="dark"] .fx-load-modal .ad-radio-card input[type="radio"]:checked + .ad-radio-content .ad-radio-text {
  color: #c4b5fd !important;
}
/* Chú thích nhỏ */
[data-bs-theme="dark"] .fx-load-modal .bm-radio-desc,
[data-bs-theme="dark"] .fx-load-modal .ad-radio-desc,
[data-bs-theme="dark"] .fx-load-modal .bm-toggle-desc,
[data-bs-theme="dark"] .fx-load-modal .ad-toggle-desc,
[data-bs-theme="dark"] .fx-load-modal .bm-limit-desc,
[data-bs-theme="dark"] .fx-load-modal .ad-limit-desc {
  color: #94a3b8 !important;
}
[data-bs-theme="dark"] .fx-load-modal .bm-radio-card input[type="radio"]:checked + .bm-radio-content .bm-radio-desc,
[data-bs-theme="dark"] .fx-load-modal .ad-radio-card input[type="radio"]:checked + .ad-radio-content .ad-radio-desc {
  color: #a78bfa !important;
}
/* Khối icon nền trắng / tint sáng → tối (toggle + limit + radio Loại tài khoản) */
[data-bs-theme="dark"] .fx-load-modal .bm-toggle-icon,
[data-bs-theme="dark"] .fx-load-modal .ad-toggle-icon,
[data-bs-theme="dark"] .fx-load-modal .bm-limit-icon,
[data-bs-theme="dark"] .fx-load-modal .ad-limit-icon,
[data-bs-theme="dark"] .fx-load-modal .ad-radio-icon,
[data-bs-theme="dark"] .fx-load-modal .bm-radio-icon {
  background: rgba(255, 255, 255, 0.06) !important;
}
/* Ô nhập số + textarea ID */
[data-bs-theme="dark"] .fx-load-modal .bm-limit-input,
[data-bs-theme="dark"] .fx-load-modal .ad-limit-input,
[data-bs-theme="dark"] .fx-load-modal #pageLoadIdInput textarea,
[data-bs-theme="dark"] .fx-load-modal #bmLoadIdInput textarea,
[data-bs-theme="dark"] .fx-load-modal #adLoadIdInput textarea {
  background: #1b2433 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #e2e8f0 !important;
}

/* ===== Popup Bảo mật (bms-*) — dựng bằng JS, hardcode sáng toàn bộ ===== */
[data-bs-theme="dark"] .bms-toggle-card,
[data-bs-theme="dark"] .bms-stat-card,
[data-bs-theme="dark"] .bms-item,
[data-bs-theme="dark"] .bms-interval-btn,
[data-bs-theme="dark"] .bms-search-input,
[data-bs-theme="dark"] #bms-search-input {
  background: #232e3d !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .bms-toggle-icon,
[data-bs-theme="dark"] .bms-stat-icon,
[data-bs-theme="dark"] .bms-avatar {
  background: #312e81 !important;
}
[data-bs-theme="dark"] .bms-header-status.inactive,
[data-bs-theme="dark"] #bms-status-badge.inactive {
  background: #334155 !important;
  color: #cbd5e1 !important;
}
[data-bs-theme="dark"] .bms-slider {
  background: #475569 !important;
}
[data-bs-theme="dark"] .bms-header-sub,
[data-bs-theme="dark"] .bms-stat-label,
[data-bs-theme="dark"] .bms-list-title {
  color: #94a3b8 !important;
}

/* ===== Trang HOME — sidebar (hm-*), dashboard (mt-*), Nạp tiền (dep-*) ===== */
/* Card / sidebar / surface trắng → dark */
[data-bs-theme="dark"] .hm-sidebar,
[data-bs-theme="dark"] .hm-content,
[data-bs-theme="dark"] .mt-card,
[data-bs-theme="dark"] .dep-card,
[data-bs-theme="dark"] .dep-history-card {
  background: #232e3d !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}
[data-bs-theme="dark"] .mt-card-head {
  background: #2e3a4b !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #e2e8f0 !important;
}
/* Field thông tin CK + header bảng lịch sử nền sáng → tối */
[data-bs-theme="dark"] .dep-field,
[data-bs-theme="dark"] .dep-history-table thead th {
  background: #1b2433 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
[data-bs-theme="dark"] .dep-history-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.04) !important;
}
/* Nút copy / cancel nền trắng → dark */
[data-bs-theme="dark"] .dep-copy,
[data-bs-theme="dark"] .dep-usdt-cancel-btn,
[data-bs-theme="dark"] .dep-usdt-cancel-no,
[data-bs-theme="dark"] .textarea-clear-btn {
  background: #2e3a4b !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
}
/* Highlight nội dung CK (vàng) — box USDT teal xử lý ở block HOME đầy đủ bên dưới */
[data-bs-theme="dark"] .dep-field-highlight {
  background: #2a2410 !important;
  border-color: #a16207 !important;
}
/* USDT amount input */
[data-bs-theme="dark"] .dep-input {
  background: #1b2433 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #e2e8f0 !important;
}
/* Status pill cancelled (xám) — các pill màu khác giữ nguyên */
[data-bs-theme="dark"] .dep-status-pill.is-cancelled {
  background: #334155 !important;
  color: #cbd5e1 !important;
}
/* Text xám trang HOME */
[data-bs-theme="dark"] .hm-item-label,
[data-bs-theme="dark"] .hm-section-label,
[data-bs-theme="dark"] .dep-subtitle,
[data-bs-theme="dark"] .dep-note,
[data-bs-theme="dark"] .dep-input-lbl,
[data-bs-theme="dark"] .dep-history-table thead th {
  color: #94a3b8 !important;
}
/* Nút logout VIA (soft-red) → red tối */
[data-bs-theme="dark"] #logoutVia.btn {
  background: rgba(220, 38, 38, 0.18) !important;
  color: #f87171 !important;
}
/* QR (.dep-qr-wrap) GIỮ nền trắng để quét được — KHÔNG đổi */

/* ===== DARK HOME ĐẦY ĐỦ (workflow) — sidebar/dashboard/mail-temp/deposit/login.
   Đặt SAU block patch trên để override đúng hue (vd box USDT teal, không vàng). ===== */
/* ---------- SIDEBAR (.hm-*) ---------- */
[data-bs-theme="dark"] .hm-section-label { color: #94a3b8 !important; }
/* USDT min/max hint + banner gói active (chữ indigo đậm #4338ca khó đọc trên dark) */
[data-bs-theme="dark"] #depUsdtMin,
[data-bs-theme="dark"] #depUsdtMax { color: #94a3b8 !important; }
[data-bs-theme="dark"] .pkg-active-info,
[data-bs-theme="dark"] .pkg-active-info b { color: #c7d2fe !important; }
[data-bs-theme="dark"] .hm-item { color: #cbd5e1 !important; }
[data-bs-theme="dark"] .hm-item:hover { background: rgba(var(--primary-rgb, 99, 102, 241), 0.16) !important; color: #f1f5f9 !important; }
[data-bs-theme="dark"] .hm-sec-toggle { color: #cbd5e1 !important; background: rgba(59, 130, 246, 0.14) !important; box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.36) !important; }
[data-bs-theme="dark"] .hm-sec-toggle:hover { background: rgba(59, 130, 246, 0.22) !important; color: #f1f5f9 !important; box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.52) !important; }
[data-bs-theme="dark"] .hm-item.active { background: rgba(var(--primary-rgb, 99, 102, 241), 0.22) !important; color: #a5b4fc !important; box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.45) !important; }
[data-bs-theme="dark"] .hm-item-danger { background: rgba(239, 68, 68, 0.1) !important; color: #fca5a5 !important; box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.3) !important; }
[data-bs-theme="dark"] .hm-item-danger:hover { background: rgba(239, 68, 68, 0.18) !important; color: #fecaca !important; box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.45) !important; }
[data-bs-theme="dark"] .hm-sep { background: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .hm-side-header { border-bottom-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .hm-side-dot { border-color: #7c3aed !important; }
[data-bs-theme="dark"] .hm-side-name { color: #f1f5f9 !important; }
[data-bs-theme="dark"] .hm-side-bal { color: #6ee7b7 !important; }
[data-bs-theme="dark"] .hm-side-bal i { color: #34d399 !important; }
[data-bs-theme="dark"] .hm-side-download { background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #9333ea 100%) !important; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4) !important; }
[data-bs-theme="dark"] .hm-side-download:hover { box-shadow: 0 8px 22px rgba(124, 58, 237, 0.45) !important; }
[data-bs-theme="dark"] .hm-empty-title { color: #cbd5e1 !important; }
[data-bs-theme="dark"] .hm-empty-sub { color: #94a3b8 !important; }
/* ---------- DASHBOARD / MAIL-TEMP (.mt-*) ---------- */
[data-bs-theme="dark"] .mt-title, [data-bs-theme="dark"] .mt-item-email, [data-bs-theme="dark"] .mt-mail-subj, [data-bs-theme="dark"] .mt-msg-subj { color: #f1f5f9 !important; }
[data-bs-theme="dark"] .mt-subtitle, [data-bs-theme="dark"] .mt-label, [data-bs-theme="dark"] .mt-mail-from, [data-bs-theme="dark"] .mt-msg-from, [data-bs-theme="dark"] .mt-msg-snippet, [data-bs-theme="dark"] .mt-msg-time, [data-bs-theme="dark"] .mt-empty-text, [data-bs-theme="dark"] .mt-link-list-head, [data-bs-theme="dark"] .mt-msg-head { color: #94a3b8 !important; }
[data-bs-theme="dark"] .mt-input, [data-bs-theme="dark"] .mt-select { background: #1b2433 !important; border-color: rgba(255, 255, 255, 0.1) !important; color: #e2e8f0 !important; }
[data-bs-theme="dark"] .mt-input::placeholder { color: #64748b !important; }
[data-bs-theme="dark"] .mt-input[readonly] { background: #2e3a4b !important; color: #cbd5e1 !important; }
[data-bs-theme="dark"] .mt-input:disabled { background: #1f2937 !important; color: #64748b !important; }
[data-bs-theme="dark"] .mt-btn-amber { color: #232e3d !important; }
[data-bs-theme="dark"] .mt-link-row { background: #2e3a4b !important; border-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .mt-link-row:hover { background: rgba(var(--primary-rgb, 99, 102, 241), 0.12) !important; border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.4) !important; }
[data-bs-theme="dark"] .mt-link-text, [data-bs-theme="dark"] .mt-mail-body { color: #cbd5e1 !important; }
[data-bs-theme="dark"] .mt-pill { background: #2e3a4b !important; }
[data-bs-theme="dark"] .mt-item, [data-bs-theme="dark"] .mt-mail-msg, [data-bs-theme="dark"] .mt-msg { background: #232e3d !important; border-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .mt-item:hover { background: rgba(var(--primary-rgb, 99, 102, 241), 0.1) !important; border-color: var(--primary-start, #6366f1) !important; }
[data-bs-theme="dark"] .mt-item.active, [data-bs-theme="dark"] .mt-msg.expanded { background: rgba(var(--primary-rgb, 99, 102, 241), 0.16) !important; border-color: var(--primary-start, #6366f1) !important; }
[data-bs-theme="dark"] .mt-otp-card { background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(var(--primary-rgb, 99, 102, 241), 0.14)) !important; border-color: rgba(16, 185, 129, 0.35) !important; }
[data-bs-theme="dark"] .mt-otp-label, [data-bs-theme="dark"] .mt-otp-value { color: #34d399 !important; }
[data-bs-theme="dark"] .mt-otp-badge { background: #3a2e0a !important; color: #fcd34d !important; }
[data-bs-theme="dark"] .mt-otp-badge:hover { background: #4a3a0c !important; }
[data-bs-theme="dark"] .mt-link-btn { background: rgba(59, 130, 246, 0.18) !important; color: #93c5fd !important; }
[data-bs-theme="dark"] .mt-link-btn:hover { background: rgba(59, 130, 246, 0.28) !important; }
[data-bs-theme="dark"] .mt-link-btn.copied { background: rgba(16, 185, 129, 0.18) !important; color: #34d399 !important; }
[data-bs-theme="dark"] .mt-link-item { background: rgba(59, 130, 246, 0.12) !important; border-color: rgba(59, 130, 246, 0.3) !important; color: #93c5fd !important; }
[data-bs-theme="dark"] .mt-link-item:hover { background: rgba(59, 130, 246, 0.2) !important; }
[data-bs-theme="dark"] .mt-modal-meta { color: #94a3b8 !important; border-bottom-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .mt-modal-iframe { border-color: rgba(255, 255, 255, 0.1) !important; background: #232e3d !important; }
/* ---------- NẠP TIỀN (.dep-*) ---------- */
[data-bs-theme="dark"] .dep-title, [data-bs-theme="dark"] .dep-val { color: #f1f5f9 !important; }
[data-bs-theme="dark"] .dep-label, [data-bs-theme="dark"] .dep-qr-hint, [data-bs-theme="dark"] .dep-usdt-rate, [data-bs-theme="dark"] .dep-usdt-amount-lbl, [data-bs-theme="dark"] .dep-usdt-wallet-lbl, [data-bs-theme="dark"] .dep-usdt-vnd-eq, [data-bs-theme="dark"] .dep-usdt-countdown, [data-bs-theme="dark"] .dep-history-empty, [data-bs-theme="dark"] .dep-history-empty p { color: #94a3b8 !important; }
[data-bs-theme="dark"] .dep-qr-empty, [data-bs-theme="dark"] .dep-input-hint { color: #64748b !important; }
[data-bs-theme="dark"] .dep-history-empty i { color: #475569 !important; }
[data-bs-theme="dark"] .dep-usdt-preview { color: #cbd5e1 !important; }
[data-bs-theme="dark"] .dep-usdt-info-bar { background: rgba(38, 161, 123, 0.16) !important; border-color: rgba(38, 161, 123, 0.4) !important; color: #5eead4 !important; }
[data-bs-theme="dark"] .dep-usdt-amount-box { background: rgba(38, 161, 123, 0.1) !important; border-color: rgba(38, 161, 123, 0.45) !important; }
[data-bs-theme="dark"] .dep-usdt-wallet-box { background: rgba(38, 161, 123, 0.1) !important; border-color: rgba(38, 161, 123, 0.4) !important; }
[data-bs-theme="dark"] .dep-usdt-cancel-btn:hover { background: #2c3a4f !important; }
[data-bs-theme="dark"] .dep-usdt-error { background: rgba(220, 38, 38, 0.18) !important; color: #fca5a5 !important; border-color: rgba(220, 38, 38, 0.35) !important; }
[data-bs-theme="dark"] .dep-history-table tbody td { color: #e2e8f0 !important; border-bottom-color: rgba(255, 255, 255, 0.06) !important; }
[data-bs-theme="dark"] .dep-status-pill.is-completed { background: rgba(16, 185, 129, 0.18) !important; color: #34d399 !important; }
[data-bs-theme="dark"] .dep-status-pill.is-pending { background: rgba(245, 158, 11, 0.18) !important; color: #fbbf24 !important; }
[data-bs-theme="dark"] .dep-status-pill.is-cancelled { background: #2e3a4b !important; color: #94a3b8 !important; }
/* ---------- LOGIN / AUTH (.au-*) — .au-page/.au-hero giữ gradient gốc ---------- */
[data-bs-theme="dark"] .au-card { background: rgba(30, 41, 59, 0.94) !important; }
[data-bs-theme="dark"] .au-form-pane { background: #232e3d !important; }
[data-bs-theme="dark"] .au-form-head-title, [data-bs-theme="dark"] .au-section-title, [data-bs-theme="dark"] .au-success-title { color: #f1f5f9 !important; }
[data-bs-theme="dark"] .au-form-head-sub, [data-bs-theme="dark"] .au-section-sub, [data-bs-theme="dark"] .au-success-sub { color: #94a3b8 !important; }
[data-bs-theme="dark"] .au-label, [data-bs-theme="dark"] .au-check { color: #cbd5e1 !important; }
[data-bs-theme="dark"] .au-optional, [data-bs-theme="dark"] .au-input-wrap > i, [data-bs-theme="dark"] .au-toggle-pass, [data-bs-theme="dark"] .au-divider span { color: #64748b !important; }
[data-bs-theme="dark"] .au-input { background: #1b2433 !important; border-color: rgba(255, 255, 255, 0.1) !important; color: #e2e8f0 !important; }
[data-bs-theme="dark"] .au-input::placeholder { color: #64748b !important; }
[data-bs-theme="dark"] .au-toggle-pass:hover { background: #2e3a4b !important; color: #cbd5e1 !important; }
[data-bs-theme="dark"] .au-error { color: #fca5a5 !important; background: rgba(239, 68, 68, 0.14) !important; border-color: rgba(239, 68, 68, 0.3) !important; }
[data-bs-theme="dark"] .au-divider::before, [data-bs-theme="dark"] .au-divider::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent) !important; }
[data-bs-theme="dark"] .au-btn-google, [data-bs-theme="dark"] .au-btn-licensekey { background: #2e3a4b !important; color: #e2e8f0 !important; border-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .au-btn-google:hover, [data-bs-theme="dark"] .au-btn-licensekey:hover { background: #2c3a4f !important; border-color: rgba(255, 255, 255, 0.2) !important; }
[data-bs-theme="dark"] .au-input-code, [data-bs-theme="dark"] .au-tab.is-active { color: #a5b4fc !important; }
[data-bs-theme="dark"] .au-tab.is-active { background: #2e3a4b !important; }
[data-bs-theme="dark"] .au-tab { color: #94a3b8 !important; }
/* Value accent hơi tối trên nền dark → nâng sáng cho rõ */
[data-bs-theme="dark"] #hmSideBalance { color: #34d399 !important; }
[data-bs-theme="dark"] .dep-val.dep-mono,
[data-bs-theme="dark"] strong.dep-qr-content,
[data-bs-theme="dark"] .dep-qr-content { color: #f87171 !important; }
[data-bs-theme="dark"] #depUsdtRate,
[data-bs-theme="dark"] #depUsdtPreview { color: #5eead4 !important; }
[data-bs-theme="dark"] .dep-history-table code,
[data-bs-theme="dark"] .dep-history-card code { color: #67e8f9 !important; }

/* ===== HOME view Gói (.pkg-*) + container .hm-view ===== */
[data-bs-theme="dark"] .hm-view.active { background: #1b2433 !important; }
[data-bs-theme="dark"] .pkg-title,
[data-bs-theme="dark"] .pkg-card-title,
[data-bs-theme="dark"] .pkg-card-name,
[data-bs-theme="dark"] .pkg-card-section > .mt-card-head { color: #f1f5f9 !important; }
[data-bs-theme="dark"] .pkg-subtitle,
[data-bs-theme="dark"] .pkg-card-desc,
[data-bs-theme="dark"] .pkg-card-price-suffix,
[data-bs-theme="dark"] .pkg-sum-label,
[data-bs-theme="dark"] .pkg-duration-label { color: #94a3b8 !important; }
[data-bs-theme="dark"] .pkg-card-section,
[data-bs-theme="dark"] .pkg-card,
[data-bs-theme="dark"] .pkg-cancel-btn,
[data-bs-theme="dark"] .pkg-buy-btn-outline {
  background: #232e3d !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .pkg-duration-card {
  background: #2e3a4b !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .pkg-card-section > .mt-card-head {
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}
[data-bs-theme="dark"] .pkg-sum-balance,
[data-bs-theme="dark"] .pkg-sum-row {
  background: transparent !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}
[data-bs-theme="dark"] .pkg-card.is-selected,
[data-bs-theme="dark"] .pkg-card:hover {
  border-color: var(--primary-start, #6366f1) !important;
  background: rgba(var(--primary-rgb, 99, 102, 241), 0.1) !important;
}

/* ===== Công tắc Bootstrap OFF — ép tối (rule role=switch trước chưa ăn) ===== */
[data-bs-theme="dark"] input.form-check-input:not(:checked) {
  background-color: #2e3a4b !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

/* ===== Popup Lọc ID (id-*) + công tắc custom ===== */
[data-bs-theme="dark"] .id-toggle-card {
  background: #232e3d !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #e2e8f0 !important;
}
[data-bs-theme="dark"] #swal-input-ids {
  background: #1b2433 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .id-toggle-desc { color: #94a3b8 !important; }
[data-bs-theme="dark"] .id-switch-slider { background: #475569 !important; }
/* Slider toggle custom popup JS (bm.js .bm-switch-slider, scripts.js .ad-switch-slider) — OFF #d1d5db → tối */
[data-bs-theme="dark"] .bm-switch-slider,
[data-bs-theme="dark"] .ad-switch-slider { background-color: #475569 !important; }

/* ===== Popup config feature multi-select (bm-/ad-/page-/clone-* — JS inject <style> sáng).
   Dùng [class*="-suffix"] để phủ MỌI tiền tố trang trong 1 block. ===== */
[data-bs-theme="dark"] [class*="-toggle-item"],
[data-bs-theme="dark"] [class*="-limit-row"],
[data-bs-theme="dark"] [class*="-radio-content"] {
  background: #232e3d !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #e2e8f0 !important;
}
[data-bs-theme="dark"] [class*="-toggle-item"]:hover { background: #2e3a4b !important; }
[data-bs-theme="dark"] [class*="-radio-icon"],
[data-bs-theme="dark"] [class*="-limit-icon"] { background: #2e3a4b !important; }
[data-bs-theme="dark"] [class*="-limit-input"] {
  background: #1b2433 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #e2e8f0 !important;
}
[data-bs-theme="dark"] [class*="-toggle-label"],
[data-bs-theme="dark"] [class*="-limit-label"] { color: #cbd5e1 !important; }
[data-bs-theme="dark"] [class*="-radio-text"] { color: #a78bfa !important; }

/* ===== Swal close button (nền trắng / chữ #666) ===== */
[data-bs-theme="dark"] .swal2-close,
[data-bs-theme="dark"] .sp-modal .swal2-close {
  background: transparent !important;
  color: #94a3b8 !important;
}

/* ===== Overlay loading vùng lưới (#loading nền #ffffffc7 trắng) → tối ===== */
[data-bs-theme="dark"] #loading {
  background: rgba(27, 36, 51, 0.88) !important;
}
[data-bs-theme="dark"] #loadingData strong {
  color: #cbd5e1 !important;
}

/* Nút control (Bắt đầu/Lọc/Cột/Xuất...) + nút viền trắng */
[data-bs-theme="dark"] .control-btn,
[data-bs-theme="dark"] .btn.border:not(.btn-primary):not([class*="bg-"]),
[data-bs-theme="dark"] .shadow-sm.btn.border {
  background: #2e3a4b !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .control-btn:hover,
[data-bs-theme="dark"] .btn.border:hover {
  background: #2d3b52 !important;
}

/* Ô tìm kiếm + input/select */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] input.form-control {
  background-color: #1b2433 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .form-control::placeholder {
  color: #64748b !important;
}

/* Text tối hardcode (#1a1a1a/.text-dark) trong card/modal → sáng lại */
[data-bs-theme="dark"] .text-dark {
  color: #e2e8f0 !important;
}

/* ===== AG-Grid (ag-theme-balham) — bảng chính ===== */
[data-bs-theme="dark"] .ag-theme-balham {
  --ag-background-color: #232e3d;
  --ag-odd-row-background-color: #1f2937;
  --ag-foreground-color: #e2e8f0;
  --ag-data-color: #e2e8f0;
  --ag-secondary-foreground-color: #94a3b8;
  --ag-header-background-color: #334155;
  --ag-header-foreground-color: #e2e8f0;
  --ag-border-color: rgba(255, 255, 255, 0.08);
  --ag-row-border-color: rgba(148, 163, 184, 0.18);
  --ag-row-hover-color: rgba(var(--primary-rgb, 99, 102, 241), 0.15);
  --ag-selected-row-background-color: rgba(var(--primary-rgb, 99, 102, 241), 0.22);
  --ag-control-panel-background-color: #232e3d;
  --ag-input-background-color: #1b2433;
  --ag-input-border-color: rgba(255, 255, 255, 0.15);
  --ag-modal-overlay-background-color: rgba(15, 23, 42, 0.65);
  background-color: #232e3d;
}
/* Renderer cột Tài khoản (bm/ads/page) dùng class .text-black (Bootstrap #000 !important)
   → đè --ag-data-color làm tên + UID đen xì trong dark. Ép .text-black trong grid sáng. */
[data-bs-theme="dark"] .ag-theme-balham .text-black {
  color: #e2e8f0 !important;
}
/* Đường kẻ giữa các dòng → xám mảnh (1px, ép trực tiếp phòng balham không ăn var) */
[data-bs-theme="dark"] .ag-theme-balham .ag-row {
  border-bottom-color: rgba(148, 163, 184, 0.18) !important;
  border-bottom-width: 1px !important;
}
/* .ag-header trong modern-theme dùng var(--bg-body) (=#1b2433 dark) → OK.
   Pinned bottom (TỔNG CỘNG) hardcode #ffffff ở style.css → ép tối. */
[data-bs-theme="dark"] .ag-floating-bottom,
[data-bs-theme="dark"] .ag-floating-bottom .ag-row,
[data-bs-theme="dark"] .ag-floating-bottom .ag-cell {
  background-color: #1b2433 !important;
  color: #e2e8f0 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}
/* Grid phụ .bst-grid header hardcode #f8fafc/#cbd5e1 */
[data-bs-theme="dark"] .bst-grid .ag-header,
[data-bs-theme="dark"] .bst-grid .ag-header-cell {
  background: #1b2433 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}
/* Header CỘT grid chính — balham là theme SASS cũ, --ag-* không ăn → ép trực tiếp */
[data-bs-theme="dark"] .ag-theme-balham .ag-header,
[data-bs-theme="dark"] .ag-theme-balham .ag-header-viewport,
[data-bs-theme="dark"] .ag-theme-balham .ag-header-row,
[data-bs-theme="dark"] .ag-theme-balham .ag-header-cell,
[data-bs-theme="dark"] .ag-theme-balham .ag-header-group-cell,
[data-bs-theme="dark"] .ag-theme-balham .ag-pinned-left-header,
[data-bs-theme="dark"] .ag-theme-balham .ag-pinned-right-header {
  background-color: #334155 !important;
  color: #e2e8f0 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
[data-bs-theme="dark"] .ag-theme-balham .ag-header-cell-text,
[data-bs-theme="dark"] .ag-theme-balham .ag-header-icon,
[data-bs-theme="dark"] .ag-theme-balham .ag-header-cell-menu-button,
[data-bs-theme="dark"] .ag-theme-balham .ag-sort-indicator-icon {
  color: #cbd5e1 !important;
}

/* ===== SweetAlert2 ===== */
[data-bs-theme="dark"] .swal2-popup {
  background: #232e3d !important;
  color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .swal2-title,
[data-bs-theme="dark"] .swal2-html-container,
[data-bs-theme="dark"] .swal2-label {
  color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .swal2-input,
[data-bs-theme="dark"] .swal2-textarea,
[data-bs-theme="dark"] .swal2-select,
[data-bs-theme="dark"] .swal2-file {
  background: #1b2433 !important;
  color: #e2e8f0 !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

/* ============================================
   FEATURE INFO POPUP (ⓘ "Hướng dẫn sử dụng") — _featInfoTpl dùng class .fi-*
   thay vì inline màu cứng, để popup thích nghi giao diện tối (trước đây chữ
   tối #374151/#111827 đè lên nền popup tối #232e3d → không đọc được).
   ============================================ */
.fi-body { text-align: left; font-size: 14px; line-height: 1.7; color: #374151; }
.fi-intro { margin: 0 0 16px; }
.fi-sec { margin-bottom: 14px; }
.fi-h { font-weight: 700; margin-bottom: 8px; font-size: 14px; color: #111827; }
.fi-body ul, .fi-body ol { margin: 0; padding-left: 20px; font-size: 13.5px; }
.fi-body li { margin-bottom: 4px; }
.fi-box { border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; border: 1.5px solid transparent; }
.fi-box-h { font-weight: 700; margin-bottom: 6px; font-size: 13.5px; }
.fi-when { background: #eff6ff; border-color: #dbeafe; color: #1e40af; }
.fi-warn { background: #fef3c7; border-color: #fde68a; color: #92400e; }
.fi-danger { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.fi-tip { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.fi-faq { background: #f9fafb; border-left: 3px solid var(--primary-end, #8b5cf6); padding: 8px 12px; margin-bottom: 6px; border-radius: 0 6px 6px 0; }
.fi-faq-q { font-weight: 600; font-size: 13.5px; color: #374151; margin-bottom: 2px; }
.fi-faq-a { font-size: 13px; color: #6b7280; }

[data-bs-theme="dark"] .fi-body { color: #cbd5e1; }
[data-bs-theme="dark"] .fi-h { color: #f1f5f9; }
[data-bs-theme="dark"] .fi-when { background: rgba(59, 130, 246, 0.12); border-color: rgba(59, 130, 246, 0.35); color: #93c5fd; }
[data-bs-theme="dark"] .fi-warn { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.35); color: #fcd34d; }
[data-bs-theme="dark"] .fi-danger { background: rgba(239, 68, 68, 0.13); border-color: rgba(239, 68, 68, 0.4); color: #fca5a5; }
[data-bs-theme="dark"] .fi-tip { background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.35); color: #86efac; }
[data-bs-theme="dark"] .fi-faq { background: rgba(255, 255, 255, 0.04); border-left-color: #a78bfa; }
[data-bs-theme="dark"] .fi-faq-q { color: #e2e8f0; }
[data-bs-theme="dark"] .fi-faq-a { color: #94a3b8; }

/* ============================================
   NAVIGATION PILLS (HEADER)
   ============================================ */
.nav-pills-container {
  transition: var(--transition-normal);
  flex-wrap: nowrap !important;
  white-space: nowrap;
}

.nav-pills-container .nav-pill {
  flex: 0 0 auto;
  width: auto !important;
  max-width: none !important;
  white-space: nowrap;
}

.nav-pill {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: var(--transition-normal);
  border-radius: var(--radius-sm) !important;
}

.nav-pill:hover:not(.active) {
  background: rgba(255, 255, 255, 0.15);
}

.nav-pill.active {
  color: var(--primary-start) !important;
  background: white !important;
  box-shadow: var(--shadow-md) !important;
}

/* ============================================
   STAT CARDS (HOME PAGE)
   ============================================ */
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 20px;
  border: 1px solid var(--border-light);
  transition: var(--transition-normal);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white !important;
}

.stat-icon.pink {
  background: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
  color: white;
}

.stat-icon.purple {
  background: linear-gradient(135deg, var(--primary-end, #8b5cf6) 0%, #a78bfa 100%);
  color: white;
}

.stat-icon.orange {
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  color: white;
}

.stat-icon.blue {
  background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
  color: white;
}

.stat-icon.green {
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  color: white;
}

.stat-icon.cyan {
  background: linear-gradient(135deg, #06b6d4 0%, #22d3ee 100%);
  color: white;
}

.stat-icon.indigo {
  background: linear-gradient(135deg, var(--primary-start, #6366f1) 0%, #818cf8 100%);
  color: white;
}

.stat-icon.red {
  background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
  color: white;
}

/* ============================================
   DATA TABLE CARDS
   ============================================ */
.data-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.data-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.data-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.data-card-body {
  padding: 0;
}

.data-list-item {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  transition: var(--transition-fast);
}

.data-list-item:last-child {
  border-bottom: none;
}

.data-list-item:hover {
  background: var(--bg-hover);
}

/* ============================================
   INFO ROWS (POPUP & DETAILS)
   ============================================ */
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition-fast);
}

.info-row:last-child {
  border-bottom: none;
}

.info-row:hover {
  background: var(--bg-hover);
}

.info-label {
  display: flex;
  align-items: center;
  color: var(--text-secondary);
  font-weight: 500;
}

.info-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  color: white;
  font-size: 14px;
}

.info-value {
  font-weight: 600;
  color: var(--text-primary);
}

/* ============================================
   QUICK ACTIONS
   ============================================ */
.quick-action {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  transition: var(--transition-normal);
}

.quick-action:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: var(--text-primary);
}

.quick-action img {
  margin-right: 12px;
}

/* ============================================
   FILTER DROPDOWN
   ============================================ */
.filter-item {
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  transition: var(--transition-fast);
  cursor: pointer;
}

.filter-item:hover {
  border-color: var(--primary-start);
  background: var(--bg-hover);
}

.filter-item:last-child {
  margin-bottom: 0;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-circle);
  margin-right: 8px;
}

/* ============================================
   PANEL CARDS (SIDEBAR)
   ============================================ */
.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
}

.panel-card-header {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-card-title {
  display: flex;
  align-items: center;
  font-weight: 700;
  color: var(--text-primary);
}

.panel-card-title i {
  margin-right: 10px;
  font-size: 18px;
  color: var(--primary-start);
}

.panel-card-body {
  padding: 16px;
  border-top: 1px solid var(--border-light);
}

/* ============================================
   STATUS BADGES
   ============================================ */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
}

.status-badge.success {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.status-badge.danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.status-badge.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.status-badge.info {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state p {
  margin-bottom: 16px;
}

/* ============================================
   TOOLBAR STYLES
   ============================================ */
.border-bottom.bg-white {
  background: var(--bg-card) !important;
  border-bottom: 1px solid var(--border-light) !important;
}

/* Search Input */
#search {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-body);
  transition: var(--transition-normal);
}

#search:focus {
  background: var(--bg-card);
  border-color: var(--primary-start);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 99, 102, 241), 0.1);
}

/* Luong/Delay Inputs */
input[name="limit"],
input[name="delay"] {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  font-weight: 600;
}

input[name="limit"]:focus,
input[name="delay"]:focus {
  border-color: var(--primary-start);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 99, 102, 241), 0.1);
}

/* ============================================
   STATUS BAR (FOOTER)
   ============================================ */
.status-bar,
body > div:last-child .badge,
#app ~ .fixed-bottom,
.position-fixed.bottom-0 {
  background: var(--primary-gradient);
}

/* ============================================
   FOOTER STATUS BAR - BOTTOM
   ============================================ */
#app > .position-fixed,
.position-fixed.bottom-0.start-0.end-0 {
  background: var(--primary-gradient, linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)) !important;
  padding: 8px 16px !important;
  border-top: none !important;
}

/* Status counts in footer */
#app .position-fixed .badge,
.position-fixed.bottom-0 .badge {
  background: rgba(255, 255, 255, 0.2) !important;
  color: white !important;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
}

/* Footer text colors */
.position-fixed.bottom-0 span,
#app .position-fixed span {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  font-size: 0.8rem;
}

/* Status Footer Text */
[style*="background: linear-gradient"] .text-success,
.text-success {
  color: #10b981 !important;
}

[style*="background: linear-gradient"] .text-danger,
.text-danger {
  color: #ef4444 !important;
}

[style*="background: linear-gradient"] .text-warning,
.text-warning {
  color: #f59e0b !important;
}

[style*="background: linear-gradient"] .text-info,
.text-info {
  color: #06b6d4 !important;
}

/* ============================================
   AG-GRID TABLE ENHANCEMENTS
   ============================================ */
.ag-root-wrapper {
  border: none !important;
  border-radius: 0 !important;
}

.ag-header {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
  border-bottom: 1px solid var(--border-light) !important;
}

.ag-header-cell {
  font-weight: 600 !important;
  color: var(--text-secondary) !important;
  font-size: 0.8rem !important;
}

.ag-header-cell-label {
  padding: 0 !important;
}

.ag-cell {
  display: flex;
  align-items: center;
  font-size: 0.85rem;
}

/* Status badge trong bảng AG-Grid */
.ag-cell .badge.rounded-pill {
  font-size: 0.7rem;
  padding: 3px 8px;
}

.ag-row {
  border-bottom: 1.5px solid rgba(0, 0, 0, 0.12) !important;
}

.ag-row:hover {
  background: rgba(var(--primary-rgb, 99, 102, 241), 0.04) !important;
}

.ag-row-selected {
  background: rgba(var(--primary-rgb, 99, 102, 241), 0.08) !important;
}

.ag-row-selected:hover {
  background: rgba(var(--primary-rgb, 99, 102, 241), 0.12) !important;
}

/* ============================================
   FOOTER STATUS COUNTS
   ============================================ */
.badge.rounded-pill {
  font-weight: 600;
  font-size: 0.65rem;
  padding: 3px 8px;
}

/* Custom Primary Colors for Bootstrap */
.bg-primary {
  background: var(--primary-gradient) !important;
}

.text-primary {
  color: var(--primary-start) !important;
}

.border-primary {
  border-color: var(--primary-start) !important;
}

.btn-outline-primary {
  color: var(--primary-start);
  border-color: var(--primary-start);
}

.btn-outline-primary:hover {
  background: var(--primary-gradient);
  border-color: var(--primary-start);
  color: white;
}

/* ============================================
   TOOLBAR AREA
   ============================================ */
.border-bottom.bg-white .p-3 {
  background: var(--bg-card);
}

.border-end {
  border-color: var(--border-light) !important;
}

/* Input with label overlay */
.position-relative label.position-absolute {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============================================
   LOADING SPINNER - Moved to style.css
   ============================================ */
/*
.loader {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid var(--border-light);
  border-top-color: var(--primary-start);
  animation: spin 0.8s linear infinite;
}
*/

/* ============================================
   MISC IMPROVEMENTS
   ============================================ */

/* App Version Badge */
.appVersion {
  background: rgba(255, 255, 255, 0.2) !important;
  padding: 3px 10px !important;
  border-radius: 20px !important;
  font-size: 0.7rem !important;
  font-weight: 500 !important;
  backdrop-filter: blur(4px);
}

/* Title Bar */
.titleBar {
  font-size: 1rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.3px;
}

/* Shadow utilities */
.shadow-sm {
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 1px 1px rgba(0, 0, 0, 0.03) !important;
}

.shadow {
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.07),
    0 2px 4px -1px rgba(0, 0, 0, 0.04) !important;
}

/* Improve rounded corners */
.rounded {
  border-radius: var(--radius-md) !important;
}

.rounded-4 {
  border-radius: var(--radius-lg) !important;
}

/* Fix dropdown shadows */
.dropdown-menu {
  border: 1px solid var(--border-light) !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12) !important;
  border-radius: var(--radius-lg) !important;
  padding: 8px !important;
}

.dropdown-item {
  border-radius: var(--radius-sm) !important;
  padding: 8px 12px !important;
  font-weight: 500 !important;
  font-size: 0.85rem !important;
}

.dropdown-item:hover {
  background: rgba(var(--primary-rgb, 99, 102, 241), 0.08) !important;
  color: var(--primary-start) !important;
}

/* Fix Modal styling */
.modal-content {
  border: none !important;
  border-radius: var(--radius-xl) !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

.modal-header {
  border-bottom: 1px solid var(--border-light) !important;
  padding: 20px 24px !important;
}

.modal-footer {
  border-top: 1px solid var(--border-light) !important;
  padding: 10px 24px !important;
}

/* Better focus states */
.form-control:focus,
.form-select:focus {
  border-color: var(--primary-start) !important;
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 99, 102, 241), 0.12) !important;
}

/* Quality indicator in header */
#quality {
  display: flex;
  align-items: center;
}

/* Nút Đăng nhập trong #quality — premium pill 3D glass với shimmer hover.
   Gradient 3-stop tím lavender (#8B7FFF) + top highlight + inner shadow. */
.nh-quality-login-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px 15px 6px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(135deg, #a89bff 0%, #8b7fff 50%, #6a5ddb 100%);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1.4;
  overflow: hidden;
  box-shadow:
    0 4px 14px rgba(139, 127, 255, 0.48),
    0 1px 2px rgba(15, 23, 42, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    inset 0 -2px 4px rgba(0, 0, 0, 0.1);
  transition:
    transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.22s ease,
    filter 0.22s ease;
  -webkit-tap-highlight-color: transparent;
}
.nh-quality-login-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent 30%,
    rgba(255, 255, 255, 0.32) 50%,
    transparent 70%
  );
  transform: translateX(-100%);
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
.nh-quality-login-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 10px 24px rgba(139, 127, 255, 0.58),
    0 2px 4px rgba(15, 23, 42, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 4px rgba(0, 0, 0, 0.1);
  filter: brightness(1.08);
}
.nh-quality-login-btn:hover::before {
  transform: translateX(100%);
}
.nh-quality-login-btn:active {
  transform: translateY(0);
  box-shadow:
    0 3px 8px rgba(139, 127, 255, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    inset 0 -2px 4px rgba(0, 0, 0, 0.12);
}
.nh-quality-login-btn i {
  font-size: 14px;
  line-height: 1;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.nh-quality-login-btn > span {
  position: relative;
  z-index: 1;
}

/* OVERRIDE khi nút Đăng nhập render trong #userInfo (grid pages — toolbar
   header). Style match với toolbar buttons (Hướng dẫn/Cài đặt/Bảo mật):
   white bg + border subtle + icon tím accent + height/padding nhỏ gọn.
   Không pill gradient prominent (lạc lõng giữa toolbar gray outline). */
#userInfo .nh-quality-login-btn {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #334155;
  padding: 6px 14px 6px 6px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.1px;
  text-transform: none;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}
#userInfo .nh-quality-login-btn::before {
  display: none;
}
#userInfo .nh-quality-login-btn:hover {
  background: #f8fafc;
  border-color: #c4b5fd;
  color: var(--primary-start, #6366f1);
  transform: translateY(-1px);
  filter: none;
  box-shadow:
    0 4px 12px rgba(var(--primary-rgb, 99, 102, 241), 0.16),
    0 1px 3px rgba(15, 23, 42, 0.06);
}
#userInfo .nh-quality-login-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
#userInfo .nh-quality-login-btn i {
  /* Chỉ màu icon, không nền — gradient text qua background-clip */
  width: auto;
  height: auto;
  background: var(--primary-gradient, linear-gradient(135deg, #6366f1, #8b5cf6));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-size: 18px;
  box-shadow: none;
}

#quality .badge {
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
}

/* Live Ads - Không Sao Cả - Màu xanh nổi bật */
#quality .badge.text-bg-success {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

#quality .badge.text-bg-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5);
}

/* Trạng thái lỗi - Màu đỏ */
#quality .badge.text-bg-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

/* Trạng thái cảnh báo - Màu vàng */
#quality .badge.text-bg-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

/* ============================================
   HOME PAGE - MODERN DASHBOARD V2
   ============================================ */

/* Dashboard Hero Banner */
.dashboard-hero {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 6px 24px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
}

.dashboard-hero:hover {
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 12px 36px rgba(0, 0, 0, 0.08);
}

.hero-accent {
  height: 4px;
  background: linear-gradient(90deg, var(--primary-start, #6366f1), var(--primary-end, #8b5cf6), #a855f7, #ec4899);
}

.hero-content {
  padding: 20px 26px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 32px;
}

@media (max-width: 768px) {
  .hero-content {
    padding: 16px 18px;
    gap: 16px;
  }
}

.hero-user {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1;
  min-width: 0;
}

.hero-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.hero-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-gradient, linear-gradient(135deg, #6366f1, #8b5cf6));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  box-shadow: 0 6px 16px rgba(var(--primary-rgb, 99, 102, 241), 0.3);
  overflow: hidden;
}

.hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.hero-online-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 14px;
  height: 14px;
  background: #10b981;
  border: 2.5px solid white;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
}

.hero-user-info {
  min-width: 0;
  flex: 1;
}

.hero-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1b2433;
  margin: 0 0 4px 0;
  letter-spacing: -0.3px;
}

.hero-identifiers {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.hero-uid {
  font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
  font-size: 0.78rem;
  color: var(--primary-end, #8b5cf6);
  font-weight: 600;
  background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.08);
  padding: 2px 8px;
  border-radius: 6px;
}

.hero-email {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 500;
}

.hero-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  font-size: 0.75rem;
  color: #475569;
  background: #f1f5f9;
  border-radius: 20px;
  font-weight: 500;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.hero-chip:hover {
  background: #e2e8f0;
}

.hero-chip i {
  font-size: 0.8rem;
  color: var(--primary-end, #8b5cf6);
}

/* Hero Counters */
.hero-counters {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  background: #f8fafc;
  padding: 14px 20px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.hero-counter {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 14px;
}

.hero-counter-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.hero-counter-bm {
  background: linear-gradient(135deg, var(--primary-end, #8b5cf6), #a855f7);
  box-shadow: 0 4px 12px rgba(var(--primary-end-rgb, 139, 92, 246), 0.3);
}

.hero-counter-ads {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.hero-counter-page {
  background: linear-gradient(135deg, #06b6d4, #0ea5e9);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.hero-counter-data {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.hero-counter-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1b2433;
  letter-spacing: -0.5px;
  line-height: 1;
}

.hero-counter-label {
  font-size: 0.7rem;
  color: #64748b;
  font-weight: 500;
  white-space: nowrap;
}

.hero-counter-divider {
  width: 1px;
  height: 36px;
  background: #e2e8f0;
  margin: 0 4px;
}

/* Dashboard Grid (legacy — keep for backward compat) */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  gap: 20px;
}

.dashboard-col {
  display: grid;
  grid-row: span 2;
  grid-template-rows: subgrid;
  gap: 20px;
}


/* Dashboard Cards */
.dashboard-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 16px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.dashboard-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  transition: background 0.4s ease;
  z-index: 1;
}

.dashboard-card-ads::before {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}
.dashboard-card-bm::before {
  background: linear-gradient(90deg, var(--primary-end, #8b5cf6), #a855f7);
}
.dashboard-card-page::before {
  background: linear-gradient(90deg, #06b6d4, #0ea5e9);
}
.dashboard-card-detail::before {
  background: linear-gradient(90deg, var(--primary-start, #6366f1), var(--primary-end, #8b5cf6));
}
.dashboard-card-chart::before {
  background: linear-gradient(90deg, #06b6d4, #0891b2);
}
.dashboard-card-history::before {
  background: linear-gradient(90deg, #64748b, #94a3b8);
}

.dashboard-card:hover {
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 12px 32px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

/* Card Header */
.dcard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.dcard-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dcard-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
}

.dcard-icon-ads {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
}
.dcard-icon-bm {
  background: linear-gradient(135deg, var(--primary-end, #8b5cf6), #a855f7);
}
.dcard-icon-page {
  background: linear-gradient(135deg, #06b6d4, #0ea5e9);
}
.dcard-icon-detail {
  background: var(--primary-gradient, linear-gradient(135deg, #6366f1, #8b5cf6));
}
.dcard-icon-chart {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
}
.dcard-icon-history {
  background: linear-gradient(135deg, #64748b, #94a3b8);
}

.dcard-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1b2433;
  margin: 0;
}

.dcard-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--primary-start, #6366f1);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(var(--primary-rgb, 99, 102, 241), 0.06);
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.dcard-link:hover {
  background: rgba(var(--primary-rgb, 99, 102, 241), 0.12);
  color: #4f46e5;
}

/* Card Body */
.dcard-body {
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 200px;
}

.dcard-body:has(.empty-state) {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 260px;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  text-align: center;
  width: 100%;
  height: 100%;
}

.empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.empty-icon i {
  font-size: 1.6rem;
  color: #94a3b8;
}

.empty-state p {
  color: #94a3b8;
  font-size: 0.85rem;
  margin-bottom: 0;
  font-weight: 500;
}

/* Ad Details List */
.ad-details-list {
  padding: 0 16px 16px;
}

.ad-detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 4px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  transition: background 0.15s ease;
}

.ad-detail-item:hover {
  background: rgba(var(--primary-rgb, 99, 102, 241), 0.02);
}

.ad-detail-item:last-child {
  border-bottom: none;
}

.detail-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 500;
}

.detail-label i {
  color: var(--primary-end, #8b5cf6);
  font-size: 0.95rem;
  width: 18px;
  text-align: center;
}

.detail-value {
  font-weight: 600;
  color: #1b2433;
  font-size: 0.85rem;
}

/* Versions List */
.versions-list {
  overflow-y: auto;
  padding: 0 16px 16px !important;
  min-height: 0;
  max-height: 420px;
}

.versions-list::-webkit-scrollbar {
  width: 4px;
}

.versions-list::-webkit-scrollbar-track {
  background: transparent;
}

.versions-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.versions-list::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Version Timeline */
.version-timeline {
  position: relative;
  padding-left: 20px;
}

.version-timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: #e2e8f0;
  border-radius: 1px;
}

.vt-item {
  position: relative;
  padding-bottom: 16px;
}

.vt-item:last-child {
  padding-bottom: 0;
}

.vt-dot {
  position: absolute;
  left: -20px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #cbd5e1;
  border: 2px solid white;
  box-shadow: 0 0 0 2px #e2e8f0;
  z-index: 1;
}

.vt-latest .vt-dot {
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.vt-content {
  background: #f8fafc;
  border-radius: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.vt-latest .vt-content {
  background: rgba(16, 185, 129, 0.04);
  border-color: rgba(16, 185, 129, 0.12);
}

.vt-item:hover .vt-content {
  background: #f1f5f9;
}

.vt-latest:hover .vt-content {
  background: rgba(16, 185, 129, 0.06);
}

.vt-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.vt-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 6px;
  background: #e2e8f0;
  color: #475569;
  letter-spacing: 0.3px;
}

.vt-badge-new {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.vt-date {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 500;
}

.vt-body {
  font-size: 0.8rem;
  color: #334155;
  line-height: 1.5;
  font-weight: 450;
}

/* Responsive */
@media (max-width: 1400px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto;
  }

  .dashboard-col {
    display: flex;
    flex-direction: column;
    grid-row: auto;
  }

  .hero-content {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-counters {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 992px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .hero-user {
    flex-direction: column;
    text-align: center;
  }

  .hero-identifiers {
    justify-content: center;
  }

  .hero-chips {
    justify-content: center;
  }

  .hero-counters {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-counter {
    justify-content: center;
  }

  .hero-counter-divider {
    width: 100%;
    height: 1px;
    margin: 4px 0;
  }
}

/* ============================================
   BM CHART STYLES
   ============================================ */

.bm-chart-container {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 8px 0;
}

.bm-chart-wrapper {
  position: relative;
  width: 160px;
  height: 160px;
  flex-shrink: 0;
}

.bm-chart-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
}

.bm-chart-legend {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.bm-legend-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: 10px;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.bm-legend-item:hover {
  background: #f1f5f9;
  transform: translateX(4px);
}

.bm-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.bm-legend-dot.live {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.bm-legend-dot.die-xmdt {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.bm-legend-dot.die-vv {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.bm-legend-dot.other {
  background: linear-gradient(135deg, #6b7280, #4b5563);
  box-shadow: 0 2px 8px rgba(107, 114, 128, 0.4);
}

.bm-legend-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bm-legend-label {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

.bm-legend-value {
  font-size: 18px;
  font-weight: 700;
  color: #232e3d;
}

@media (max-width: 576px) {
  .bm-chart-container {
    flex-direction: column;
    align-items: center;
  }

  .bm-chart-legend {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .bm-legend-item {
    padding: 8px 12px;
  }
}

/* ============================================
   ZOOM CONTROL — stepper [−] 100% [+]
   ============================================ */
.zoom-control {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  height: 30px;
  overflow: hidden;
  font-family: inherit;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.zoom-control:hover {
  border-color: rgba(255, 255, 255, 0.32);
}

.zoom-control.zoom-active {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.32);
}

.zoom-btn {
  background: transparent;
  border: 0;
  color: #fff;
  width: 26px;
  height: 100%;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.14s ease, transform 0.1s ease;
  font-family: inherit;
  line-height: 1;
}

.zoom-btn:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.18);
}

.zoom-btn:not(:disabled):active {
  background: rgba(255, 255, 255, 0.26);
  transform: scale(0.92);
}

.zoom-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.zoom-display {
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  min-width: 40px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.14s ease;
}

.zoom-display:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ============================================
   FULLSCREEN TOGGLE BUTTON (header)
   ============================================ */
.fullscreen-toggle {
  background: rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  transition:
    background 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.12s ease,
    box-shadow 0.2s ease;
  font-family: inherit;
}

.fullscreen-toggle:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.38);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.fullscreen-toggle:active {
  transform: scale(0.94);
}

.fullscreen-toggle i {
  display: inline-block;
  line-height: 1;
}

/* ============================================
   GOOGLE TRANSLATE — ẨN UI MẶC ĐỊNH
   ============================================ */
.skiptranslate,
.goog-te-banner-frame,
.goog-te-balloon-frame,
.goog-te-gadget,
.goog-te-gadget-icon,
.goog-te-gadget-simple,
.goog-te-menu-value,
.goog-te-spinner-pos,
.goog-logo-link,
.goog-te-ftab,
#goog-gt-tt,
#google_translate_element,
iframe.skiptranslate,
iframe[id^="goog-gt-"],
iframe[name="goog-tooltip"],
.VIpgJd-ZVi9od-l4eHX-hSRGPd,
.VIpgJd-ZVi9od-aZ2wEe-wOHMyf {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body {
  top: 0 !important;
  position: static !important;
}

html {
  margin-top: 0 !important;
}

.goog-text-highlight {
  background: transparent !important;
  box-shadow: none !important;
}

font[style*="background-color"] {
  background: transparent !important;
  box-shadow: none !important;
}

/* ============================================
   LANGUAGE SWITCHER
   ============================================ */
.lang-switcher {
  position: relative;
  display: inline-block;
  margin-left: 12px;
  vertical-align: middle;
  font-family: inherit;
}

.lang-toggle {
  background: rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  height: 30px;
  padding: 0 9px 0 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
  transition:
    background 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.12s ease,
    box-shadow 0.2s ease;
  font-family: inherit;
}

.lang-toggle:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.38);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.lang-toggle:active {
  transform: scale(0.96);
}

.lang-flag-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 14px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.95);
  color: #4f46e5;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.lang-toggle .lang-chevron {
  font-size: 14px;
  opacity: 0.85;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.lang-toggle[aria-expanded="true"] .lang-chevron {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.08),
    0 16px 40px rgba(0, 0, 0, 0.12);
  padding: 6px;
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.96);
  transform-origin: top left;
  transition:
    opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0s linear 0.28s;
  z-index: 1050;
  pointer-events: none;
}

.lang-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  transition:
    opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.32s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0s linear;
  pointer-events: auto;
}

.lang-item {
  width: 100%;
  background: transparent;
  border: 0;
  padding: 8px 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition:
    background 0.16s ease,
    color 0.16s ease;
  text-align: left;
  font-family: inherit;
  opacity: 0;
  transform: translateX(-6px);
}

.lang-menu.open .lang-item {
  animation: langItemIn 0.36s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--i) * 40ms + 80ms);
}

@keyframes langItemIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.lang-item + .lang-item {
  margin-top: 2px;
}

.lang-item .lang-flag-badge {
  width: 22px;
  height: 16px;
  font-size: 10px;
  background: var(--primary-gradient, linear-gradient(135deg, #6366f1, #8b5cf6));
  color: #fff;
  box-shadow: 0 2px 6px rgba(var(--primary-rgb, 99, 102, 241), 0.25);
}

.lang-item .lang-name {
  flex: 1;
  white-space: nowrap;
}

.lang-item .lang-check {
  font-size: 16px;
  color: var(--primary-start, #6366f1);
  flex-shrink: 0;
}

.lang-item:hover {
  background: #f3f4f6;
  color: #1f2937;
}

.lang-item.active {
  background: linear-gradient(
    135deg,
    rgba(var(--primary-end-rgb, 139, 92, 246), 0.1) 0%,
    rgba(var(--primary-rgb, 99, 102, 241), 0.1) 100%
  );
  color: var(--primary-start, #6366f1);
  font-weight: 600;
}

.lang-item.active:hover {
  background: linear-gradient(
    135deg,
    rgba(var(--primary-end-rgb, 139, 92, 246), 0.16) 0%,
    rgba(var(--primary-rgb, 99, 102, 241), 0.16) 100%
  );
}

/* ============================================================
   DARK MODE — popup nhúng JS (workflow sweep: bm.js / scripts.js /
   via.js / ads-security.js / page.js). Phủ ba-/zlink-/bms-/lp-/sp-/
   ext-install-/fxa-/ad-/bm-/id-/sa-/cp-/qd-/mt-otp-. Đặt CUỐI để thắng.
   GIỮ nền trắng: .dep-qr-wrap .qd-usdt-qr .avatar-letter .fiox-color-badge.
   ============================================================ */

/* #4 — SweetAlert close/cancel popup inject !important (html prefix nâng specificity) */
html[data-bs-theme="dark"] .swal2-popup.ba-popup .swal2-close,
html[data-bs-theme="dark"] .swal2-popup.bms-popup .swal2-close,
html[data-bs-theme="dark"] .swal2-popup.zlink-popup .swal2-close,
html[data-bs-theme="dark"] .swal2-popup.id-popup .swal2-close,
html[data-bs-theme="dark"] .sp-modal .swal2-close,
html[data-bs-theme="dark"] .sa-modal .swal2-close {
  background: #334155 !important;
  color: #cbd5e1 !important;
}
html[data-bs-theme="dark"] .swal2-popup.ba-popup .swal2-close:hover,
html[data-bs-theme="dark"] .swal2-popup.bms-popup .swal2-close:hover,
html[data-bs-theme="dark"] .swal2-popup.zlink-popup .swal2-close:hover,
html[data-bs-theme="dark"] .swal2-popup.id-popup .swal2-close:hover,
html[data-bs-theme="dark"] .sp-modal .swal2-close:hover,
html[data-bs-theme="dark"] .sa-modal .swal2-close:hover {
  background: #475569 !important;
  color: #e2e8f0 !important;
}
/* Nút X custom vòng tròn trắng nổi (top:-14px, background:#fff inline) trong Bootstrap modal
   — customizeModal "Tùy chỉnh cột", settingModal "Cài đặt"... (con trực tiếp của .modal-content) */
[data-bs-theme="dark"] .modal-content > button[aria-label="Close"] {
  background: #334155 !important;
  color: #cbd5e1 !important;
}
[data-bs-theme="dark"] .modal-content > button[aria-label="Close"]:hover {
  background: #475569 !important;
  color: #e2e8f0 !important;
}

/* Nút "Chỉ định tài sản" ngang search trong viewer Quản trị viên BM */
.ba-assign-all-btn { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; padding: 9px 14px; border: none; border-radius: 10px; background: linear-gradient(135deg, var(--primary-end, #8b5cf6), var(--primary-start, #6366f1)); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: 0 4px 12px rgba(var(--primary-rgb, 99, 102, 241), 0.3); transition: filter 0.15s; white-space: nowrap; }
.ba-assign-all-btn:hover { filter: brightness(1.07); }
.ba-assign-all-btn i { font-size: 16px; }
/* Checkbox tích chọn QTV trên card để Chỉ định tài sản hàng loạt */
.ba-pick { flex-shrink: 0; width: 17px; height: 17px; cursor: pointer; accent-color: var(--primary-end, #8b5cf6); margin: 0 2px 0 0; }
.ba-card { cursor: pointer; }
.ba-card-picked { border-color: var(--primary-end, #8b5cf6) !important; background: #f5f3ff !important; }

/* ===== Modal Chỉ định tài sản cho QTV (aam-*) ===== */
.aam-overlay {
  position: fixed; inset: 0; z-index: 20000;
  background: rgba(15, 23, 42, 0.55); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.aam-modal {
  width: 100%; max-width: 1130px; max-height: 86vh;
  background: #fff; border-radius: 16px; box-shadow: 0 24px 60px -12px rgba(15, 23, 42, 0.45);
  display: flex; flex-direction: column; overflow: hidden;
}
.aam-header { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid #eef0f3; }
.aam-h-icon { flex-shrink: 0; width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary-end, #8b5cf6), var(--primary-start, #6366f1)); color: #fff; font-size: 19px; }
.aam-h-text { flex: 1; min-width: 0; }
.aam-title { font-size: 16px; font-weight: 700; color: #0f172a; line-height: 1.2; }
.aam-sub { font-size: 12.5px; color: #94a3b8; margin-top: 2px; }
.aam-close { flex-shrink: 0; width: 30px; height: 30px; border: none; border-radius: 50%; background: #f1f5f9; color: #64748b; font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.15s, color 0.15s; }
.aam-close:hover { background: #e2e8f0; color: #0f172a; }
.aam-body { display: flex; flex: 1; min-height: 0; }
.aam-col { display: flex; flex-direction: column; min-height: 0; padding: 14px 16px; }
.aam-col-types { width: 240px; flex-shrink: 0; border-right: 1px solid #eef0f3; overflow-y: auto; }
.aam-modal.aam-has-user { max-width: 1340px; }
.aam-pp-modal { max-width: 480px; }
.aam-pp-body { padding: 16px 20px; max-height: 62vh; overflow-y: auto; }
.aam-pp-body .aam-perm-opts { flex: none; min-height: 0; overflow: visible; }
.aam-col-users { width: 220px; flex-shrink: 0; border-right: 1px solid #eef0f3; overflow-y: auto; }
.aam-user-list { display: flex; flex-direction: column; gap: 4px; }
.aam-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid transparent; border-radius: 10px; background: transparent; cursor: pointer; text-align: left; transition: background 0.15s, border-color 0.15s; }
.aam-user:hover { background: #f8fafc; }
.aam-user.is-active { background: rgba(var(--primary-rgb, 99, 102, 241), 0.1); border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.25); }
.aam-user-av { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--primary-end, #8b5cf6), var(--primary-start, #6366f1)); color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.aam-user-info { display: flex; flex-direction: column; min-width: 0; }
.aam-user-name { font-size: 13px; font-weight: 600; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aam-user-sub { font-size: 11px; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aam-user input[type="checkbox"] { flex-shrink: 0; cursor: pointer; accent-color: var(--primary-start, #6366f1); width: 15px; height: 15px; margin: 0; }
.aam-user-selall { display: flex; align-items: center; gap: 7px; padding: 4px 10px 8px; font-size: 12.5px; font-weight: 600; color: #64748b; cursor: pointer; }
.aam-user-selall input { accent-color: var(--primary-start, #6366f1); cursor: pointer; margin: 0; }
[data-bs-theme="dark"] .aam-user-selall { color: #94a3b8; }
[data-bs-theme="dark"] .aam-col-users { border-right-color: rgba(255, 255, 255, 0.08); }
[data-bs-theme="dark"] .aam-user { color: #cbd5e1; }
[data-bs-theme="dark"] .aam-user:hover { background: #2e3a4b; }
[data-bs-theme="dark"] .aam-user.is-active { background: rgba(var(--primary-rgb, 99, 102, 241), 0.18); border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.4); }
[data-bs-theme="dark"] .aam-user-name { color: #e2e8f0; }
.aam-col-assets { flex: 1; min-width: 0; }
.aam-col-perm { width: 300px; flex-shrink: 0; border-left: 1px solid #eef0f3; display: flex; flex-direction: column; overflow: hidden; }
.aam-perm-opts { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.aam-perm-opts > * { flex-shrink: 0; }
.aam-perm-hr { flex-shrink: 0; height: 1px; background: #e5e7eb; margin: 3px 0; }
[data-bs-theme="dark"] .aam-perm-hr { background: rgba(255, 255, 255, 0.1); }
.aam-btn-remove { flex-shrink: 0; margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 10px; border: 1px solid #fecaca; border-radius: 10px; background: #fff5f5; color: #dc2626; font-size: 13px; font-weight: 600; cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s; }
.aam-btn-remove i { font-size: 16px; }
.aam-btn-remove:hover { background: #fee2e2; }
.aam-btn-remove.is-confirm { background: #dc2626; color: #fff; border-color: #dc2626; }
.aam-btn-remove:disabled { opacity: 0.6; cursor: default; }
[data-bs-theme="dark"] .aam-btn-remove { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.3); color: #fca5a5; }
[data-bs-theme="dark"] .aam-btn-remove:hover { background: rgba(239, 68, 68, 0.18); }
[data-bs-theme="dark"] .aam-btn-remove.is-confirm { background: #dc2626; color: #fff; border-color: #dc2626; }
.aam-perm-opt { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border: 1.5px solid #e5e7eb; border-radius: 11px; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.aam-perm-opt:hover { border-color: #c4b5fd; }
.aam-perm-opt.is-sel { border-color: var(--primary-end, #8b5cf6); background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.06); }
.aam-perm-opt input { flex-shrink: 0; cursor: pointer; accent-color: var(--primary-end, #8b5cf6); width: 16px; height: 16px; margin: 1px 0 0; }
.aam-perm-opt-body { display: flex; flex-direction: column; gap: 3px; }
.aam-perm-opt-name { font-size: 13.5px; font-weight: 600; line-height: 1.35; color: #1e293b; }
.aam-perm-opt-desc { font-size: 12px; line-height: 1.5; color: #64748b; }
.aam-perm-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; color: #94a3b8; margin: 8px 2px 2px; }
.aam-perm-group:first-child { margin-top: 0; }
.aam-bag-block { border: 1px solid #eef0f3; border-radius: 10px; margin-bottom: 8px; overflow: hidden; }
.aam-bag-sec { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 12px; background: #f8fafc; border: none; cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--primary-start, #6366f1); text-align: left; }
.aam-bag-sec > span { display: flex; align-items: center; }
.aam-bag-sec > i { font-size: 18px; color: #94a3b8; transition: transform 0.2s ease; }
.aam-bag-block.is-open .aam-bag-sec > i { transform: rotate(180deg); }
.aam-bag-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary-end, #8b5cf6); margin-left: 7px; }
.aam-bag-body { display: none; padding: 8px; flex-direction: column; gap: 8px; }
.aam-bag-block.is-open .aam-bag-body { display: flex; }
[data-bs-theme="dark"] .aam-bag-block { border-color: rgba(255, 255, 255, 0.08); }
[data-bs-theme="dark"] .aam-bag-sec { background: #1b2433; color: #a5b4fc; }
.aam-perm-opt.is-disabled { opacity: 0.55; cursor: not-allowed; background: #f8fafc; }
.aam-perm-opt.is-disabled input { cursor: not-allowed; }
.aam-perm-pending { padding: 14px; border-radius: 11px; background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.2); font-size: 12.5px; line-height: 1.5; color: #b45309; display: flex; gap: 7px; }
.aam-perm-pending i { flex-shrink: 0; margin-top: 1px; font-size: 15px; }
.aam-col-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: #94a3b8; margin-bottom: 10px; }
.aam-type-list { display: flex; flex-direction: column; gap: 4px; }
.aam-type { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid transparent; border-radius: 10px; background: transparent; cursor: pointer; text-align: left; font-size: 13.5px; color: #1e293b; transition: background 0.15s, border-color 0.15s; }
.aam-type:hover { background: #f8fafc; }
.aam-type.is-active { background: rgba(var(--primary-rgb, 99, 102, 241), 0.1); border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.25); color: #4338ca; font-weight: 600; }
.aam-type-ic { flex-shrink: 0; width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: #f1f5f9; font-size: 16px; }
.aam-type-name { flex: 1; }
.aam-col-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.aam-col-head .aam-col-label { margin-bottom: 0; }
.aam-load-btn { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; color: #4338ca; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.aam-load-btn:hover { background: #f5f3ff; border-color: #c4b5fd; }
.aam-search-wrap { position: relative; margin-bottom: 8px; }
.aam-search-wrap > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 16px; }
.aam-search { width: 100%; box-sizing: border-box; padding: 9px 12px 9px 36px; border: 1.5px solid #e5e7eb; border-radius: 10px; font-size: 13.5px; color: #1e293b; outline: none; transition: border-color 0.15s; }
.aam-search:focus { border-color: var(--primary-end, #8b5cf6); }
.aam-selall { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: #64748b; cursor: pointer; margin-bottom: 8px; user-select: none; }
.aam-grid { flex: 1; min-height: 240px; width: 100%; border: 1px solid #eef0f3; border-radius: 10px; overflow: hidden; }
.aam-grid .aam-grid-mono { font-family: monospace; font-size: 12px; }
.aam-grid .ag-cell { display: flex; align-items: center; }
.aam-grid .ag-header-cell-menu-button, .aam-grid .ag-header-icon.ag-header-cell-menu-button, .aam-grid .col-filter-btn { display: none !important; }
.aam-cell-acc { line-height: 1.25; }
.aam-cell-name { font-weight: 600; font-size: 13px; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aam-cell-id { font-size: 11px; color: #94a3b8; font-family: monospace; }
.aam-asset-list { flex: 1; overflow-y: auto; min-height: 220px; border: 1px solid #eef0f3; border-radius: 10px; padding: 4px; }
.aam-asset { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; transition: background 0.12s; }
.aam-asset:hover { background: #f8fafc; }
.aam-asset.is-sel { background: rgba(var(--primary-rgb, 99, 102, 241), 0.08); }
.aam-asset input { flex-shrink: 0; cursor: pointer; }
.aam-asset-name { flex: 1; min-width: 0; font-size: 13px; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aam-asset-id { flex-shrink: 0; font-size: 11.5px; color: #94a3b8; font-family: monospace; }
.aam-asset-live, .aam-asset-kind { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.2px; line-height: 1; }
.aam-asset-live i { font-size: 8px; }
.aam-asset-kind i { font-size: 11px; }
.aam-asset-live.aam-live-on { color: #15803d; }
.aam-asset-live.aam-live-off { color: #dc2626; }
.aam-asset-kind.aam-kind-own { color: #15803d; }
.aam-asset-kind.aam-kind-share { color: #b45309; }
.aam-empty { padding: 36px 12px; text-align: center; font-size: 13px; color: #94a3b8; }
.aam-spin { display: inline-block; animation: aamspin 0.8s linear infinite; }
@keyframes aamspin { to { transform: rotate(360deg); } }
.aam-grid .ag-overlay-loading-wrapper { background: rgba(255, 255, 255, 0.72); }
.aam-grid-loading { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.aam-grid-spinner { width: 32px; height: 32px; border: 3px solid rgba(var(--primary-rgb, 99, 102, 241), 0.18); border-top-color: var(--primary-start, #6366f1); border-radius: 50%; animation: aamspin 0.7s linear infinite; }
.aam-grid-loading-txt { font-size: 13px; font-weight: 600; color: var(--primary-start, #6366f1); }
[data-bs-theme="dark"] .aam-grid .ag-overlay-loading-wrapper { background: rgba(27, 36, 51, 0.72); }
[data-bs-theme="dark"] .aam-grid-spinner { border-color: rgba(129, 140, 248, 0.22); border-top-color: #818cf8; }
[data-bs-theme="dark"] .aam-grid-loading-txt { color: #a5b4fc; }
.aam-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid #eef0f3; }
.aam-foot-info { font-size: 12.5px; color: #64748b; }
.aam-foot-info b { color: #0f172a; }
.aam-foot-btns { display: flex; gap: 10px; }
.aam-btn { border: none; border-radius: 10px; padding: 9px 22px; font-size: 14px; font-weight: 600; cursor: pointer; transition: filter 0.15s, background 0.15s; }
.aam-btn-cancel { background: #f1f5f9; color: #64748b; }
.aam-btn-cancel:hover { background: #e2e8f0; }
.aam-btn-assign { background: linear-gradient(135deg, var(--primary-end, #8b5cf6), var(--primary-start, #6366f1)); color: #fff; box-shadow: 0 4px 14px rgba(var(--primary-rgb, 99, 102, 241), 0.35); }
.aam-btn-assign:hover { filter: brightness(1.07); }
.aam-btn-assign:disabled { opacity: 0.6; cursor: not-allowed; }
.aam-status { padding: 11px 20px; font-size: 13px; line-height: 1.45; display: flex; align-items: center; gap: 8px; border-top: 1px solid #eef0f3; }
.aam-status[hidden] { display: none; }
.aam-status i { flex-shrink: 0; font-size: 16px; }
.aam-status.is-loading { color: #4338ca; background: rgba(var(--primary-rgb, 99, 102, 241), 0.06); }
.aam-status.is-done { color: #15803d; background: rgba(34, 197, 94, 0.08); }
.aam-status.is-warn { color: #b45309; background: rgba(245, 158, 11, 0.1); }
.aam-status.is-error { color: #b91c1c; background: rgba(220, 38, 38, 0.08); }
/* ── Dark ── */
[data-bs-theme="dark"] .aam-modal { background: #232e3d; box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.6); }
[data-bs-theme="dark"] .aam-header,
[data-bs-theme="dark"] .aam-footer { border-color: rgba(255, 255, 255, 0.08); }
[data-bs-theme="dark"] .aam-col-types { border-right-color: rgba(255, 255, 255, 0.08); }
[data-bs-theme="dark"] .aam-col-perm { border-left-color: rgba(255, 255, 255, 0.08); }
[data-bs-theme="dark"] .aam-perm-opt { border-color: rgba(255, 255, 255, 0.1); }
[data-bs-theme="dark"] .aam-perm-opt:hover { border-color: rgba(var(--primary-end-rgb, 139, 92, 246), 0.5); }
[data-bs-theme="dark"] .aam-perm-opt.is-sel { border-color: var(--primary-end, #8b5cf6); background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.16); }
[data-bs-theme="dark"] .aam-perm-opt-name { color: #e2e8f0; }
[data-bs-theme="dark"] .aam-perm-opt-desc { color: #94a3b8; }
[data-bs-theme="dark"] .aam-perm-opt.is-disabled { background: #1b2433; }
[data-bs-theme="dark"] .aam-perm-pending { background: rgba(245, 158, 11, 0.14); border-color: rgba(245, 158, 11, 0.3); color: #fcd34d; }
[data-bs-theme="dark"] .aam-title,
[data-bs-theme="dark"] .aam-foot-info b,
[data-bs-theme="dark"] .aam-asset-name { color: #e2e8f0; }
[data-bs-theme="dark"] .aam-type { color: #cbd5e1; }
[data-bs-theme="dark"] .aam-type:hover { background: #2e3a4b; }
[data-bs-theme="dark"] .aam-type.is-active { background: rgba(var(--primary-rgb, 99, 102, 241), 0.18); border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.4); color: #c4b5fd; }
[data-bs-theme="dark"] .aam-type-ic { background: #2e3a4b; }
[data-bs-theme="dark"] .aam-close { background: #2e3a4b; color: #cbd5e1; }
[data-bs-theme="dark"] .aam-close:hover { background: #475569; color: #fff; }
[data-bs-theme="dark"] .aam-load-btn { background: #2e3a4b; border-color: rgba(255, 255, 255, 0.1); color: #c4b5fd; }
[data-bs-theme="dark"] .aam-load-btn:hover { background: rgba(var(--primary-rgb, 99, 102, 241), 0.18); border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.4); }
[data-bs-theme="dark"] .aam-search { background: #1b2433; border-color: rgba(255, 255, 255, 0.1); color: #e2e8f0; }
[data-bs-theme="dark"] .aam-search:focus { border-color: var(--primary-end, #8b5cf6); }
[data-bs-theme="dark"] .aam-grid { border-color: rgba(255, 255, 255, 0.08); }
[data-bs-theme="dark"] .aam-cell-name { color: #e2e8f0; }
[data-bs-theme="dark"] .aam-asset-list { border-color: rgba(255, 255, 255, 0.08); }
[data-bs-theme="dark"] .aam-asset:hover { background: #2e3a4b; }
[data-bs-theme="dark"] .aam-asset.is-sel { background: rgba(var(--primary-rgb, 99, 102, 241), 0.16); }
[data-bs-theme="dark"] .aam-asset-kind.aam-kind-own { color: #6ee7b7; }
[data-bs-theme="dark"] .aam-asset-kind.aam-kind-share { color: #fcd34d; }
[data-bs-theme="dark"] .aam-asset-live.aam-live-on { color: #6ee7b7; }
[data-bs-theme="dark"] .aam-asset-live.aam-live-off { color: #fca5a5; }
[data-bs-theme="dark"] .aam-btn-cancel { background: #2e3a4b; color: #cbd5e1; }
[data-bs-theme="dark"] .aam-btn-cancel:hover { background: #475569; }
[data-bs-theme="dark"] .aam-status { border-top-color: rgba(255, 255, 255, 0.08); }
[data-bs-theme="dark"] .aam-status.is-loading { color: #a5b4fc; background: rgba(var(--primary-rgb, 99, 102, 241), 0.14); }
[data-bs-theme="dark"] .aam-status.is-done { color: #6ee7b7; background: rgba(16, 185, 129, 0.14); }
[data-bs-theme="dark"] .aam-status.is-warn { color: #fcd34d; background: rgba(245, 158, 11, 0.14); }
[data-bs-theme="dark"] .aam-status.is-error { color: #fca5a5; background: rgba(220, 38, 38, 0.16); }
html[data-bs-theme="dark"] .swal2-popup.bms-popup .swal2-cancel.swal2-styled,
html[data-bs-theme="dark"] .swal2-popup.ba-popup .swal2-cancel.swal2-styled {
  background: #2e3a4b !important;
  color: #e2e8f0 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

/* ba-* — Quản trị viên BM / TKQC */
[data-bs-theme="dark"] .ba-id-info-row,
[data-bs-theme="dark"] .ba-id-sep,
[data-bs-theme="dark"] .ba-id-chip,
[data-bs-theme="dark"] .ba-email,
[data-bs-theme="dark"] .ba-email i,
[data-bs-theme="dark"] .ba-email-empty,
[data-bs-theme="dark"] .ba-email-empty i,
[data-bs-theme="dark"] .ba-id-mono,
[data-bs-theme="dark"] .ba-time,
[data-bs-theme="dark"] .ba-tab,
[data-bs-theme="dark"] .ba-actions,
[data-bs-theme="dark"] .ba-empty,
[data-bs-theme="dark"] .ba-td-idx,
[data-bs-theme="dark"] .ba-search > i { color: #94a3b8 !important; }
[data-bs-theme="dark"] .ba-bmname,
[data-bs-theme="dark"] .ba-name,
[data-bs-theme="dark"] .ba-menu-item,
[data-bs-theme="dark"] .ba-cur-opt,
[data-bs-theme="dark"] .ba-td,
[data-bs-theme="dark"] .ba-td-limit,
[data-bs-theme="dark"] .ba-acc-name { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .ba-id-chip:hover,
[data-bs-theme="dark"] .ba-id-mono:hover,
[data-bs-theme="dark"] .ba-actions:hover,
[data-bs-theme="dark"] .ba-actions.active,
[data-bs-theme="dark"] .ba-menu-item:hover,
[data-bs-theme="dark"] .ba-cur-opt:hover,
[data-bs-theme="dark"] .ba-cell-sel .ba-acc-name,
[data-bs-theme="dark"] .ba-cell-sel .ba-id-mono { color: #c4b5fd !important; background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.16) !important; }
[data-bs-theme="dark"] .ba-id-chip.copied,
[data-bs-theme="dark"] .ba-id-mono.copied { color: #6ee7b7 !important; background: rgba(16, 185, 129, 0.15) !important; }
[data-bs-theme="dark"] .ba-tabs,
[data-bs-theme="dark"] .ba-tabs-row { border-bottom-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .ba-tab-count { background: #2e3a4b !important; color: #94a3b8 !important; }
[data-bs-theme="dark"] .ba-search input { border-color: rgba(255, 255, 255, 0.1) !important; background: #1b2433 !important; color: #e2e8f0 !important; }
[data-bs-theme="dark"] .ba-search input::placeholder { color: #94a3b8 !important; }
[data-bs-theme="dark"] .ba-search input:focus { border-color: var(--primary-end, #8b5cf6) !important; }
[data-bs-theme="dark"] .ba-loading-mini { background: #2a2410 !important; color: #fcd34d !important; border-color: rgba(245, 158, 11, 0.3) !important; }
[data-bs-theme="dark"] .ba-list::-webkit-scrollbar-thumb,
[data-bs-theme="dark"] .ba-cur-panel::-webkit-scrollbar-thumb,
[data-bs-theme="dark"] .ba-table-wrap::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .ba-card,
[data-bs-theme="dark"] .ba-menu,
[data-bs-theme="dark"] .ba-cur-panel,
[data-bs-theme="dark"] .ba-table-wrap { background: #232e3d !important; border-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .ba-card:hover { border-color: rgba(255, 255, 255, 0.18) !important; background: #2e3a4b !important; }
[data-bs-theme="dark"] .ba-card-viewer { border-color: var(--primary-end, #8b5cf6) !important; background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.16) !important; }
[data-bs-theme="dark"] .ba-platform-fb { color: #93c5fd !important; background: rgba(59, 130, 246, 0.15) !important; }
[data-bs-theme="dark"] .ba-platform-ig { color: #f9a8d4 !important; background: rgba(236, 72, 153, 0.16) !important; }
[data-bs-theme="dark"] .ba-role-chip { background: #2e3a4b !important; color: #94a3b8 !important; border-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .ba-role-chip-full { background: rgba(16, 185, 129, 0.15) !important; color: #6ee7b7 !important; border-color: rgba(16, 185, 129, 0.3) !important; }
[data-bs-theme="dark"] .ba-role-chip-limited { background: #2a2410 !important; color: #fcd34d !important; border-color: rgba(245, 158, 11, 0.3) !important; }
[data-bs-theme="dark"] .ba-menu-item-danger { color: #f87171 !important; }
[data-bs-theme="dark"] .ba-menu-item-danger:hover { background: rgba(220, 38, 38, 0.18) !important; color: #fca5a5 !important; }
[data-bs-theme="dark"] .ba-menu-sep,
[data-bs-theme="dark"] .ba-cur-opt-divider { background: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .ba-cur-btn { color: #e2e8f0 !important; background: #232e3d !important; border-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .ba-cur-btn:hover { border-color: rgba(var(--primary-end-rgb, 139, 92, 246), 0.5) !important; background: #2e3a4b !important; }
[data-bs-theme="dark"] .ba-cur-btn.open { border-color: var(--primary-end, #8b5cf6) !important; background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.16) !important; color: #c4b5fd !important; }
[data-bs-theme="dark"] .ba-cur-btn i,
[data-bs-theme="dark"] .ba-cur-opt .ba-cur-opt-name { color: #94a3b8 !important; }
[data-bs-theme="dark"] .ba-copy-btn { color: #c4b5fd !important; background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.16) !important; border-color: rgba(var(--primary-end-rgb, 139, 92, 246), 0.3) !important; }
[data-bs-theme="dark"] .ba-copy-btn:hover { background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.24) !important; border-color: rgba(var(--primary-end-rgb, 139, 92, 246), 0.5) !important; }
[data-bs-theme="dark"] .ba-copy-btn.copied { color: #6ee7b7 !important; background: rgba(16, 185, 129, 0.15) !important; border-color: rgba(16, 185, 129, 0.3) !important; }
[data-bs-theme="dark"] .ba-table thead th { background: linear-gradient(180deg, #2a2438, #241f33) !important; color: #c4b5fd !important; border-bottom-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .ba-row:hover { background: #2e3a4b !important; }
[data-bs-theme="dark"] .ba-row + .ba-row .ba-td { border-top-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .ba-status-chip-live { background: rgba(16, 185, 129, 0.15) !important; color: #6ee7b7 !important; border-color: rgba(16, 185, 129, 0.3) !important; }
[data-bs-theme="dark"] .ba-status-chip-die { background: rgba(220, 38, 38, 0.18) !important; color: #fca5a5 !important; border-color: rgba(220, 38, 38, 0.35) !important; }

/* lp-* — Load Pixel (page.js) */
[data-bs-theme="dark"] .lp-card:not(.active) { background: #232e3d !important; }
[data-bs-theme="dark"] .lp-card:not(.active):hover { background: #2e3a4b !important; }
[data-bs-theme="dark"] .lp-card::before { border-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .lp-card:not(.active):hover::before { border-color: var(--primary-start, #6366f1) !important; }
[data-bs-theme="dark"] .lp-card:not(.active) .lp-icon-wrap { background: rgba(var(--primary-rgb, 99, 102, 241), 0.16) !important; }
[data-bs-theme="dark"] .lp-card .fw-semibold { color: #e2e8f0 !important; }
[data-bs-theme="dark"] #lpBmIdInput { background: #1b2433 !important; color: #e2e8f0 !important; border-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] #lpBmInput textarea:focus { border-color: var(--primary-start, #6366f1) !important; }

/* zlink-* — Liên kết Zalo */
[data-bs-theme="dark"] .zlink-header { border-bottom-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .zlink-header-title,
[data-bs-theme="dark"] .zlink-step-content,
[data-bs-theme="dark"] .zlink-step-content b { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .zlink-header-sub { color: #94a3b8 !important; }
[data-bs-theme="dark"] .zlink-account-card { background: rgba(59, 130, 246, 0.15) !important; border-color: rgba(59, 130, 246, 0.3) !important; }
[data-bs-theme="dark"] .zlink-account-name { color: #93c5fd !important; }
[data-bs-theme="dark"] .zlink-account-phone { color: #60a5fa !important; }
[data-bs-theme="dark"] .zlink-phone-copy { color: #93c5fd !important; background: #232e3d !important; border-color: rgba(59, 130, 246, 0.3) !important; }
[data-bs-theme="dark"] .zlink-phone-copy:hover { background: rgba(59, 130, 246, 0.2) !important; border-color: rgba(59, 130, 246, 0.5) !important; }
[data-bs-theme="dark"] .zlink-phone-copy.copied,
[data-bs-theme="dark"] .zlink-code-copy.copied,
[data-bs-theme="dark"] .zlink-status.linked { background: rgba(16, 185, 129, 0.15) !important; color: #6ee7b7 !important; border-color: rgba(16, 185, 129, 0.3) !important; }
[data-bs-theme="dark"] .zlink-code-box { background: #2a2410 !important; border-color: #f59e0b !important; }
[data-bs-theme="dark"] .zlink-code-label { color: #fcd34d !important; }
[data-bs-theme="dark"] .zlink-code-value { color: #fde68a !important; }
[data-bs-theme="dark"] .zlink-code-copy { color: #fde68a !important; background: rgba(255, 255, 255, 0.08) !important; border-color: rgba(253, 230, 138, 0.25) !important; }
[data-bs-theme="dark"] .zlink-code-copy:hover { background: rgba(255, 255, 255, 0.14) !important; }
[data-bs-theme="dark"] .zlink-status { background: #2a2410 !important; color: #fcd34d !important; }

/* bms-* — Bảo mật */
[data-bs-theme="dark"] .bms-header { border-bottom-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .bms-header-title,
[data-bs-theme="dark"] .bms-toggle-title,
[data-bs-theme="dark"] .bms-name,
[data-bs-theme="dark"] .bms-stat-value,
[data-bs-theme="dark"] .bms-int-input-group input { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .bms-header-sub,
[data-bs-theme="dark"] .bms-toggle-interval,
[data-bs-theme="dark"] .bms-int-section-label,
[data-bs-theme="dark"] .bms-int-unit,
[data-bs-theme="dark"] .bms-stat-label,
[data-bs-theme="dark"] .bms-list-title,
[data-bs-theme="dark"] .bms-meta,
[data-bs-theme="dark"] .bms-footer,
[data-bs-theme="dark"] .bms-empty,
[data-bs-theme="dark"] .bms-search i { color: #94a3b8 !important; }
[data-bs-theme="dark"] .bms-header-status.active { background: rgba(16, 185, 129, 0.15) !important; color: #6ee7b7 !important; }
[data-bs-theme="dark"] .bms-header-status.inactive { background: #2e3a4b !important; color: #94a3b8 !important; }
[data-bs-theme="dark"] .bms-toggle-card,
[data-bs-theme="dark"] .bms-stat-card,
[data-bs-theme="dark"] .bms-item,
[data-bs-theme="dark"] .bms-interval-drop { background: #232e3d !important; border-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .bms-toggle-card.enabled,
[data-bs-theme="dark"] .bms-item-checked { border-color: rgba(var(--primary-end-rgb, 139, 92, 246), 0.5) !important; background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.16) !important; }
[data-bs-theme="dark"] .bms-toggle-icon,
[data-bs-theme="dark"] .bms-stat-selected .bms-stat-icon,
[data-bs-theme="dark"] .bms-avatar { background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.16) !important; }
[data-bs-theme="dark"] .bms-avatar { border-color: rgba(var(--primary-end-rgb, 139, 92, 246), 0.3) !important; }
[data-bs-theme="dark"] .bms-switch .bms-slider { background: #475569 !important; }
[data-bs-theme="dark"] .bms-switch .bms-slider::before { background: #e2e8f0 !important; }
[data-bs-theme="dark"] .bms-interval-btn { border-color: rgba(255, 255, 255, 0.1) !important; background: #2e3a4b !important; color: #e2e8f0 !important; }
[data-bs-theme="dark"] .bms-interval-btn:hover { border-color: rgba(var(--primary-end-rgb, 139, 92, 246), 0.5) !important; }
[data-bs-theme="dark"] .bms-int-preset { border-color: rgba(255, 255, 255, 0.1) !important; background: #2e3a4b !important; color: #94a3b8 !important; }
[data-bs-theme="dark"] .bms-int-preset:hover { background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.16) !important; border-color: rgba(var(--primary-end-rgb, 139, 92, 246), 0.5) !important; color: #c4b5fd !important; }
[data-bs-theme="dark"] .bms-int-divider,
[data-bs-theme="dark"] .bms-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .bms-int-input-group { border-color: rgba(255, 255, 255, 0.1) !important; background: #1b2433 !important; }
[data-bs-theme="dark"] .bms-int-step { background: #2e3a4b !important; color: #94a3b8 !important; }
[data-bs-theme="dark"] .bms-int-step:hover { background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.24) !important; color: #c4b5fd !important; }
[data-bs-theme="dark"] .bms-int-hint { background: #2a2410 !important; border-color: rgba(245, 158, 11, 0.3) !important; color: #fcd34d !important; }
[data-bs-theme="dark"] .bms-int-hint b { color: #fde68a !important; }
[data-bs-theme="dark"] .bms-stat-selected.full .bms-stat-icon { background: rgba(220, 38, 38, 0.18) !important; color: #fca5a5 !important; }
[data-bs-theme="dark"] .bms-stat-countdown .bms-stat-icon { background: rgba(16, 185, 129, 0.15) !important; color: #6ee7b7 !important; }
[data-bs-theme="dark"] .bms-stat-countdown.idle .bms-stat-icon { background: #2e3a4b !important; color: #94a3b8 !important; }
[data-bs-theme="dark"] .bms-stat-countdown.overdue .bms-stat-icon { background: #2a2410 !important; color: #fcd34d !important; }
[data-bs-theme="dark"] .bms-stat-selected.full .bms-stat-value { color: #fca5a5 !important; }
[data-bs-theme="dark"] .bms-list-btn:hover,
[data-bs-theme="dark"] .bms-item:hover { background: #2e3a4b !important; }
[data-bs-theme="dark"] .bms-item:hover { border-color: rgba(var(--primary-end-rgb, 139, 92, 246), 0.5) !important; }
[data-bs-theme="dark"] .bms-search input { border-color: rgba(255, 255, 255, 0.1) !important; background: #1b2433 !important; color: #e2e8f0 !important; }
[data-bs-theme="dark"] .bms-search input::placeholder { color: #94a3b8 !important; }
[data-bs-theme="dark"] .bms-check-mark { background: #1b2433 !important; border-color: rgba(255, 255, 255, 0.1) !important; }

/* sp-* — Hỗ trợ */
[data-bs-theme="dark"] .sp-card:hover { background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.16) !important; }
[data-bs-theme="dark"] .sp-card-icon.sp-zalo { background: rgba(16, 185, 129, 0.15) !important; }
[data-bs-theme="dark"] .sp-card-icon.sp-bill { background: #2a2410 !important; }
[data-bs-theme="dark"] .sp-card-icon.sp-dev { background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.16) !important; }
[data-bs-theme="dark"] .sp-card-name { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .sp-card-desc,
[data-bs-theme="dark"] .sp-card-arrow { color: #94a3b8 !important; }

/* ext-install-* */
[data-bs-theme="dark"] .ext-install-popup {
  background-image: linear-gradient(#232e3d, #232e3d), linear-gradient(90deg, var(--primary-start, #6366f1), var(--primary-end, #8b5cf6), #ec4899) !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45), 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}
[data-bs-theme="dark"] .ext-install-close { color: #94a3b8 !important; }
[data-bs-theme="dark"] .ext-install-close:hover { background: #2e3a4b !important; color: #e2e8f0 !important; }

/* fxa-* — Xác nhận chạy luồng */
[data-bs-theme="dark"] .fxa-name { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .fxa-header { color: #94a3b8 !important; }

/* ad-* / bm-* — Load TKQC / BM / Page (radio + toggle + limit) */
[data-bs-theme="dark"] .ad-radio-card .ad-radio-content,
[data-bs-theme="dark"] .bm-radio-card .bm-radio-content,
[data-bs-theme="dark"] .ad-toggle-item,
[data-bs-theme="dark"] .bm-toggle-item,
[data-bs-theme="dark"] .ad-limit-row,
[data-bs-theme="dark"] .bm-limit-row { border-color: rgba(255, 255, 255, 0.1) !important; background: #232e3d !important; }
[data-bs-theme="dark"] .ad-radio-card input[type="radio"]:checked + .ad-radio-content,
[data-bs-theme="dark"] .bm-radio-card input[type="radio"]:checked + .bm-radio-content { border-color: var(--primary-end, #8b5cf6) !important; background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.16) !important; }
[data-bs-theme="dark"] .ad-radio-card .ad-radio-icon,
[data-bs-theme="dark"] .bm-radio-card .bm-radio-icon { background: #232e3d !important; }
[data-bs-theme="dark"] .ad-radio-card .ad-radio-text,
[data-bs-theme="dark"] .bm-radio-card .bm-radio-text,
[data-bs-theme="dark"] .ad-toggle-label,
[data-bs-theme="dark"] .bm-toggle-label,
[data-bs-theme="dark"] .ad-limit-label,
[data-bs-theme="dark"] .bm-limit-label { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .ad-radio-card input[type="radio"]:checked + .ad-radio-content .ad-radio-text,
[data-bs-theme="dark"] .bm-radio-card input[type="radio"]:checked + .bm-radio-content .bm-radio-text { color: #c4b5fd !important; }
[data-bs-theme="dark"] #adLoadIdInput textarea,
[data-bs-theme="dark"] #bmLoadIdInput textarea,
[data-bs-theme="dark"] #pageLoadIdInput textarea,
[data-bs-theme="dark"] .ad-limit-input,
[data-bs-theme="dark"] .bm-limit-input { border-color: rgba(255, 255, 255, 0.1) !important; background: #1b2433 !important; color: #e2e8f0 !important; }
[data-bs-theme="dark"] #adLoadIdInput textarea::placeholder,
[data-bs-theme="dark"] #bmLoadIdInput textarea::placeholder,
[data-bs-theme="dark"] #pageLoadIdInput textarea::placeholder { color: #94a3b8 !important; }
[data-bs-theme="dark"] .ad-toggle-item:hover,
[data-bs-theme="dark"] .bm-toggle-item:hover { border-color: rgba(255, 255, 255, 0.18) !important; background: #2e3a4b !important; }
[data-bs-theme="dark"] .ad-switch-slider,
[data-bs-theme="dark"] .bm-switch-slider { background-color: #475569 !important; }
[data-bs-theme="dark"] .ad-switch-slider::before,
[data-bs-theme="dark"] .bm-switch-slider::before { background-color: #e2e8f0 !important; }
[data-bs-theme="dark"] .ad-select-all-btn:hover,
[data-bs-theme="dark"] .bm-select-all-btn:hover { background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.16) !important; }
[data-bs-theme="dark"] .ad-limit-icon,
[data-bs-theme="dark"] .bm-limit-icon { background: #2a2410 !important; }

/* id-* — Lọc theo ID */
[data-bs-theme="dark"] .id-count-badge { background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.18) !important; color: #c4b5fd !important; }
[data-bs-theme="dark"] .id-clear-link:hover { background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.16) !important; }
[data-bs-theme="dark"] .id-textarea-wrap textarea { border-color: rgba(255, 255, 255, 0.1) !important; background: #1b2433 !important; color: #e2e8f0 !important; }
[data-bs-theme="dark"] .id-textarea-wrap textarea::placeholder { color: #94a3b8 !important; }
[data-bs-theme="dark"] .id-toggle-card { background: #232e3d !important; border-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .id-toggle-card:hover { border-color: rgba(255, 255, 255, 0.18) !important; }
[data-bs-theme="dark"] .id-toggle-card.active { border-color: var(--primary-end, #8b5cf6) !important; }
[data-bs-theme="dark"] .id-toggle-title { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .id-toggle-desc { color: #94a3b8 !important; }
[data-bs-theme="dark"] .id-switch-slider { background: #475569 !important; }
[data-bs-theme="dark"] .id-switch-slider::before { background: #e2e8f0 !important; }

/* sa-* — Chọn / Đổi tài khoản */
[data-bs-theme="dark"] .sa-search input { border-color: rgba(255, 255, 255, 0.1) !important; background-color: #1b2433 !important; color: #e2e8f0 !important; }
[data-bs-theme="dark"] .sa-search input::placeholder { color: #94a3b8 !important; }
[data-bs-theme="dark"] .sa-list::-webkit-scrollbar-thumb { background: #475569 !important; }
[data-bs-theme="dark"] .sa-item:hover { background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.16) !important; }
[data-bs-theme="dark"] .sa-item-active,
[data-bs-theme="dark"] .sa-item-active:hover { background: rgba(16, 185, 129, 0.15) !important; }
[data-bs-theme="dark"] .sa-avatar { background: #1b2433 !important; border-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .sa-name { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .sa-uid { color: #94a3b8 !important; }
[data-bs-theme="dark"] .sa-badge-active,
[data-bs-theme="dark"] .sa-badge-live { background: rgba(16, 185, 129, 0.15) !important; color: #4ade80 !important; }
[data-bs-theme="dark"] .sa-badge-die { background: rgba(220, 38, 38, 0.18) !important; color: #f87171 !important; }
[data-bs-theme="dark"] .sa-badge-warn { background: #2a2410 !important; color: #fbbf24 !important; }
[data-bs-theme="dark"] .sa-badge-info { background: rgba(59, 130, 246, 0.15) !important; color: #60a5fa !important; }
[data-bs-theme="dark"] .sa-footer { border-top-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .sa-add-btn { background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.16) !important; }
[data-bs-theme="dark"] .sa-add-btn:hover { background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.22) !important; }
[data-bs-theme="dark"] .sa-add-text { color: #c4b5fd !important; }

/* #colPalettePop + cp-* — popover màu cột */
[data-bs-theme="dark"] #colPalettePop { background: #232e3d !important; border-color: rgba(255, 255, 255, 0.1) !important; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45) !important; }
[data-bs-theme="dark"] #colPalettePop > div:first-child { color: #94a3b8 !important; }
[data-bs-theme="dark"] #colPalettePop .cp-sw { border-color: #232e3d !important; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) !important; }
[data-bs-theme="dark"] #colPalettePop .cp-native-wrap { border-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] #colPalettePop .cp-hex { border-color: rgba(255, 255, 255, 0.1) !important; background: #1b2433 !important; color: #e2e8f0 !important; }

/* via.js — nạp/mua gói + OTP (QR .qd-usdt-qr GIỮ trắng) */
[data-bs-theme="dark"] .swal2-popup .qd-tabs { background: #1b2433 !important; }
[data-bs-theme="dark"] .swal2-popup .qd-tab { background: transparent !important; color: #94a3b8 !important; }
[data-bs-theme="dark"] .swal2-popup .qd-tab.is-active { background: #232e3d !important; color: #a5b4fc !important; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) !important; }
[data-bs-theme="dark"] .swal2-popup .qd-pane div[style*="#f1f5f9"],
[data-bs-theme="dark"] .swal2-popup .qd-usdt-loading,
[data-bs-theme="dark"] .swal2-popup .qd-usdt-pending div[style*="#f1f5f9"] { background: #1b2433 !important; color: #e2e8f0 !important; }
[data-bs-theme="dark"] .swal2-popup .qd-usdt-err { background: rgba(220, 38, 38, 0.18) !important; border-color: rgba(248, 113, 113, 0.4) !important; }
[data-bs-theme="dark"] .swal2-popup .qd-usdt-pending-wallet { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .swal2-popup .qd-usdt-wallet-copy,
[data-bs-theme="dark"] .swal2-popup .dep-usdt-copy { background: #232e3d !important; border-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .swal2-popup .qd-usdt-cancel-btn { background: #232e3d !important; border-color: rgba(248, 113, 113, 0.4) !important; }
[data-bs-theme="dark"] .mt-otp-card { background: #2e3a4b !important; border-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .mt-otp-label { color: #94a3b8 !important; }
[data-bs-theme="dark"] .mt-otp-value { color: #e2e8f0 !important; }

/* ===== Nút .btn-light (Hủy #drpCancel...) — Bootstrap trắng cố định, dark không tự đổi ===== */
[data-bs-theme="dark"] .btn-light {
  --bs-btn-bg: #2e3a4b;
  --bs-btn-border-color: rgba(255, 255, 255, 0.12);
  --bs-btn-color: #e2e8f0;
  --bs-btn-hover-bg: #3a465a;
  --bs-btn-hover-border-color: rgba(255, 255, 255, 0.2);
  --bs-btn-hover-color: #ffffff;
  --bs-btn-active-bg: #3a465a;
  --bs-btn-active-border-color: rgba(255, 255, 255, 0.25);
  --bs-btn-active-color: #ffffff;
}

/* ===== Công tắc feature OFF (#d1d5db) — track = Bootstrap base background:var(--bs-form-check-bg).
   Override CẢ biến LẪN background-color + html-prefix specificity cao. Checked giữ primary. ===== */
html[data-bs-theme="dark"] .form-switch .form-check-input:not(:checked),
html[data-bs-theme="dark"] input.form-check-input[role="switch"]:not(:checked),
html[data-bs-theme="dark"] .form-check .form-check-input[type="checkbox"]:not(:checked) {
  --bs-form-check-bg: #2e3a4b !important;
  background-color: #2e3a4b !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
}

/* ===== Language picker setting.html (.lang-select*) — style inline trong setting.html (light) ===== */
[data-bs-theme="dark"] .lang-select-toggle {
  background: #1b2433 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .lang-select-toggle:hover { border-color: rgba(255, 255, 255, 0.25) !important; }
[data-bs-theme="dark"] .lang-select-toggle::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394a3b8'%3E%3Cpath d='M12 15.5l-6-6h12l-6 6z'/%3E%3C/svg%3E") !important;
}
[data-bs-theme="dark"] .lang-select-menu {
  background: #232e3d !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
[data-bs-theme="dark"] .lang-select-option { color: #cbd5e1 !important; }
[data-bs-theme="dark"] .lang-select-option:hover { background: #2e3a4b !important; color: #ffffff !important; }
[data-bs-theme="dark"] .lang-select-option.selected { color: #a5b4fc !important; }

/* ===== View Camp (camp-*) + Date Range Picker (drp-*/date-range-picker) — tkqc.js ===== */
/* Loading overlay chiến dịch/nhóm QC/QC + pixel (inline white #fff .95-.98) */
[data-bs-theme="dark"] #camp-loading-overlay,
[data-bs-theme="dark"] #px-loading-overlay { background: rgba(27, 36, 51, 0.96) !important; }
[data-bs-theme="dark"] #camp-loading-overlay strong,
[data-bs-theme="dark"] #px-loading-overlay strong { color: #cbd5e1 !important; }
/* Camp toolbar / tabs */
[data-bs-theme="dark"] .camp-tools-btn {
  background: #2e3a4b !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .camp-tab-label { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .camp-tab-btn.active .camp-tab-label,
[data-bs-theme="dark"] .camp-tab-btn:hover .camp-tab-label { color: #ffffff !important; }
[data-bs-theme="dark"] #dateFilterLabel.btn-label { color: #cbd5e1 !important; }
/* Date range picker */
[data-bs-theme="dark"] .date-range-picker {
  background: #232e3d !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .drp-presets,
[data-bs-theme="dark"] .drp-footer {
  background: #1b2433 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}
[data-bs-theme="dark"] .drp-preset,
[data-bs-theme="dark"] .drp-nav-btn,
[data-bs-theme="dark"] .drp-day { color: #cbd5e1 !important; }
[data-bs-theme="dark"] .drp-preset:hover,
[data-bs-theme="dark"] .drp-nav-btn:hover,
[data-bs-theme="dark"] .drp-day:hover { background: #2e3a4b !important; }
[data-bs-theme="dark"] .drp-preset.active { background: rgba(var(--primary-rgb, 99, 102, 241), 0.2) !important; color: #a5b4fc !important; }
[data-bs-theme="dark"] .drp-day.selected,
[data-bs-theme="dark"] .drp-day.in-range,
[data-bs-theme="dark"] .drp-day.range-start,
[data-bs-theme="dark"] .drp-day.range-end { background: rgba(var(--primary-rgb, 99, 102, 241), 0.25) !important; color: #ffffff !important; }
[data-bs-theme="dark"] .drp-day.muted,
[data-bs-theme="dark"] .drp-day.disabled,
[data-bs-theme="dark"] .drp-day.other-month { color: #475569 !important; }
[data-bs-theme="dark"] .drp-cselect-btn,
[data-bs-theme="dark"] .drp-cselect-list {
  background: #2e3a4b !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .drp-cselect-item { color: #cbd5e1 !important; }
[data-bs-theme="dark"] .drp-cselect-item:hover { background: rgba(var(--primary-rgb, 99, 102, 241), 0.16) !important; color: #ffffff !important; }
[data-bs-theme="dark"] .drp-range-text { color: #a5b4fc !important; }
[data-bs-theme="dark"] .drp-weekday,
[data-bs-theme="dark"] .drp-month-label,
[data-bs-theme="dark"] .drp-cal-title,
[data-bs-theme="dark"] .drp-cselect-label { color: #94a3b8 !important; }

/* ===== Empty-state grid (fx-grid-empty*) — "Chưa có dữ liệu" ===== */
[data-bs-theme="dark"] .fx-grid-empty-title { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .fx-grid-empty-ic {
  background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.16) !important;
  color: #c4b5fd !important;
  box-shadow: none !important;
}
[data-bs-theme="dark"] .fx-grid-empty-ic--fb {
  background: rgba(59, 130, 246, 0.16) !important;
  color: #60a5fa !important;
}

/* ===== Modal Tùy chỉnh cột (cc-*) — style.css + tkqc.js ===== */
[data-bs-theme="dark"] .cc-overlay { background: rgba(0, 0, 0, 0.6) !important; }
[data-bs-theme="dark"] .cc-modal,
[data-bs-theme="dark"] .cc-header,
[data-bs-theme="dark"] .cc-close,
[data-bs-theme="dark"] .cc-col-row,
[data-bs-theme="dark"] .cc-preset-dd,
[data-bs-theme="dark"] .cc-preset-menu {
  background: #232e3d !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .cc-sidebar,
[data-bs-theme="dark"] .cc-footer,
[data-bs-theme="dark"] .cc-pill-locked,
[data-bs-theme="dark"] .cc-selected-list {
  background: #1b2433 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}
/* Header nhóm (THÔNG TIN/PHÂN PHỐI...) — gốc trong suốt chỉ chữ xám, KHÔNG box */
[data-bs-theme="dark"] .cc-group-label {
  background: transparent !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}
[data-bs-theme="dark"] .cc-search,
[data-bs-theme="dark"] .cc-search-wrap input {
  background: #1b2433 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .cc-search::placeholder { color: #94a3b8 !important; }
[data-bs-theme="dark"] .cc-selected-pill,
[data-bs-theme="dark"] .cc-preset-trigger,
[data-bs-theme="dark"] .cc-preset-item,
[data-bs-theme="dark"] .cc-btn-cancel {
  background: #2e3a4b !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .cc-title,
[data-bs-theme="dark"] .cc-pill-name,
[data-bs-theme="dark"] .cc-col-row { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .cc-sidebar-item,
[data-bs-theme="dark"] .cc-group-label,
[data-bs-theme="dark"] .cc-empty,
[data-bs-theme="dark"] .cc-search-icon,
[data-bs-theme="dark"] .cc-pill-remove { color: #94a3b8 !important; }
[data-bs-theme="dark"] .cc-sidebar-item:hover,
[data-bs-theme="dark"] .cc-col-row:hover,
[data-bs-theme="dark"] .cc-preset-item:hover,
[data-bs-theme="dark"] .cc-close:hover { background: #2e3a4b !important; color: #e2e8f0 !important; }
[data-bs-theme="dark"] .cc-sidebar-item.cc-sidebar-active,
[data-bs-theme="dark"] .cc-preset-active {
  background: rgba(var(--primary-rgb, 99, 102, 241), 0.16) !important;
  color: #a5b4fc !important;
  border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.4) !important;
}
[data-bs-theme="dark"] .cc-col-locked,
[data-bs-theme="dark"] .cc-pill-locked { color: #94a3b8 !important; }
/* Label tên cột (.cc-col-row span #1e293b đen) → sáng; cột locked xám nhạt */
[data-bs-theme="dark"] .cc-col-row span { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .cc-col-row.cc-col-locked span { color: #94a3b8 !important; }
/* "Đã chọn N cột" — số đếm strong (#0f172a đen) → sáng */
[data-bs-theme="dark"] .cc-right-head { color: #94a3b8 !important; }
[data-bs-theme="dark"] .cc-right-head strong { color: #e2e8f0 !important; }

/* ===== Popup Kho tính năng (store-* — ads/bm/clone/page.html, inline + <style>) ===== */
[data-bs-theme="dark"] .swal2-popup.store-popup,
[data-bs-theme="dark"] .store-popup { background: #232e3d !important; }
[data-bs-theme="dark"] .store-tab:not(.active) {
  background: #2e3a4b !important;
  color: #cbd5e1 !important;
}
[data-bs-theme="dark"] .store-tab { border-left-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .store-close-btn {
  background: #2e3a4b !important;
  color: #cbd5e1 !important;
}
[data-bs-theme="dark"] .store-close-btn:hover { color: #ffffff !important; }
[data-bs-theme="dark"] #storeSearch {
  background: #1b2433 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #e2e8f0 !important;
}
[data-bs-theme="dark"] #storeSearch::placeholder { color: #94a3b8 !important; }
/* Viền hộp nhóm tab + search (#e5e7eb inline) — scope trong store popup */
[data-bs-theme="dark"] .swal2-popup.store-popup [style*="solid #e5e7eb"] {
  border-color: rgba(255, 255, 255, 0.12) !important;
}
/* Thẻ tính năng trong store (buildStoreHtml: inline background:#fff, KHÔNG class) */
[data-bs-theme="dark"] #storeGrid > div > div,
[data-bs-theme="dark"] #storeGrid [style*="background:#fff"] {
  background: #2e3a4b !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: none !important;
}
[data-bs-theme="dark"] #storeGrid [style*="color:#1a1a1a"] { color: #e2e8f0 !important; }
[data-bs-theme="dark"] #storeGrid [style*="color:#6b7280"] { color: #94a3b8 !important; }

/* ============================================================
   DARK MODE — TRANG CHỦ (HOME) đầy đủ (workflow sweep):
   nh-* dashboard, vt-* timeline, tx-* giao dịch, fbs-* phiên FB, nt-* note, pkg-* gaps.
   ============================================================ */
[data-bs-theme="dark"] .nh-hero,
[data-bs-theme="dark"] .nh-stat,
[data-bs-theme="dark"] .nh-card,
[data-bs-theme="dark"] .tx-filter,
[data-bs-theme="dark"] .tx-table-card,
[data-bs-theme="dark"] .fbs-pagination,
[data-bs-theme="dark"] .nt-item {
  background: #232e3d !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
[data-bs-theme="dark"] .nh-stat:hover { border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.4) !important; }
[data-bs-theme="dark"] .tx-filter { color: #94a3b8 !important; }
[data-bs-theme="dark"] .tx-filter:hover { border-color: var(--primary-start, #6366f1) !important; color: #c4b5fd !important; }
[data-bs-theme="dark"] .nh-card-head,
[data-bs-theme="dark"] .tx-table-card > .mt-card-head,
[data-bs-theme="dark"] .pkg-summary-card > .mt-card-head,
[data-bs-theme="dark"] .pkg-promo-card > .mt-card-head,
[data-bs-theme="dark"] .nt-share-head { border-bottom-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .nh-hero-foot { border-top-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .pkg-sum-divider { border-top-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .fbs-table-wrap { border-top-color: rgba(255, 255, 255, 0.1) !important; }
/* Text sáng */
[data-bs-theme="dark"] .nh-name,
[data-bs-theme="dark"] .nh-tile-value,
[data-bs-theme="dark"] .nh-stat-value,
[data-bs-theme="dark"] .nh-license-days-num,
[data-bs-theme="dark"] .nh-license-sessions-val,
[data-bs-theme="dark"] .nh-ac-next strong,
[data-bs-theme="dark"] .nh-ac-label,
[data-bs-theme="dark"] .nh-ac-counter strong,
[data-bs-theme="dark"] .nh-ac-hour-label,
[data-bs-theme="dark"] .nh-card-h5,
[data-bs-theme="dark"] .nh-empty-title,
[data-bs-theme="dark"] .vt-body,
[data-bs-theme="dark"] .tx-title,
[data-bs-theme="dark"] .tx-table tbody td,
[data-bs-theme="dark"] .fbs-title,
[data-bs-theme="dark"] .fbs-table tbody td,
[data-bs-theme="dark"] .nt-title,
[data-bs-theme="dark"] .nt-item-title,
[data-bs-theme="dark"] .pkg-duration-lbl,
[data-bs-theme="dark"] .pkg-sum-row strong { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .pkg-sum-balance strong { color: #34d399 !important; }
/* Text mờ */
[data-bs-theme="dark"] .nh-section-label,
[data-bs-theme="dark"] .nh-email,
[data-bs-theme="dark"] .nh-email i,
[data-bs-theme="dark"] .nh-tile-label,
[data-bs-theme="dark"] .nh-foot-status,
[data-bs-theme="dark"] .nh-foot-sync,
[data-bs-theme="dark"] .nh-stat-label,
[data-bs-theme="dark"] .nh-license-days-lbl,
[data-bs-theme="dark"] .nh-license-sessions-row,
[data-bs-theme="dark"] .nh-ac-next,
[data-bs-theme="dark"] .nh-ac-counter,
[data-bs-theme="dark"] .nh-ac-status,
[data-bs-theme="dark"] .nh-empty-sub,
[data-bs-theme="dark"] .vt-date,
[data-bs-theme="dark"] .tx-subtitle,
[data-bs-theme="dark"] .tx-balance-before,
[data-bs-theme="dark"] .tx-desc,
[data-bs-theme="dark"] .tx-time,
[data-bs-theme="dark"] .tx-empty,
[data-bs-theme="dark"] .tx-empty p,
[data-bs-theme="dark"] .fbs-subtitle,
[data-bs-theme="dark"] .fbs-cell-muted,
[data-bs-theme="dark"] .fbs-time,
[data-bs-theme="dark"] .fbs-empty,
[data-bs-theme="dark"] .fbs-empty-text,
[data-bs-theme="dark"] .fbs-page-info,
[data-bs-theme="dark"] .nt-subtitle,
[data-bs-theme="dark"] .nt-empty,
[data-bs-theme="dark"] .nt-share-sub,
[data-bs-theme="dark"] .pkg-sum-row,
[data-bs-theme="dark"] .pkg-sum-balance { color: #94a3b8 !important; }
[data-bs-theme="dark"] .tx-time i,
[data-bs-theme="dark"] .tx-empty i { color: #64748b !important; }
[data-bs-theme="dark"] .nh-section-label::after { background: linear-gradient(90deg, rgba(255, 255, 255, 0.12), transparent) !important; }
[data-bs-theme="dark"] .nh-uid { background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.16) !important; color: #c4b5fd !important; border-color: rgba(var(--primary-end-rgb, 139, 92, 246), 0.3) !important; }
[data-bs-theme="dark"] .nh-tile { background: rgba(var(--primary-rgb, 99, 102, 241), 0.1) !important; border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.2) !important; }
[data-bs-theme="dark"] .nh-tile:hover { background: rgba(var(--primary-rgb, 99, 102, 241), 0.16) !important; border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.32) !important; }
[data-bs-theme="dark"] .nh-tile-icon { background: #2e3a4b !important; }
[data-bs-theme="dark"] .nh-stat-trend { color: #94a3b8 !important; background: #1b2433 !important; }
[data-bs-theme="dark"] .nh-license-bar { background: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .nh-ac-tabs { background: #1b2433 !important; }
[data-bs-theme="dark"] .nh-ac-tab { color: #94a3b8 !important; }
[data-bs-theme="dark"] .nh-ac-tab:hover { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .nh-ac-tab.is-active { background: #2e3a4b !important; color: #c4b5fd !important; }
[data-bs-theme="dark"] .nh-ac-tab-badge { background: #2e3a4b !important; color: #94a3b8 !important; }
[data-bs-theme="dark"] .nh-ac-tab.is-active .nh-ac-tab-badge { background: rgba(var(--primary-rgb, 99, 102, 241), 0.2) !important; color: #c4b5fd !important; }
[data-bs-theme="dark"] .nh-ac-textarea { background: #1b2433 !important; color: #e2e8f0 !important; border-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .nh-ac-textarea:focus { background: #232e3d !important; border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.5) !important; }
[data-bs-theme="dark"] .nh-ac-hour-select { background-color: #2e3a4b !important; color: #e2e8f0 !important; border-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .nh-card-history .nh-card-icon { background: rgba(148, 163, 184, 0.16) !important; color: #94a3b8 !important; }
[data-bs-theme="dark"] .nh-empty-ico { background: linear-gradient(135deg, #2e3a4b, #1b2433) !important; }
[data-bs-theme="dark"] .nh-empty-ico i { color: #94a3b8 !important; }
[data-bs-theme="dark"] .nh-tops .nh-card-body::-webkit-scrollbar-thumb,
[data-bs-theme="dark"] .versions-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16) !important; }
/* Timeline vt-* */
[data-bs-theme="dark"] .version-timeline::before { background: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .vt-dot { background: #475569 !important; border-color: #232e3d !important; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .vt-latest .vt-dot { background: #10b981 !important; box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2) !important; }
[data-bs-theme="dark"] .vt-content { background: #1b2433 !important; border-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .vt-latest .vt-content { background: rgba(16, 185, 129, 0.1) !important; border-color: rgba(16, 185, 129, 0.16) !important; }
[data-bs-theme="dark"] .vt-item:hover .vt-content { background: #2e3a4b !important; }
[data-bs-theme="dark"] .vt-latest:hover .vt-content { background: rgba(16, 185, 129, 0.14) !important; }
[data-bs-theme="dark"] .vt-badge { background: #2e3a4b !important; color: #94a3b8 !important; }
/* Giao dịch tx-* + bảng */
[data-bs-theme="dark"] .tx-table thead th,
[data-bs-theme="dark"] .fbs-table thead th { color: #94a3b8 !important; background: #1b2433 !important; border-bottom-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .tx-table tbody td,
[data-bs-theme="dark"] .fbs-table tbody td { border-bottom-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .tx-table tbody tr:hover td,
[data-bs-theme="dark"] .fbs-table tbody tr:hover td { background: #2e3a4b !important; }
[data-bs-theme="dark"] .tx-type-pill.is-deposit { background: rgba(16, 185, 129, 0.16) !important; color: #6ee7b7 !important; }
[data-bs-theme="dark"] .tx-type-pill.is-buy_package { background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.16) !important; color: #c4b5fd !important; }
[data-bs-theme="dark"] .tx-type-pill.is-buy_feature { background: rgba(59, 130, 246, 0.15) !important; color: #93c5fd !important; }
[data-bs-theme="dark"] .tx-type-pill.is-adjust { background: rgba(245, 158, 11, 0.16) !important; color: #fcd34d !important; }
[data-bs-theme="dark"] .tx-type-pill.is-refund { background: rgba(6, 182, 212, 0.16) !important; color: #67e8f9 !important; }
/* Phiên FB fbs-* */
[data-bs-theme="dark"] .fbs-quota { background: rgba(245, 158, 11, 0.16) !important; color: #fcd34d !important; border-color: rgba(245, 158, 11, 0.3) !important; }
[data-bs-theme="dark"] .fbs-quota.fbs-quota-danger { background: rgba(220, 38, 38, 0.18) !important; color: #fca5a5 !important; border-color: rgba(220, 38, 38, 0.3) !important; }
[data-bs-theme="dark"] .fbs-quota.fbs-quota-success { background: rgba(16, 185, 129, 0.16) !important; color: #6ee7b7 !important; border-color: rgba(16, 185, 129, 0.3) !important; }
[data-bs-theme="dark"] .fbs-btn-delete { color: #fca5a5 !important; background: rgba(220, 38, 38, 0.12) !important; border-color: rgba(220, 38, 38, 0.3) !important; }
[data-bs-theme="dark"] .fbs-btn-delete:hover { background: rgba(220, 38, 38, 0.22) !important; border-color: rgba(220, 38, 38, 0.45) !important; }
[data-bs-theme="dark"] .fbs-page-btn { border-color: rgba(255, 255, 255, 0.1) !important; background: #2e3a4b !important; color: #94a3b8 !important; }
[data-bs-theme="dark"] .fbs-page-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.06) !important; border-color: rgba(255, 255, 255, 0.18) !important; }
/* Note nt-* */
[data-bs-theme="dark"] .nt-btn-cancel { color: #94a3b8 !important; border-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .nt-btn-cancel:hover { background: #2e3a4b !important; }
[data-bs-theme="dark"] .nt-textarea { background: #1b2433 !important; color: #e2e8f0 !important; border-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .nt-search-row input { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .nt-item.active { background: rgba(245, 158, 11, 0.16) !important; border-color: rgba(245, 158, 11, 0.5) !important; }
[data-bs-theme="dark"] .nt-edit-badge { background: rgba(245, 158, 11, 0.16) !important; color: #fcd34d !important; }
[data-bs-theme="dark"] .nt-item-preview { background: #1b2433 !important; color: #94a3b8 !important; }
[data-bs-theme="dark"] .nt-share-title { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .nt-share-row { border-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .nt-share-row input { color: #e2e8f0 !important; background: #1b2433 !important; }
[data-bs-theme="dark"] .nt-share-btn { border-left-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .nt-share-btn-open { background: #2e3a4b !important; color: #94a3b8 !important; }
[data-bs-theme="dark"] .nt-share-btn-open:hover { background: rgba(255, 255, 255, 0.08) !important; color: #e2e8f0 !important; }
/* Gói pkg-* gaps */
[data-bs-theme="dark"] .pkg-sum-discount { color: #34d399 !important; }
[data-bs-theme="dark"] .pkg-sum-total { background: linear-gradient(135deg, rgba(var(--primary-rgb, 99, 102, 241), 0.18), rgba(var(--primary-end-rgb, 139, 92, 246), 0.12)) !important; border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.3) !important; }
[data-bs-theme="dark"] .pkg-sum-total span { color: #c7d2fe !important; }
[data-bs-theme="dark"] .pkg-card-sessions { background: transparent !important; color: #6ee7b7 !important; }
[data-bs-theme="dark"] .pkg-card-sessions i { color: #6ee7b7 !important; }
[data-bs-theme="dark"] .pkg-promo-input { background: #1b2433 !important; border-color: rgba(255, 255, 255, 0.1) !important; color: #e2e8f0 !important; }
[data-bs-theme="dark"] .pkg-promo-input::placeholder { color: #64748b !important; }
[data-bs-theme="dark"] .pkg-promo-input:focus { border-color: var(--primary-start, #6366f1) !important; }
[data-bs-theme="dark"] .pkg-promo-msg.is-success { background: rgba(16, 185, 129, 0.16) !important; color: #6ee7b7 !important; border-color: rgba(16, 185, 129, 0.3) !important; }

/* ===================================================================
   DARK MODE — HOME (index.html) đợt 2: gộp 4 block
   Phủ 5 prefix CHƯA có rule dark: cf- (Check live) · tfa- (Lấy 2FA)
   · ac- (Auto check) · sup- (Hỗ trợ) · st- (Cài đặt / kết nối Zalo).
   Palette: surface #fff→#232e3d · elevated (sub/menu/control trắng)→#2e3a4b
   · input/xám (#f8fafc/#fafafb/#f9fafb)→#1b2433 · chữ đen→#e2e8f0
   · chữ xám→#94a3b8 · border sáng→rgba(255,255,255,.1). Brand gradient,
   Zalo blue (#0068ff) và pill/nút màu GIỮ hue, chỉ đổi tint tối.
   GIỮ trắng (KHÔNG override): .dep-qr-wrap .qd-usdt-qr .avatar-letter
   .fiox-color-badge.
   =================================================================== */

/* ===== CHECK LIVE (cf-*) ===== */
[data-bs-theme="dark"] .cf-title { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .cf-subtitle,
[data-bs-theme="dark"] .cf-progress-row { color: #94a3b8 !important; }
[data-bs-theme="dark"] .cf-progress-percent { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .cf-textarea {
  background: #1b2433 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .cf-textarea[readonly] { background: #232e3d !important; }
[data-bs-theme="dark"] .cf-progress-bar { background: #1b2433 !important; }
/* Pill: nền trắng → elevated tối, giữ chữ màu */
[data-bs-theme="dark"] .cf-pill {
  background: #2e3a4b !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #94a3b8 !important;
}
[data-bs-theme="dark"] .cf-pill:hover:not(:disabled) { background: #2d3b52 !important; }
[data-bs-theme="dark"] .cf-pill-indigo { background: rgba(var(--primary-rgb, 99, 102, 241), 0.16) !important; color: #a5b4fc !important; border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.4) !important; }
[data-bs-theme="dark"] .cf-pill-indigo:hover { background: rgba(var(--primary-rgb, 99, 102, 241), 0.24) !important; }
[data-bs-theme="dark"] .cf-pill-amber { background: rgba(245, 158, 11, 0.16) !important; color: #fcd34d !important; border-color: rgba(245, 158, 11, 0.4) !important; }
[data-bs-theme="dark"] .cf-pill-amber:hover { background: rgba(245, 158, 11, 0.24) !important; }
[data-bs-theme="dark"] .cf-pill-green { background: rgba(16, 185, 129, 0.16) !important; color: #6ee7b7 !important; border-color: rgba(16, 185, 129, 0.4) !important; }
[data-bs-theme="dark"] .cf-pill-green:hover { background: rgba(16, 185, 129, 0.24) !important; }
[data-bs-theme="dark"] .cf-pill-purple { background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.16) !important; color: #c4b5fd !important; border-color: rgba(var(--primary-end-rgb, 139, 92, 246), 0.4) !important; }
[data-bs-theme="dark"] .cf-pill-purple:hover { background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.24) !important; }
[data-bs-theme="dark"] .cf-pill-cyan { background: rgba(6, 182, 212, 0.16) !important; color: #67e8f9 !important; border-color: rgba(14, 165, 233, 0.4) !important; }
[data-bs-theme="dark"] .cf-pill-cyan:hover { background: rgba(6, 182, 212, 0.24) !important; }
[data-bs-theme="dark"] .cf-pill-red { background: rgba(220, 38, 38, 0.18) !important; color: #fca5a5 !important; border-color: rgba(239, 68, 68, 0.4) !important; }
[data-bs-theme="dark"] .cf-pill-red:hover { background: rgba(220, 38, 38, 0.26) !important; }
[data-bs-theme="dark"] .cf-pill-blue { background: rgba(59, 130, 246, 0.15) !important; color: #93c5fd !important; border-color: rgba(59, 130, 246, 0.4) !important; }
[data-bs-theme="dark"] .cf-pill-blue:hover { background: rgba(59, 130, 246, 0.24) !important; }

/* ===== LẤY 2FA (tfa-*) ===== */
[data-bs-theme="dark"] .tfa-title,
[data-bs-theme="dark"] .tfa-code { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .tfa-subtitle,
[data-bs-theme="dark"] .tfa-secret,
[data-bs-theme="dark"] .tfa-empty { color: #94a3b8 !important; }
[data-bs-theme="dark"] .tfa-timer-text { color: #cbd5e1 !important; }
[data-bs-theme="dark"] .tfa-timer-row > i { color: #94a3b8 !important; }
[data-bs-theme="dark"] .tfa-timer-bar { background: #1b2433 !important; }
[data-bs-theme="dark"] .tfa-input {
  background: #1b2433 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .tfa-input::placeholder { color: #64748b !important; }
/* Item: nền xám sáng (#f8fafc) → input tối */
[data-bs-theme="dark"] .tfa-item {
  background: #1b2433 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
[data-bs-theme="dark"] .tfa-item:hover { border-color: rgba(255, 255, 255, 0.2) !important; }
[data-bs-theme="dark"] .tfa-item-saved {
  background: rgba(245, 158, 11, 0.1) !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
}
[data-bs-theme="dark"] .tfa-item-saved:hover { border-color: rgba(245, 158, 11, 0.5) !important; }
[data-bs-theme="dark"] .tfa-saved-label { color: #fcd34d !important; }
/* Nút hành động: nền trắng → tint tối, giữ chữ màu */
[data-bs-theme="dark"] .tfa-act-btn { background: #2e3a4b !important; }
[data-bs-theme="dark"] .tfa-act-save { background: rgba(16, 185, 129, 0.16) !important; color: #6ee7b7 !important; border-color: rgba(16, 185, 129, 0.4) !important; }
[data-bs-theme="dark"] .tfa-act-save:hover { background: rgba(16, 185, 129, 0.24) !important; }
[data-bs-theme="dark"] .tfa-act-edit { background: rgba(245, 158, 11, 0.16) !important; color: #fcd34d !important; border-color: rgba(245, 158, 11, 0.4) !important; }
[data-bs-theme="dark"] .tfa-act-edit:hover { background: rgba(245, 158, 11, 0.24) !important; }
[data-bs-theme="dark"] .tfa-act-del { background: rgba(220, 38, 38, 0.18) !important; color: #fca5a5 !important; border-color: rgba(239, 68, 68, 0.4) !important; }
[data-bs-theme="dark"] .tfa-act-del:hover { background: rgba(220, 38, 38, 0.26) !important; }

/* ===== AUTO CHECK (ac-*) ===== */
[data-bs-theme="dark"] .ac-title { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .ac-card,
[data-bs-theme="dark"] .ac-zalo-gate {
  background: #232e3d !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
[data-bs-theme="dark"] .ac-card-head { border-bottom-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .ac-card .nh-ac-foot { border-top-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .ac-head-divider { background: rgba(255, 255, 255, 0.12) !important; }
/* Ô giờ/phút + control nền trắng → elevated */
[data-bs-theme="dark"] .ac-hour-box {
  background: #2e3a4b !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
[data-bs-theme="dark"] .ac-hour-box .ac-hm-sep { color: #cbd5e1 !important; }
[data-bs-theme="dark"] .ac-hm-pick { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .ac-hm-pick:hover { background: rgba(var(--primary-rgb, 99, 102, 241), 0.16) !important; }
[data-bs-theme="dark"] .ac-hm-pick.is-open { background: rgba(var(--primary-rgb, 99, 102, 241), 0.22) !important; color: #c4b5fd !important; }
[data-bs-theme="dark"] .ac-hm-caret { color: #94a3b8 !important; }
[data-bs-theme="dark"] .ac-hm-menu {
  background: #232e3d !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
[data-bs-theme="dark"] .ac-hm-opt { color: #94a3b8 !important; }
[data-bs-theme="dark"] .ac-hm-opt:hover { background: rgba(var(--primary-rgb, 99, 102, 241), 0.16) !important; color: #c4b5fd !important; }
[data-bs-theme="dark"] .ac-hm-opt.is-active { color: #c4b5fd !important; }
/* Chip Danh mục — giữ tint tím */
[data-bs-theme="dark"] .ac-cat-chip {
  background: rgba(var(--primary-rgb, 99, 102, 241), 0.12) !important;
  border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.3) !important;
  color: #c4b5fd !important;
}
[data-bs-theme="dark"] .ac-cat-chip:hover { background: rgba(var(--primary-rgb, 99, 102, 241), 0.18) !important; border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.4) !important; }
[data-bs-theme="dark"] .ac-cat-chip-value { color: #c4b5fd !important; }
[data-bs-theme="dark"] .ac-cat-chip-menu {
  background: #232e3d !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
[data-bs-theme="dark"] .ac-cat-opt { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .ac-cat-opt:hover { background: rgba(var(--primary-rgb, 99, 102, 241), 0.16) !important; color: #c4b5fd !important; }
[data-bs-theme="dark"] .ac-cat-opt.is-active { color: #c4b5fd !important; }
[data-bs-theme="dark"] .ac-cat-opt-count { background: #1b2433 !important; color: #94a3b8 !important; }
[data-bs-theme="dark"] .ac-cat-opt:hover .ac-cat-opt-count,
[data-bs-theme="dark"] .ac-cat-opt.is-active .ac-cat-opt-count { background: rgba(var(--primary-rgb, 99, 102, 241), 0.2) !important; color: #a5b4fc !important; }
/* Nút header Lọc / Nhập — nền trắng → elevated */
[data-bs-theme="dark"] .ac-hbtn {
  background: #2e3a4b !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #cbd5e1 !important;
}
[data-bs-theme="dark"] .ac-hbtn:hover { background: #2d3b52 !important; border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.4) !important; }
[data-bs-theme="dark"] .ac-hbtn.is-open { background: rgba(var(--primary-rgb, 99, 102, 241), 0.14) !important; border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.5) !important; }
[data-bs-theme="dark"] .ac-hbtn > i { color: #94a3b8 !important; }
[data-bs-theme="dark"] .ac-hbtn.is-open > i { color: #a5b4fc !important; }
[data-bs-theme="dark"] .ac-hbtn-menu {
  background: #232e3d !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
[data-bs-theme="dark"] .ac-filter-opt { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .ac-filter-opt:hover { background: rgba(var(--primary-rgb, 99, 102, 241), 0.16) !important; }
/* Search box — nền trắng → elevated */
[data-bs-theme="dark"] .ac-search {
  background: #2e3a4b !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
[data-bs-theme="dark"] .ac-search:focus-within { background: #2e3a4b !important; border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.5) !important; }
[data-bs-theme="dark"] .ac-search-ico { color: #94a3b8 !important; }
[data-bs-theme="dark"] .ac-search:focus-within .ac-search-ico { color: #a5b4fc !important; }
[data-bs-theme="dark"] .ac-search-input { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .ac-search-input::placeholder { color: #64748b !important; }
/* Nút sm danger */
[data-bs-theme="dark"] .ac-btn-danger { background: rgba(220, 38, 38, 0.18) !important; color: #fca5a5 !important; border-color: rgba(239, 68, 68, 0.4) !important; }
[data-bs-theme="dark"] .ac-btn-danger:not(:disabled):hover { background: rgba(220, 38, 38, 0.28) !important; }
/* Footer thống kê — nhóm nền trắng → elevated + chữ đen/xám */
[data-bs-theme="dark"] .ac-stats-grp {
  background: #2e3a4b !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
[data-bs-theme="dark"] .ac-stat-item { color: #e2e8f0 !important; border-right-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .ac-stat-item strong { color: #94a3b8 !important; }
/* Gate Zalo — card nền trắng (giữ Zalo blue #0068ff cho brand) */
[data-bs-theme="dark"] .ac-zalo-gate-title { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .ac-zalo-gate-desc,
[data-bs-theme="dark"] .ac-zalo-countdown { color: #94a3b8 !important; }
[data-bs-theme="dark"] .ac-zalo-countdown strong { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .ac-zalo-gate-icon { background: rgba(0, 104, 255, 0.18) !important; }
[data-bs-theme="dark"] .ac-zalo-gate-btn-ghost { color: #cbd5e1 !important; border-color: rgba(255, 255, 255, 0.12) !important; }
[data-bs-theme="dark"] .ac-zalo-gate-btn-ghost:hover { background: #2e3a4b !important; color: #e2e8f0 !important; }
[data-bs-theme="dark"] .ac-zalo-code-box { background: rgba(0, 104, 255, 0.12) !important; border-color: rgba(0, 104, 255, 0.45) !important; }
[data-bs-theme="dark"] .ac-zalo-code-box:hover { background: rgba(0, 104, 255, 0.2) !important; }
/* Empty grid + cell ID đậm */
[data-bs-theme="dark"] .ac-grid-empty,
[data-bs-theme="dark"] .ac-grid-empty p { color: #94a3b8 !important; }
[data-bs-theme="dark"] .ac-grid-empty i { color: #475569 !important; }
[data-bs-theme="dark"] .ac-aggrid .ac-cell-id { color: #e2e8f0 !important; }

/* .sup-* dark: đã gộp xuống block "HỖ TRỢ (sup-*) — dark mode (redesign)" bên dưới */

/* ===== CÀI ĐẶT / KẾT NỐI ZALO (st-*) ===== */
[data-bs-theme="dark"] .st-card,
[data-bs-theme="dark"] .st-action-bar {
  background: #232e3d !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
[data-bs-theme="dark"] .st-card:hover { border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.32) !important; }
[data-bs-theme="dark"] .st-card-head { background: #2e3a4b !important; border-bottom-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .st-card-title,
[data-bs-theme="dark"] .st-card b,
[data-bs-theme="dark"] .st-card span,
[data-bs-theme="dark"] .st-zalo-step { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .st-card-desc,
[data-bs-theme="dark"] .st-zalo-desc { color: #94a3b8 !important; }
/* Icon card head pastel — giữ hue */
[data-bs-theme="dark"] .st-card-head-icon-zalo { background: rgba(59, 130, 246, 0.16) !important; }
[data-bs-theme="dark"] .st-card-head-icon-purple { background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.16) !important; color: #c4b5fd !important; }
/* Pill trạng thái — nền/border sáng → tint tối */
[data-bs-theme="dark"] .st-zalo-status-checking { background: #1b2433 !important; color: #94a3b8 !important; border-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .st-zalo-status-connected { background: rgba(16, 185, 129, 0.16) !important; color: #6ee7b7 !important; border-color: rgba(16, 185, 129, 0.3) !important; }
[data-bs-theme="dark"] .st-zalo-status-pending { background: rgba(245, 158, 11, 0.16) !important; color: #fcd34d !important; border-color: rgba(245, 158, 11, 0.3) !important; }
/* Skeleton bar shimmer — dải tối */
[data-bs-theme="dark"] .st-skel-bar { background: linear-gradient(90deg, #1b2433 0%, #2e3a4b 50%, #1b2433 100%) !important; background-size: 200% 100% !important; }
/* Code box dashed + nút copy nền trắng → tint indigo */
[data-bs-theme="dark"] .st-zalo-code-box { background: rgba(var(--primary-rgb, 99, 102, 241), 0.1) !important; border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.4) !important; }
[data-bs-theme="dark"] .st-zalo-code { color: #a5b4fc !important; }
[data-bs-theme="dark"] .st-zalo-copy { background: #2e3a4b !important; color: #a5b4fc !important; border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.4) !important; }
[data-bs-theme="dark"] .st-zalo-copy:hover { background: var(--primary-start, #6366f1) !important; color: #fff !important; }
[data-bs-theme="dark"] .st-zalo-expire { color: #fcd34d !important; }
/* Connected state — green tint tối */
[data-bs-theme="dark"] .st-zalo-connected { background: rgba(16, 185, 129, 0.12) !important; border-color: rgba(16, 185, 129, 0.3) !important; }
[data-bs-theme="dark"] .st-zalo-connected-name { color: #6ee7b7 !important; }
[data-bs-theme="dark"] .st-zalo-connected-sub { color: #34d399 !important; }
/* Nút danger nền trắng / pastel → tint đỏ tối */
[data-bs-theme="dark"] .st-btn-danger,
[data-bs-theme="dark"] .st-btn-outline-danger { background: rgba(220, 38, 38, 0.18) !important; color: #fca5a5 !important; border-color: rgba(239, 68, 68, 0.4) !important; }
[data-bs-theme="dark"] .st-btn-danger:hover,
[data-bs-theme="dark"] .st-btn-outline-danger:hover { background: rgba(220, 38, 38, 0.28) !important; }
[data-bs-theme="dark"] .pkg-promo-msg.is-error { background: rgba(220, 38, 38, 0.18) !important; color: #fca5a5 !important; border-color: rgba(220, 38, 38, 0.35) !important; }

/* Logout swal (via.js menu Đăng xuất FB/tài khoản) — inline color đen/xám trong swal */
[data-bs-theme="dark"] .swal2-html-container [style*="color:#0f172a"],
[data-bs-theme="dark"] .swal2-html-container [style*="color: #0f172a"],
[data-bs-theme="dark"] .swal2-html-container [style*="color:#1a1a1a"],
[data-bs-theme="dark"] .swal2-html-container [style*="color:#1f2937"],
[data-bs-theme="dark"] .swal2-html-container [style*="color:#111827"] { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .swal2-html-container [style*="color:#475569"],
[data-bs-theme="dark"] .swal2-html-container [style*="color:#64748b"],
[data-bs-theme="dark"] .swal2-html-container [style*="color:#6b7280"] { color: #94a3b8 !important; }

/* Header panel "Chức năng" — đường kẻ trên + chiều cao 41.5px (gốc 40px) */
.d-flex.align-items-center.justify-content-between.px-3.py-2 {
  border-top: 1px solid #e5e7eb;
  min-height: 41.5px !important;
  height: 41.5px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* ===== Popup Ghi chú (fxnote-*) — dark (icon + nút Save giữ gradient tím) ===== */
[data-bs-theme="dark"] .fxnote-popup { background: #232e3d !important; }
[data-bs-theme="dark"] .fxnote-title { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .fxnote-field textarea {
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #e2e8f0 !important;
  background: #1b2433 !important;
}
[data-bs-theme="dark"] .fxnote-field textarea:focus {
  border-color: var(--primary-start, #6366f1) !important;
  background: #232e3d !important;
}
[data-bs-theme="dark"] .fxnote-field textarea::placeholder { color: #64748b !important; }
[data-bs-theme="dark"] .fxnote-cancel {
  background: #2e3a4b !important;
  color: #cbd5e1 !important;
}
[data-bs-theme="dark"] .fxnote-cancel:hover { background: #374151 !important; }
[data-bs-theme="dark"] .d-flex.align-items-center.justify-content-between.px-3.py-2 {
  border-top-color: rgba(255, 255, 255, 0.1) !important;
}

/* ===== HIỆU ỨNG BONG BÓNG — biến CSS đồng bộ 1 CHỖ (light + dark).
   Muốn chỉnh (màu glow, độ sáng viền, độ bóng) → sửa các biến dưới đây,
   áp ngay cho MỌI element dùng chúng. ===== */
:root {
  --bubble-rim: rgba(15, 23, 42, 0.16);           /* viền nghỉ — hairline RÕ trên nền sáng */
  --bubble-rim-hover: rgba(var(--primary-rgb, 99, 102, 241), 0.6);     /* viền hover — indigo theo glow */
  --bubble-glow: rgba(var(--primary-rgb, 99, 102, 241), 0.28);         /* glow nghỉ (tím) */
  --bubble-glow-hover: rgba(var(--primary-rgb, 99, 102, 241), 0.55);   /* glow hover */
  --bubble-gloss: rgba(255, 255, 255, 0.7);        /* ánh đỉnh nghỉ */
  --bubble-gloss-hover: rgba(255, 255, 255, 0.9);  /* ánh đỉnh hover */
  --bubble-drop: rgba(15, 23, 42, 0.08);           /* đổ bóng nền */
}
[data-bs-theme="dark"] {
  --bubble-rim: rgba(255, 255, 255, 0.34);         /* viền nghỉ — hairline trắng RÕ trên nền tối */
  --bubble-rim-hover: rgba(255, 255, 255, 0.6);
  --bubble-glow: rgba(var(--primary-rgb, 99, 102, 241), 0.26);
  --bubble-glow-hover: rgba(var(--primary-rgb, 99, 102, 241), 0.48);
  --bubble-gloss: rgba(255, 255, 255, 0.1);
  --bubble-gloss-hover: rgba(255, 255, 255, 0.16);
  --bubble-drop: rgba(0, 0, 0, 0.3);
}
/* Áp cho TẤT CẢ nút control (toolbar + header + #switchAccount).
   Thêm element khác vào hiệu ứng: chỉ cần copy 3 dòng border/box-shadow/transition. */
.control-btn {
  border: 1px solid var(--bubble-rim) !important;
  box-shadow:
    0 3px 10px -3px var(--bubble-glow),
    0 1px 2px var(--bubble-drop),
    inset 0 1px 1.5px var(--bubble-gloss) !important;
  transition: box-shadow 0.2s ease, transform 0.16s ease, border-color 0.2s ease !important;
}
.control-btn:hover {
  border-color: var(--bubble-rim-hover) !important;
  box-shadow:
    0 7px 20px -3px var(--bubble-glow-hover),
    0 2px 6px var(--bubble-drop),
    inset 0 1px 2px var(--bubble-gloss-hover) !important;
  transform: translateY(-1.5px) !important;
}
.control-btn:active { transform: translateY(0) !important; }

/* ===== Thanh công cụ grid — kiểu "Glossy 3D" (CHỈ trong .tkqc-toolbar, KHÔNG đụng nút header) ===== */
/* Nút thường: khối bóng nổi (gradient trắng→xám nhạt + ánh đỉnh trong + đổ bóng mềm) */
.tkqc-toolbar .control-btn {
  background: linear-gradient(180deg, #ffffff, #eef1f6) !important;
  border: 1px solid #d6dce6 !important;
  color: #3d4757 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 2px 4px rgba(16,24,40,.12) !important;
  transition: background .16s ease, box-shadow .16s ease, transform .12s ease, border-color .16s ease !important;
}
.tkqc-toolbar .control-btn:hover {
  background: linear-gradient(180deg, #ffffff, #e6eaf2) !important;
  border-color: #c7cfdb !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 6px 14px -4px rgba(16,24,40,.2) !important;
  transform: translateY(-1px) !important;
}
.tkqc-toolbar .control-btn:active { transform: translateY(0) !important; box-shadow: inset 0 2px 4px rgba(16,24,40,.14) !important; }
/* Icon 1 tông trung tính (bỏ 7 màu rối), hover ngả accent + khoảng cách icon–chữ ĐỒNG NHẤT
   (đè m-0 của ads lẫn margin 10px của bm/clone/page → luôn 6px) */
.tkqc-toolbar .control-btn i { color: #5a6675 !important; width: auto !important; height: auto !important; margin-right: 6px !important; }
.tkqc-toolbar .control-btn:hover i { color: var(--primary-start, #6366f1) !important; }
/* Nút chính "Bắt đầu" = khối gradient tím→indigo bóng nổi bật */
.tkqc-toolbar #start {
  background: linear-gradient(135deg, var(--primary-end, #8b5cf6), var(--primary-start, #6366f1)) !important;
  border-color: #5b52d6 !important;
  color: #fff !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 4px 12px -2px rgba(var(--primary-end-rgb, 139,92,246), .5) !important;
}
.tkqc-toolbar #start:hover { filter: brightness(1.06); box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 7px 16px -3px rgba(var(--primary-end-rgb, 139,92,246), .6) !important; }
/* Nút "Dừng lại" = khối đỏ bóng */
.tkqc-toolbar #stop {
  background: linear-gradient(180deg, #f87171, #dc2626) !important;
  border-color: #b91c1c !important;
  color: #fff !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 4px 10px -2px rgba(239,68,68,.5) !important;
}
.tkqc-toolbar #stop:hover { filter: brightness(1.05); }
/* Icon trong start/stop = trắng (đè màu/inline cũ) */
.tkqc-toolbar #start i, .tkqc-toolbar #stop i { color: #fff !important; }
/* Ô tìm kiếm khớp phong cách khối bóng */
.tkqc-toolbar .form-control {
  background: linear-gradient(180deg, #ffffff, #eef1f6) !important;
  border: 1px solid #d6dce6 !important;
  box-shadow: inset 0 1px 2px rgba(16,24,40,.05) !important;
}
.tkqc-toolbar .form-control:focus { border-color: var(--primary-end, #8b5cf6) !important; box-shadow: 0 0 0 3px rgba(var(--primary-end-rgb, 139,92,246), .15) !important; }
/* Vạch ngăn nhóm — rõ + NGẮN (chỉ hiện đoạn giữa ~44% chiều cao) */
.tkqc-toolbar .border-end { position: relative; border-right: 0 !important; }
.tkqc-toolbar .border-end::before {
  content: "";
  position: absolute;
  right: 0; top: 50%; transform: translateY(-50%);
  width: 1.5px; height: 20px; border-radius: 2px;
  background: linear-gradient(180deg, transparent, rgba(15,23,42,.42) 14%, rgba(15,23,42,.42) 86%, transparent);
}
/* Thu gọn khoảng cách giữa các nút (me-3/ms-3 16px → 8px) cho bớt xa */
.tkqc-toolbar .me-3 { margin-right: .5rem !important; }
.tkqc-toolbar .ms-3 { margin-left: .5rem !important; }
.tkqc-toolbar .border-end.ms-3.pe-3 { padding-right: .5rem !important; }
/* Đường kẻ bên TRÁI khối tài khoản #userInfo (có sẵn: .border-start, đang full chiều cao)
   → rút ngắn ~44% + gradient mờ 2 đầu cho khớp các vạch ngăn nhóm khác */
.tkqc-toolbar #userInfo .border-start { position: relative; border-left: 0 !important; }
.tkqc-toolbar #userInfo .border-start::before {
  content: "";
  position: absolute;
  left: 0; top: 50%; transform: translateY(-50%);
  width: 1.5px; height: 20px; border-radius: 2px;
  background: linear-gradient(180deg, transparent, rgba(15,23,42,.42) 14%, rgba(15,23,42,.42) 86%, transparent);
}

[data-bs-theme="dark"] .tkqc-toolbar .control-btn {
  background: linear-gradient(180deg, #232d40, #1a2233) !important;
  border-color: #33405a !important;
  color: #cdd5e2 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 2px 5px rgba(0,0,0,.35) !important;
}
[data-bs-theme="dark"] .tkqc-toolbar .control-btn:hover {
  background: linear-gradient(180deg, #26314a, #1c2436) !important;
  border-color: #3d4b66 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 7px 16px -4px rgba(0,0,0,.5) !important;
}
[data-bs-theme="dark"] .tkqc-toolbar .control-btn i { color: #9aa5b8 !important; }
[data-bs-theme="dark"] .tkqc-toolbar .control-btn:hover i { color: #c9b8ff !important; }
[data-bs-theme="dark"] .tkqc-toolbar #start i, [data-bs-theme="dark"] .tkqc-toolbar #stop i { color: #fff !important; }
[data-bs-theme="dark"] .tkqc-toolbar .form-control {
  background: linear-gradient(180deg, #232d40, #1a2233) !important;
  border-color: #33405a !important;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.3) !important;
}
[data-bs-theme="dark"] .tkqc-toolbar .border-end::before {
  background: linear-gradient(180deg, transparent, rgba(255,255,255,.42) 14%, rgba(255,255,255,.42) 86%, transparent);
}
[data-bs-theme="dark"] .tkqc-toolbar #userInfo .border-start::before {
  background: linear-gradient(180deg, transparent, rgba(255,255,255,.42) 14%, rgba(255,255,255,.42) 86%, transparent);
}

/* ===== Nav-pills (#header) — bong bóng rõ + nút ĐANG CHỌN nổi bật hơn ===== */
#header .nav-pills-container a,
#header .rounded.row a {
  border-color: rgba(255, 255, 255, 0.32) !important;
  box-shadow:
    0 3px 10px rgba(var(--primary-rgb, 99, 102, 241), 0.18),
    0 2px 6px rgba(0, 0, 0, 0.12),
    inset 0 1px 1.5px rgba(255, 255, 255, 0.35) !important;
}
#header .nav-pills-container a:not(.active):hover,
#header .rounded.row a:not(.bg-white):hover {
  border-color: rgba(255, 255, 255, 0.5) !important;
}
#header .nav-pills-container a.active,
#header .rounded.row a.bg-white {
  font-weight: 800 !important;
  box-shadow:
    0 9px 30px rgba(var(--primary-rgb, 99, 102, 241), 0.6),
    0 3px 12px rgba(0, 0, 0, 0.18),
    inset 0 1px 2px rgba(255, 255, 255, 0.95),
    inset 0 -2px 0 rgba(var(--primary-rgb, 99, 102, 241), 0.18) !important;
  transform: translateY(-2px) scale(1.06) !important;
}

/* ============================================================
   DARK MODE — HOME đợt 2 (workflow): cf- Check live, tfa- 2FA,
   ac- Auto check, sup- Hỗ trợ, st- Cài đặt/Zalo. Pill/nút giữ hue.
   ============================================================ */
/* CHECK LIVE (cf-*) */
[data-bs-theme="dark"] .cf-title { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .cf-subtitle,
[data-bs-theme="dark"] .cf-progress-row { color: #94a3b8 !important; }
[data-bs-theme="dark"] .cf-progress-percent { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .cf-textarea { background: #1b2433 !important; border-color: rgba(255, 255, 255, 0.1) !important; color: #e2e8f0 !important; }
[data-bs-theme="dark"] .cf-textarea[readonly] { background: #232e3d !important; }
[data-bs-theme="dark"] .cf-progress-bar { background: #1b2433 !important; }
[data-bs-theme="dark"] .cf-pill { background: #2e3a4b !important; border-color: rgba(255, 255, 255, 0.1) !important; color: #94a3b8 !important; }
[data-bs-theme="dark"] .cf-pill:hover:not(:disabled) { background: #2d3b52 !important; }
[data-bs-theme="dark"] .cf-pill-indigo { background: rgba(var(--primary-rgb, 99, 102, 241), 0.16) !important; color: #a5b4fc !important; border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.4) !important; }
[data-bs-theme="dark"] .cf-pill-amber { background: rgba(245, 158, 11, 0.16) !important; color: #fcd34d !important; border-color: rgba(245, 158, 11, 0.4) !important; }
[data-bs-theme="dark"] .cf-pill-green { background: rgba(16, 185, 129, 0.16) !important; color: #6ee7b7 !important; border-color: rgba(16, 185, 129, 0.4) !important; }
[data-bs-theme="dark"] .cf-pill-purple { background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.16) !important; color: #c4b5fd !important; border-color: rgba(var(--primary-end-rgb, 139, 92, 246), 0.4) !important; }
[data-bs-theme="dark"] .cf-pill-cyan { background: rgba(6, 182, 212, 0.16) !important; color: #67e8f9 !important; border-color: rgba(14, 165, 233, 0.4) !important; }
[data-bs-theme="dark"] .cf-pill-red { background: rgba(220, 38, 38, 0.18) !important; color: #fca5a5 !important; border-color: rgba(239, 68, 68, 0.4) !important; }
[data-bs-theme="dark"] .cf-pill-blue { background: rgba(59, 130, 246, 0.15) !important; color: #93c5fd !important; border-color: rgba(59, 130, 246, 0.4) !important; }
[data-bs-theme="dark"] .cf-pill-indigo:hover { background: rgba(var(--primary-rgb, 99, 102, 241), 0.24) !important; }
[data-bs-theme="dark"] .cf-pill-amber:hover { background: rgba(245, 158, 11, 0.24) !important; }
[data-bs-theme="dark"] .cf-pill-green:hover { background: rgba(16, 185, 129, 0.24) !important; }
[data-bs-theme="dark"] .cf-pill-purple:hover { background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.24) !important; }
[data-bs-theme="dark"] .cf-pill-cyan:hover { background: rgba(6, 182, 212, 0.24) !important; }
[data-bs-theme="dark"] .cf-pill-red:hover { background: rgba(220, 38, 38, 0.26) !important; }
[data-bs-theme="dark"] .cf-pill-blue:hover { background: rgba(59, 130, 246, 0.24) !important; }
/* 2FA (tfa-*) */
[data-bs-theme="dark"] .tfa-title,
[data-bs-theme="dark"] .tfa-code { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .tfa-subtitle,
[data-bs-theme="dark"] .tfa-secret,
[data-bs-theme="dark"] .tfa-empty { color: #94a3b8 !important; }
[data-bs-theme="dark"] .tfa-timer-text { color: #cbd5e1 !important; }
[data-bs-theme="dark"] .tfa-timer-row > i { color: #94a3b8 !important; }
[data-bs-theme="dark"] .tfa-timer-bar { background: #1b2433 !important; }
[data-bs-theme="dark"] .tfa-input { background: #1b2433 !important; border-color: rgba(255, 255, 255, 0.1) !important; color: #e2e8f0 !important; }
[data-bs-theme="dark"] .tfa-input::placeholder { color: #64748b !important; }
[data-bs-theme="dark"] .tfa-item { background: #1b2433 !important; border-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .tfa-item:hover { border-color: rgba(255, 255, 255, 0.2) !important; }
[data-bs-theme="dark"] .tfa-item-saved { background: rgba(245, 158, 11, 0.1) !important; border-color: rgba(245, 158, 11, 0.3) !important; }
[data-bs-theme="dark"] .tfa-item-saved:hover { border-color: rgba(245, 158, 11, 0.5) !important; }
[data-bs-theme="dark"] .tfa-saved-label { color: #fcd34d !important; }
[data-bs-theme="dark"] .tfa-act-btn { background: #2e3a4b !important; }
[data-bs-theme="dark"] .tfa-act-save { background: rgba(16, 185, 129, 0.16) !important; color: #6ee7b7 !important; border-color: rgba(16, 185, 129, 0.4) !important; }
[data-bs-theme="dark"] .tfa-act-save:hover { background: rgba(16, 185, 129, 0.24) !important; }
[data-bs-theme="dark"] .tfa-act-edit { background: rgba(245, 158, 11, 0.16) !important; color: #fcd34d !important; border-color: rgba(245, 158, 11, 0.4) !important; }
[data-bs-theme="dark"] .tfa-act-edit:hover { background: rgba(245, 158, 11, 0.24) !important; }
[data-bs-theme="dark"] .tfa-act-del { background: rgba(220, 38, 38, 0.18) !important; color: #fca5a5 !important; border-color: rgba(239, 68, 68, 0.4) !important; }
[data-bs-theme="dark"] .tfa-act-del:hover { background: rgba(220, 38, 38, 0.26) !important; }
/* AUTO CHECK (ac-*) */
[data-bs-theme="dark"] .ac-title { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .ac-card,
[data-bs-theme="dark"] .ac-zalo-gate { background: #232e3d !important; border-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .ac-card-head { border-bottom-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .ac-card .nh-ac-foot { border-top-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .ac-head-divider { background: rgba(255, 255, 255, 0.12) !important; }
[data-bs-theme="dark"] .ac-hour-box { background: #2e3a4b !important; border-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .ac-hour-box .ac-hm-sep { color: #cbd5e1 !important; }
[data-bs-theme="dark"] .ac-hm-pick { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .ac-hm-pick:hover { background: rgba(var(--primary-rgb, 99, 102, 241), 0.16) !important; }
[data-bs-theme="dark"] .ac-hm-pick.is-open { background: rgba(var(--primary-rgb, 99, 102, 241), 0.22) !important; color: #c4b5fd !important; }
[data-bs-theme="dark"] .ac-hm-caret { color: #94a3b8 !important; }
[data-bs-theme="dark"] .ac-hm-menu { background: #232e3d !important; border-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .ac-hm-opt { color: #94a3b8 !important; }
[data-bs-theme="dark"] .ac-hm-opt:hover { background: rgba(var(--primary-rgb, 99, 102, 241), 0.16) !important; color: #c4b5fd !important; }
[data-bs-theme="dark"] .ac-hm-opt.is-active { color: #c4b5fd !important; }
[data-bs-theme="dark"] .ac-cat-chip { background: rgba(var(--primary-rgb, 99, 102, 241), 0.12) !important; border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.3) !important; color: #c4b5fd !important; }
[data-bs-theme="dark"] .ac-cat-chip:hover { background: rgba(var(--primary-rgb, 99, 102, 241), 0.18) !important; border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.4) !important; }
[data-bs-theme="dark"] .ac-cat-chip-value { color: #c4b5fd !important; }
[data-bs-theme="dark"] .ac-cat-chip-menu { background: #232e3d !important; border-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .ac-cat-opt { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .ac-cat-opt:hover { background: rgba(var(--primary-rgb, 99, 102, 241), 0.16) !important; color: #c4b5fd !important; }
[data-bs-theme="dark"] .ac-cat-opt.is-active { color: #c4b5fd !important; }
[data-bs-theme="dark"] .ac-cat-opt-count { background: #1b2433 !important; color: #94a3b8 !important; }
[data-bs-theme="dark"] .ac-cat-opt:hover .ac-cat-opt-count,
[data-bs-theme="dark"] .ac-cat-opt.is-active .ac-cat-opt-count { background: rgba(var(--primary-rgb, 99, 102, 241), 0.2) !important; color: #a5b4fc !important; }
[data-bs-theme="dark"] .ac-hbtn { background: #2e3a4b !important; border-color: rgba(255, 255, 255, 0.1) !important; color: #cbd5e1 !important; }
[data-bs-theme="dark"] .ac-hbtn:hover { background: #2d3b52 !important; border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.4) !important; }
[data-bs-theme="dark"] .ac-hbtn.is-open { background: rgba(var(--primary-rgb, 99, 102, 241), 0.14) !important; border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.5) !important; }
[data-bs-theme="dark"] .ac-hbtn > i { color: #94a3b8 !important; }
[data-bs-theme="dark"] .ac-hbtn.is-open > i { color: #a5b4fc !important; }
[data-bs-theme="dark"] .ac-hbtn-menu { background: #232e3d !important; border-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .ac-filter-opt { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .ac-filter-opt:hover { background: rgba(var(--primary-rgb, 99, 102, 241), 0.16) !important; }
[data-bs-theme="dark"] .ac-search { background: #2e3a4b !important; border-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .ac-search:focus-within { border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.5) !important; }
[data-bs-theme="dark"] .ac-search-ico { color: #94a3b8 !important; }
[data-bs-theme="dark"] .ac-search:focus-within .ac-search-ico { color: #a5b4fc !important; }
[data-bs-theme="dark"] .ac-search-input { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .ac-search-input::placeholder { color: #64748b !important; }
[data-bs-theme="dark"] .ac-btn-danger { background: rgba(220, 38, 38, 0.18) !important; color: #fca5a5 !important; border-color: rgba(239, 68, 68, 0.4) !important; }
[data-bs-theme="dark"] .ac-btn-danger:not(:disabled):hover { background: rgba(220, 38, 38, 0.28) !important; }
[data-bs-theme="dark"] .ac-stats-grp { background: #2e3a4b !important; border-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .ac-stat-item { color: #e2e8f0 !important; border-right-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .ac-stat-item strong { color: #94a3b8 !important; }
[data-bs-theme="dark"] .ac-zalo-gate-title { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .ac-zalo-gate-desc,
[data-bs-theme="dark"] .ac-zalo-countdown { color: #94a3b8 !important; }
[data-bs-theme="dark"] .ac-zalo-countdown strong { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .ac-zalo-gate-icon { background: rgba(0, 104, 255, 0.18) !important; }
[data-bs-theme="dark"] .ac-zalo-gate-btn-ghost { color: #cbd5e1 !important; border-color: rgba(255, 255, 255, 0.12) !important; }
[data-bs-theme="dark"] .ac-zalo-gate-btn-ghost:hover { background: #2e3a4b !important; color: #e2e8f0 !important; }
[data-bs-theme="dark"] .ac-zalo-code-box { background: rgba(0, 104, 255, 0.12) !important; border-color: rgba(0, 104, 255, 0.45) !important; }
[data-bs-theme="dark"] .ac-zalo-code-box:hover { background: rgba(0, 104, 255, 0.2) !important; }
[data-bs-theme="dark"] .ac-grid-empty,
[data-bs-theme="dark"] .ac-grid-empty p { color: #94a3b8 !important; }
[data-bs-theme="dark"] .ac-grid-empty i { color: #475569 !important; }
[data-bs-theme="dark"] .ac-aggrid .ac-cell-id { color: #e2e8f0 !important; }
/* ===== HỖ TRỢ (sup-*) — dark mode (redesign) ===== */
[data-bs-theme="dark"] .sup-card {
  background: #232e3d !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25) !important;
}
[data-bs-theme="dark"] .sup-card:hover {
  border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.4) !important;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4) !important;
}
[data-bs-theme="dark"] .sup-section-title,
[data-bs-theme="dark"] .sup-card-name { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .sup-section-meta,
[data-bs-theme="dark"] .sup-card-desc { color: #94a3b8 !important; }
/* Hero giữ gradient sáng (brand) — chỉ giảm bóng; stat-chip glass đậm hơn */
[data-bs-theme="dark"] .sup-hero { box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4) !important; }
[data-bs-theme="dark"] .sup-stat {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
}
/* Banner FB — dark: nền tím giảm chói (đồng bộ tông tím app), bóng đen; CTA chữ tím đậm */
[data-bs-theme="dark"] .sup-banner {
  background: linear-gradient(120deg, #4338ca 0%, #6d28d9 100%) !important;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45) !important;
}
[data-bs-theme="dark"] .sup-banner:hover { box-shadow: 0 22px 46px rgba(0, 0, 0, 0.55) !important; }
[data-bs-theme="dark"] .sup-banner-cta { color: #5b21b6 !important; }
/* Banner Zalo — dark: nền indigo tối, card tối, chữ/icon tím sáng */
[data-bs-theme="dark"] .sup-zbanner {
  background: linear-gradient(135deg, #221d3f 0%, #2a2356 60%, #322a66 100%) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.42) !important;
}
[data-bs-theme="dark"] .sup-zbanner::before { opacity: 0.25 !important; }
[data-bs-theme="dark"] .sup-zbanner-title { color: #e8e6fc !important; }
[data-bs-theme="dark"] .sup-zbanner-title strong { color: #a78bfa !important; }
[data-bs-theme="dark"] .sup-zfeat {
  background: #251f40 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3) !important;
}
[data-bs-theme="dark"] .sup-zfeat > i {
  background: rgba(124, 58, 237, 0.22) !important;
  color: #c4b5fd !important;
}
[data-bs-theme="dark"] .sup-zfeat-t { color: #e8e6fc !important; }
[data-bs-theme="dark"] .sup-zfeat-d { color: #94a3b8 !important; }
[data-bs-theme="dark"] .sup-zbanner-foot {
  color: #cbd5e1 !important;
  border-top-color: rgba(255, 255, 255, 0.14) !important;
}
[data-bs-theme="dark"] .sup-zbanner-foot i { color: #a78bfa !important; }
/* Icon chip card */
[data-bs-theme="dark"] .sup-card-zalo .sup-card-icon { background: rgba(59, 130, 246, 0.16) !important; }
[data-bs-theme="dark"] .sup-card-admin-bill .sup-card-icon { background: rgba(245, 158, 11, 0.16) !important; color: #fcd34d !important; }
[data-bs-theme="dark"] .sup-card-admin-dev .sup-card-icon { background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.16) !important; color: #c4b5fd !important; }
/* Badge + CTA */
[data-bs-theme="dark"] .sup-card-badge { background: rgba(var(--primary-rgb, 99, 102, 241), 0.16) !important; color: #a5b4fc !important; border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.3) !important; }
[data-bs-theme="dark"] .sup-card-cta { color: #a5b4fc !important; }
[data-bs-theme="dark"] .sup-card-admin-bill .sup-card-cta-pill { background: rgba(245, 158, 11, 0.16) !important; color: #fcd34d !important; }
[data-bs-theme="dark"] .sup-card-admin-dev .sup-card-cta-pill { background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.16) !important; color: #c4b5fd !important; }
[data-bs-theme="dark"] .sup-card-admin-bill:hover .sup-card-cta-pill { background: rgba(245, 158, 11, 0.24) !important; }
[data-bs-theme="dark"] .sup-card-admin-dev:hover .sup-card-cta-pill { background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.24) !important; }
/* Tags */
[data-bs-theme="dark"] .sup-tag-amber { background: rgba(245, 158, 11, 0.16) !important; color: #fcd34d !important; }
[data-bs-theme="dark"] .sup-tag-violet { background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.16) !important; color: #c4b5fd !important; }
/* Tip */
[data-bs-theme="dark"] .sup-tip { background: rgba(245, 158, 11, 0.12) !important; border-color: rgba(245, 158, 11, 0.3) !important; color: #fcd34d !important; }
[data-bs-theme="dark"] .sup-tip i { color: #fbbf24 !important; }
[data-bs-theme="dark"] .sup-tip a { color: #fbbf24 !important; }
/* CÀI ĐẶT / ZALO (st-*) */
[data-bs-theme="dark"] .st-card,
[data-bs-theme="dark"] .st-action-bar { background: #232e3d !important; border-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .st-card:hover { border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.32) !important; }
[data-bs-theme="dark"] .st-card-head { background: #2e3a4b !important; border-bottom-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .st-card-title,
[data-bs-theme="dark"] .st-card b,
[data-bs-theme="dark"] .st-card span,
[data-bs-theme="dark"] .st-zalo-step { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .st-card-desc,
[data-bs-theme="dark"] .st-zalo-desc { color: #94a3b8 !important; }
[data-bs-theme="dark"] .st-card-head-icon-zalo { background: rgba(59, 130, 246, 0.16) !important; }
[data-bs-theme="dark"] .st-card-head-icon-purple { background: rgba(var(--primary-end-rgb, 139, 92, 246), 0.16) !important; color: #c4b5fd !important; }
[data-bs-theme="dark"] .st-zalo-status-checking { background: #1b2433 !important; color: #94a3b8 !important; border-color: rgba(255, 255, 255, 0.1) !important; }
[data-bs-theme="dark"] .st-zalo-status-connected { background: rgba(16, 185, 129, 0.16) !important; color: #6ee7b7 !important; border-color: rgba(16, 185, 129, 0.3) !important; }
[data-bs-theme="dark"] .st-zalo-status-pending { background: rgba(245, 158, 11, 0.16) !important; color: #fcd34d !important; border-color: rgba(245, 158, 11, 0.3) !important; }
[data-bs-theme="dark"] .st-skel-bar { background: linear-gradient(90deg, #1b2433 0%, #2e3a4b 50%, #1b2433 100%) !important; background-size: 200% 100% !important; }
[data-bs-theme="dark"] .st-zalo-code-box { background: rgba(var(--primary-rgb, 99, 102, 241), 0.1) !important; border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.4) !important; }
[data-bs-theme="dark"] .st-zalo-code { color: #a5b4fc !important; }
[data-bs-theme="dark"] .st-zalo-copy { background: #2e3a4b !important; color: #a5b4fc !important; border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.4) !important; }
[data-bs-theme="dark"] .st-zalo-copy:hover { background: var(--primary-start, #6366f1) !important; color: #fff !important; }
[data-bs-theme="dark"] .st-zalo-expire { color: #fcd34d !important; }
[data-bs-theme="dark"] .st-zalo-connected { background: rgba(16, 185, 129, 0.12) !important; border-color: rgba(16, 185, 129, 0.3) !important; }
[data-bs-theme="dark"] .st-zalo-connected-name { color: #6ee7b7 !important; }
[data-bs-theme="dark"] .st-zalo-connected-sub { color: #34d399 !important; }
[data-bs-theme="dark"] .st-btn-danger,
[data-bs-theme="dark"] .st-btn-outline-danger { background: rgba(220, 38, 38, 0.18) !important; color: #fca5a5 !important; border-color: rgba(239, 68, 68, 0.4) !important; }
[data-bs-theme="dark"] .st-btn-danger:hover,
[data-bs-theme="dark"] .st-btn-outline-danger:hover { background: rgba(220, 38, 38, 0.28) !important; }

/* ===== Dark override — nút trong card feature (ads/bm/page/via) =====
   Đã gộp & dedupe so với các rule [style*=...] toàn cục có sẵn:
     • .textarea-copy-btn  (inline background: #f8f9fa)  → đã phủ ở rule global
       [style*="background: #f8f9fa"] (→ #232e3d + border rgba(255,255,255,.08)).
     • .textarea-copy-btn  (inline color: #6c757d)       → đã phủ ở rule global
       [style*="color: #6c757d"] (→ #94a3b8).
     • ads-add-the icon "DS Thẻ" (inline color: #666)    → đã phủ ở rule global
       [style*="color: #666"] (→ #94a3b8).
   Chỉ còn 1 phần tử chưa có rule nào bắt → thêm bên dưới (GIỮ accent border/color). */

/* bm-tao-tkqc — nút "Set" cấu hình sau khi tạo TKQC (inline background: #fff);
   chỉ tối hoá nền, GIỮ NGUYÊN viền + chữ accent #0d6efd. */
[data-bs-theme="dark"] [data-feature="bm-tao-tkqc"] #btnAfterCreateSet {
  background: #2e3a4b !important;
}

/* ===== Lên Camp — Trình tạo chiến dịch chi tiết (wizard, redesign 2 cột) ===== */
.lcw-overlay { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 20px; animation: lcwOvIn .2s ease;
  background: rgba(15,23,42,.52);
  --lc-surface:#fff; --lc-surface2:#f5f7fb; --lc-surface3:#eef2f8; --lc-line:#e6eaf1; --lc-line2:#eef1f6;
  --lc-ink:#101828; --lc-ink2:#5b6672; --lc-ink3:#98a2b3;
  --lc-acc:var(--primary-end,#8b5cf6); --lc-acc2:var(--primary-start,#6366f1); --lc-accrgb:var(--primary-end-rgb,139,92,246);
  --lc-weak:#f3effe; --lc-accink:#6b34d6;
  --lc-ok:#16a34a; --lc-okw:#e7f6ec; --lc-danger:#dc2626; --lc-dangerw:#fdecec; }
[data-bs-theme="dark"] .lcw-overlay {
  background: rgba(2,6,14,.64);
  --lc-surface:#141b2b; --lc-surface2:#1b2333; --lc-surface3:#212b3d; --lc-line:#293345; --lc-line2:#222b3b;
  --lc-ink:#e9edf5; --lc-ink2:#98a2b8; --lc-ink3:#6b7689;
  --lc-weak:#241b46; --lc-accink:#c5b3ff;
  --lc-ok:#34d27f; --lc-okw:#12301f; --lc-danger:#f87171; --lc-dangerw:#3a1b1b; }

.lcw-modal { background: var(--lc-surface); border: 1px solid var(--lc-line); border-radius: 18px; width: 960px; max-width: 100%; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 24px 64px -18px rgba(16,24,40,.4); animation: lcwModalIn .3s cubic-bezier(.16,1,.3,1); }
[data-bs-theme="dark"] .lcw-modal { box-shadow: 0 26px 70px -18px rgba(0,0,0,.7); }

/* Header: badge + tiêu đề + phụ đề + nút đóng */
.lcw-head { display: flex; align-items: center; gap: 14px; padding: 18px 22px 16px; }
.lcw-badge { width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, var(--lc-acc), var(--lc-acc2)); box-shadow: 0 6px 16px -4px rgba(var(--lc-accrgb), .55); }
.lcw-badge i { font-size: 22px; }
.lcw-htxt { min-width: 0; }
.lcw-h-title { font-weight: 700; font-size: 17px; letter-spacing: -.01em; color: var(--lc-ink); }
.lcw-h-sub { margin-top: 2px; font-size: 12.5px; color: var(--lc-ink2); }
.lcw-close { margin-left: auto; flex-shrink: 0; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--lc-line); background: var(--lc-surface); color: var(--lc-ink2); cursor: pointer; display: grid; place-items: center; font-size: 22px; line-height: 1; transition: all .15s; }
.lcw-close:hover { background: var(--lc-dangerw); color: var(--lc-danger); border-color: transparent; }

/* Stepper rail mảnh: chấm nối, dấu ✓ khi hoàn thành */
.lcw-steps { display: flex; align-items: flex-start; gap: 0; padding: 4px 26px 18px; overflow-x: auto; }
.lcw-step { flex: 1; min-width: 78px; display: flex; flex-direction: column; align-items: center; gap: 7px; position: relative; text-align: center; }
.lcw-step-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; z-index: 1; position: relative;
  background: var(--lc-surface3); color: var(--lc-ink3); border: 2px solid var(--lc-line); transition: all .2s; }
.lcw-step-t { font-size: 11.5px; font-weight: 600; color: var(--lc-ink3); white-space: nowrap; transition: color .2s; }
.lcw-step:not(:last-child)::after { content: ""; position: absolute; top: 13px; left: 50%; width: 100%; height: 2px; background: var(--lc-line); z-index: 0; transition: background .3s; }
.lcw-step.is-done .lcw-step-n, .lcw-step.is-active .lcw-step-n { background: linear-gradient(135deg, var(--lc-acc), var(--lc-acc2)); border-color: transparent; color: #fff; }
.lcw-step.is-active .lcw-step-n { background: var(--lc-surface); border-color: var(--lc-acc); color: var(--lc-acc); box-shadow: 0 0 0 4px var(--lc-weak); }
.lcw-step.is-done::after { background: var(--lc-acc); }
.lcw-step.is-active .lcw-step-t { color: var(--lc-accink); font-weight: 700; }
.lcw-step.is-done .lcw-step-t { color: var(--lc-ink2); }

/* Body + 2 cột (form trái · panel ngữ cảnh phải) */
.lcw-body { padding: 6px 26px 24px; overflow-y: auto; flex: 1; }
.lcw-stepwrap.lcw-anim { animation: lcwStepIn .25s ease; }
.lcw-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--lc-ink3); margin: 2px 0 12px; }
.lcw-cols { display: grid; grid-template-columns: 1.5fr 1fr; gap: 22px; align-items: start; }
.lcw-cols > div, .lcw-cols > aside { min-width: 0; }
.lcw-aside { position: sticky; top: 0; border: 1px solid var(--lc-line); border-radius: 12px; background: var(--lc-surface2); padding: 15px; display: flex; flex-direction: column; gap: 14px; }
.lcw-aside .lcw-eyebrow { margin: 0; }

.lcw-label { font-weight: 600; font-size: 13px; color: var(--lc-ink); margin-bottom: 7px; }
.lcw-label .req { color: var(--lc-danger); }
.lcw-hint { font-size: 12px; color: var(--lc-ink3); margin-top: 7px; line-height: 1.5; }
.lcw-hint-inline { color: var(--lc-ink3); font-weight: 400; font-size: 10.5px; }
.lcw-input { width: 100%; border: 1px solid var(--lc-line); background: var(--lc-surface); border-radius: 9px; padding: 10px 12px; font-size: 14px; color: var(--lc-ink); outline: none; transition: border-color .15s, box-shadow .15s; }
.lcw-input::placeholder { color: var(--lc-ink3); }
.lcw-input:focus { border-color: var(--lc-acc); box-shadow: 0 0 0 3px var(--lc-weak); }
.lcw-row, .lcw-two { display: flex; gap: 12px; }
.lcw-f { flex: 1; min-width: 0; }
.lcw-divider { border-top: 1px solid var(--lc-line); margin: 16px 0 12px; }
.lcw-mt { margin-top: 16px; }

/* Card mục tiêu (lưới 3 cột) */
.lcw-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.lcw-card { position: relative; border: 1.5px solid var(--lc-line); border-radius: 12px; padding: 14px 12px 12px; cursor: pointer; background: var(--lc-surface); transition: transform .14s, border-color .14s, background .14s, box-shadow .14s; }
.lcw-card input { position: absolute; opacity: 0; pointer-events: none; }
.lcw-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--lc-acc) 45%, var(--lc-line)); box-shadow: 0 10px 22px -12px rgba(var(--lc-accrgb), .5); }
.lcw-card.is-sel { border-color: var(--lc-acc); background: var(--lc-weak); }
.lcw-card-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 9px; color: #fff; }
.lcw-card-ic i { font-size: 20px; }
.lcw-card-t { font-weight: 700; font-size: 13.5px; color: var(--lc-ink); }
.lcw-card-d { font-size: 11.5px; color: var(--lc-ink2); margin-top: 3px; line-height: 1.4; }
.lcw-card.is-sel::after { content: "✓"; position: absolute; top: 9px; right: 9px; width: 18px; height: 18px; background: var(--lc-acc); color: #fff; border-radius: 50%; font-size: 11px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 2px 5px rgba(var(--lc-accrgb), .4); }

/* Kết quả nhận về — lưới 3 cột giống card mục tiêu, có icon */
.lcw-dgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.lcw-dcard { position: relative; border: 1.5px solid var(--lc-line); border-radius: 12px; padding: 14px 12px 12px; cursor: pointer; background: var(--lc-surface); transition: transform .14s, border-color .14s, background .14s, box-shadow .14s; }
.lcw-dcard input { position: absolute; opacity: 0; pointer-events: none; }
.lcw-dcard:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--lc-acc) 45%, var(--lc-line)); box-shadow: 0 10px 22px -12px rgba(var(--lc-accrgb), .5); }
.lcw-dcard.is-sel { border-color: var(--lc-acc); background: var(--lc-weak); }
.lcw-dic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 9px; background: var(--lc-surface3); color: var(--lc-ink2); transition: all .14s; }
.lcw-dcard.is-sel .lcw-dic { background: linear-gradient(140deg, var(--lc-acc), var(--lc-acc2)); color: #fff; }
.lcw-dic i { font-size: 19px; }
.lcw-dcard h4 { margin: 0; font-size: 13px; font-weight: 700; color: var(--lc-ink); }
.lcw-dcard p { margin: 3px 0 0; font-size: 11px; color: var(--lc-ink2); line-height: 1.4; }
.lcw-dcard.is-sel::after { content: "✓"; position: absolute; top: 9px; right: 9px; width: 18px; height: 18px; background: var(--lc-acc); color: #fff; border-radius: 50%; font-size: 11px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 2px 5px rgba(var(--lc-accrgb), .4); }

/* Pill radio + chip */
.lcw-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.lcw-opt { display: inline-flex; align-items: center; gap: 7px; border: 1.5px solid var(--lc-line); background: var(--lc-surface); border-radius: 9px; padding: 9px 14px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--lc-ink2); transition: all .14s; }
.lcw-opt input { display: none; }
.lcw-opt i { font-size: 15px; }
.lcw-opt:hover { border-color: color-mix(in srgb, var(--lc-acc) 40%, var(--lc-line)); }
.lcw-opt.is-sel { border-color: var(--lc-acc); background: var(--lc-weak); color: var(--lc-accink); }
.lcw-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.lcw-chip { border: 1px solid var(--lc-line); background: var(--lc-surface); border-radius: 999px; padding: 6px 13px; font-size: 12.5px; color: var(--lc-ink2); cursor: pointer; display: inline-flex; align-items: center; gap: 5px; transition: all .14s; }
.lcw-chip input { display: none; }
.lcw-chip:hover { border-color: color-mix(in srgb, var(--lc-acc) 40%, var(--lc-line)); }
.lcw-chip.is-sel { border-color: var(--lc-acc); background: var(--lc-weak); color: var(--lc-accink); }
.lcw-chip-sm { padding: 4px 10px; font-size: 11px; }
.lcw-chip-plat { padding: 7px 13px; font-weight: 500; }
.lcw-chip-plat i { font-size: 15px; }
.lcw-chip-ex { background: var(--lc-dangerw); border-color: color-mix(in srgb, var(--lc-danger) 28%, var(--lc-line)); color: var(--lc-danger); }
.lcw-int-rm, .lcw-ex-rm { cursor: pointer; opacity: .6; }
.lcw-int-rm:hover, .lcw-ex-rm:hover { opacity: 1; }
.lcw-plat { margin-top: 8px; }
.lcw-pos { margin: 6px 0 0 12px; }

/* Upload ảnh */
.lcw-upload { display: block; border: 1.5px dashed color-mix(in srgb, var(--lc-acc) 30%, var(--lc-line)); border-radius: 11px; padding: 16px; text-align: center; cursor: pointer; color: var(--lc-ink2); font-size: 13px; transition: all .15s; }
.lcw-upload:hover { border-color: var(--lc-acc); background: var(--lc-weak); }
.lcw-upload i { font-size: 20px; }
.lcw-img-prev { max-height: 120px; border-radius: 8px; }

/* Ô tìm + kết quả (sở thích) */
.lcw-searchbox { display: flex; align-items: center; gap: 9px; border: 1px solid var(--lc-line); background: var(--lc-surface); border-radius: 9px; padding: 0 13px; transition: border-color .15s, box-shadow .15s; }
.lcw-searchbox:focus-within { border-color: var(--lc-acc); box-shadow: 0 0 0 3px var(--lc-weak); }
.lcw-searchbox i { color: var(--lc-ink3); flex-shrink: 0; }
.lcw-searchbox .lcw-input { border: none; background: none; padding: 10px 0; box-shadow: none; }
.lcw-search-res { border: 1px solid var(--lc-line); border-radius: 9px; margin-top: 6px; max-height: 160px; overflow-y: auto; }
.lcw-search-res:empty { display: none; }
.lcw-search-item { padding: 9px 12px; font-size: 13px; color: var(--lc-ink); cursor: pointer; }
.lcw-search-item:hover { background: var(--lc-weak); }
.lcw-search-loading { padding: 9px 12px; font-size: 12px; color: var(--lc-ink3); }

/* Ô tiền + selectlike (ngân sách) */
.lcw-money { display: flex; align-items: center; border: 1px solid var(--lc-line); border-radius: 9px; background: var(--lc-surface); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.lcw-money:focus-within { border-color: var(--lc-acc); box-shadow: 0 0 0 3px var(--lc-weak); }
.lcw-money > span { align-self: stretch; display: flex; align-items: center; padding: 0 13px; color: var(--lc-ink3); font-weight: 700; font-size: 14px; background: var(--lc-surface2); border-right: 1px solid var(--lc-line); }
.lcw-money .lcw-input { border: none; background: none; box-shadow: none; }

/* Tóm tắt / ước tính (panel phải) */
.lcw-meter { background: var(--lc-surface); border: 1px solid var(--lc-line); border-radius: 10px; padding: 12px; }
.lcw-meter-row { display: flex; align-items: baseline; justify-content: space-between; }
.lcw-meter-row b { font-size: 19px; font-weight: 800; letter-spacing: -.01em; color: var(--lc-ink); font-variant-numeric: tabular-nums; }
.lcw-meter-row small { font-size: 11px; color: var(--lc-ink3); }
.lcw-bar { height: 7px; border-radius: 99px; background: var(--lc-surface3); margin-top: 10px; overflow: hidden; }
.lcw-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--lc-acc), var(--lc-acc2)); }
.lcw-sumline { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; padding: 6px 0; border-top: 1px dashed var(--lc-line); }
.lcw-sumline:first-child { border-top: none; }
.lcw-sumline span { color: var(--lc-ink3); }
.lcw-sumline b { font-weight: 600; color: var(--lc-ink); text-align: right; word-break: break-word; }

/* Cây phân cấp tên */
.lcw-tree { display: flex; flex-direction: column; gap: 9px; }
.lcw-tnode { display: flex; align-items: center; gap: 11px; border: 1px solid var(--lc-line); border-radius: 11px; background: var(--lc-surface); padding: 9px 11px; }
.lcw-tnode.lv1 { margin-left: 20px; }
.lcw-tnode.lv2 { margin-left: 40px; }
.lcw-tic { width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0; display: grid; place-items: center; font-weight: 800; font-size: 12px; color: #fff; background: linear-gradient(140deg, var(--lc-acc), var(--lc-acc2)); }
.lcw-tnode b { display: block; font-size: 12.5px; font-weight: 600; color: var(--lc-ink); }
.lcw-tnode small { display: block; font-size: 11px; color: var(--lc-ink2); margin-top: 1px; }

/* Xem trước quảng cáo (panel phải bước Trang&Bài / Review) */
.lcw-adprev { border: 1px solid var(--lc-line); border-radius: 11px; background: var(--lc-surface); overflow: hidden; }
.lcw-adhead { display: flex; align-items: center; gap: 9px; padding: 10px 11px; }
.lcw-adav { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; object-fit: cover; background: linear-gradient(135deg, #dfe6f2, #c9d5ea); display: grid; place-items: center; color: #8a99b5; font-weight: 700; font-size: 12px; }
.lcw-adhead b { font-size: 12.5px; color: var(--lc-ink); }
.lcw-adhead small { display: block; color: var(--lc-ink3); font-size: 10.5px; }
.lcw-adtxt { padding: 0 11px 9px; font-size: 12px; color: var(--lc-ink); line-height: 1.5; }
.lcw-adimg { height: 150px; object-fit: cover; width: 100%; display: block; background: linear-gradient(135deg, color-mix(in srgb, var(--lc-acc) 22%, #cbd6ea), color-mix(in srgb, var(--lc-acc) 42%, #8fa4cf)); }
.lcw-adimg-ph { height: 150px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, color-mix(in srgb, var(--lc-acc) 22%, #cbd6ea), color-mix(in srgb, var(--lc-acc) 42%, #8fa4cf)); }
.lcw-adimg-ph i { font-size: 34px; opacity: .85; }
.lcw-adcta { display: flex; align-items: center; justify-content: space-between; padding: 10px 11px; background: var(--lc-surface3); }
.lcw-adcta small { color: var(--lc-ink2); font-size: 11px; }
.lcw-adcta span { background: var(--lc-surface); border: 1px solid var(--lc-line); color: var(--lc-ink); font-size: 11.5px; font-weight: 700; padding: 6px 12px; border-radius: 7px; }

/* Review — nhóm tóm tắt có icon */
.lcw-review { display: flex; flex-direction: column; gap: 12px; }
.lcw-revgroup { border: 1px solid var(--lc-line); border-radius: 12px; background: var(--lc-surface); padding: 2px 14px 9px; }
.lcw-revhead { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--lc-accink); padding: 11px 0 9px; border-bottom: 1px solid var(--lc-line2); margin-bottom: 2px; }
.lcw-revhead i { font-size: 15px; color: var(--lc-acc); }
.lcw-rev-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 12.5px; border-top: 1px dashed var(--lc-line2); }
.lcw-rev-row:first-of-type { border-top: none; }
.lcw-rev-k { color: var(--lc-ink3); flex-shrink: 0; }
.lcw-rev-v { color: var(--lc-ink); font-weight: 600; text-align: right; word-break: break-word; }

/* Bài viết (chọn post) */
.lcw-posts { display: flex; flex-direction: column; gap: 9px; max-height: 320px; overflow-y: auto; margin-top: 4px; }
.lcw-post { display: flex; gap: 11px; border: 1.5px solid var(--lc-line); border-radius: 11px; padding: 9px; cursor: pointer; background: var(--lc-surface); transition: all .14s; }
.lcw-post:hover { border-color: color-mix(in srgb, var(--lc-acc) 40%, var(--lc-line)); }
.lcw-post.is-sel { border-color: var(--lc-acc); background: var(--lc-weak); }
.lcw-post-img { width: 58px; height: 58px; border-radius: 9px; object-fit: cover; flex-shrink: 0; }
.lcw-post-noimg { display: grid; place-items: center; background: var(--lc-surface3); color: var(--lc-ink3); font-size: 20px; }
.lcw-post-body { min-width: 0; flex: 1; }
.lcw-post-msg { font-size: 12.5px; color: var(--lc-ink); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lcw-post-stats { display: flex; gap: 13px; margin-top: 6px; font-size: 11.5px; color: var(--lc-ink3); }
.lcw-post-stats i { margin-right: 4px; }

/* Sub-label + nút nhỏ + gợi ý ± */
.lcw-sublabel { font-size: 12px; font-weight: 600; color: var(--lc-ink2); margin: 11px 0 6px; }
.lcw-sublabel-row { display: flex; align-items: center; justify-content: space-between; }
.lcw-mini-btn { border: none; background: none; color: var(--lc-acc); font-size: 12px; font-weight: 600; cursor: pointer; padding: 2px 4px; }
.lcw-mini-btn:hover { text-decoration: underline; }
.lcw-mini-btn-danger { color: var(--lc-danger); }
.lcw-airow { display: flex; gap: 8px; align-items: stretch; }
.lcw-airow .lcw-input { flex: 1; }
.lcw-airow .lcw-btn { flex-shrink: 0; white-space: nowrap; }
.lcw-sug { display: inline-flex; align-items: center; gap: 5px; background: var(--lc-surface); border: 1px solid var(--lc-line); border-radius: 999px; padding: 4px 5px 4px 12px; font-size: 12.5px; color: var(--lc-ink); cursor: default; }
.lcw-sug:hover { border-color: color-mix(in srgb, var(--lc-acc) 40%, var(--lc-line)); }
.lcw-sug-lbl { cursor: default; }
.lcw-sug-inc, .lcw-sug-exc { width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; cursor: pointer; transition: all .13s; }
.lcw-sug-inc { background: var(--lc-okw); color: var(--lc-ok); }
.lcw-sug-inc:hover { background: var(--lc-ok); color: #fff; }
.lcw-sug-exc { background: var(--lc-dangerw); color: var(--lc-danger); }
.lcw-sug-exc:hover { background: var(--lc-danger); color: #fff; }
.lcw-ind { background: var(--lc-surface2); }
.lcw-ind:hover { border-color: color-mix(in srgb, var(--lc-acc) 40%, var(--lc-line)); }

/* Footer */
.lcw-foot { display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--lc-line); background: var(--lc-surface); }
.lcw-foot-spacer, .lcw-spacer { flex: 1; }
.lcw-fprog { font-size: 12px; color: var(--lc-ink3); font-weight: 600; }
.lcw-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--lc-line); background: var(--lc-surface); color: var(--lc-ink2); border-radius: 10px; padding: 10px 18px; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: all .14s; }
.lcw-btn i { font-size: 16px; }
.lcw-btn:hover { color: var(--lc-ink); background: var(--lc-surface2); }
.lcw-btn:active { transform: scale(.97); }
.lcw-btn-ghost { border-color: transparent; background: transparent; }
.lcw-btn-primary { border-color: transparent; color: #fff; padding: 10px 24px; background: linear-gradient(135deg, var(--lc-acc), var(--lc-acc2)); box-shadow: 0 8px 18px -6px rgba(var(--lc-accrgb), .55); }
.lcw-btn-primary:hover { color: #fff; filter: brightness(1.06); transform: translateY(-1px); }
.lcw-btn-primary:active { transform: translateY(0) scale(.97); }
.lcw-btn-sm { padding: 7px 12px; font-size: 13px; }

/* Lỗi inline */
.lcw-err { display: flex; align-items: center; gap: 8px; margin: 0 22px; padding: 9px 14px; background: var(--lc-dangerw); border: 1px solid color-mix(in srgb, var(--lc-danger) 32%, transparent); border-radius: 10px; color: var(--lc-danger); font-size: 13px; font-weight: 600; animation: lcwErrIn .18s ease; }
.lcw-err i { font-size: 16px; flex-shrink: 0; }

@keyframes lcwOvIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes lcwModalIn { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes lcwStepIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes lcwErrIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .lcw-overlay, .lcw-modal, .lcw-stepwrap.lcw-anim, .lcw-err { animation: none; } }
@media (max-width: 820px) {
  .lcw-cols { grid-template-columns: 1fr; }
  .lcw-aside { position: static; }
  .lcw-grid, .lcw-dgrid { grid-template-columns: repeat(2, 1fr); }
}

/* Toggle Cơ bản / Chi tiết — viền rõ để nút chưa chọn (trắng) không bị hoà vào nền */
.lc-variant-toggle .btn-check:checked + .btn { background: var(--primary-gradient, linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)); border-color: #7c6cf0; color: #fff; box-shadow: none; }
.lc-variant-toggle .btn-check:not(:checked) + .btn { border: 1.5px solid #cbd5e1; background: #f8fafc; color: #475569; }
.lc-variant-toggle .btn-check:not(:checked) + .btn:hover { background: #eef2f7; border-color: #94a3b8; }
[data-bs-theme="dark"] .lc-variant-toggle .btn-check:not(:checked) + .btn { border-color: #475569; background: #1e293b; color: #cbd5e1; }
[data-bs-theme="dark"] .lc-variant-toggle .btn-check:not(:checked) + .btn:hover { background: #273449; border-color: #64748b; }

/* Segmented "Chế độ đặt tên" — Tạo Page: nút chưa chọn plain, hover chỉ hiện viền tím (không fill để chữ luôn đọc được) */
.tp-seg .btn-check:checked + .btn { background: var(--primary-gradient, linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)); border-color: #7c6cf0; color: #fff; box-shadow: none; }
.tp-seg .btn-check:not(:checked) + .btn { border: 1.5px solid #e2e8f0; background: transparent; color: #475569; }
.tp-seg .btn-check:not(:checked) + .btn:hover { background: transparent; border-color: #6366f1; color: #6366f1; }
[data-bs-theme="dark"] .tp-seg .btn-check:not(:checked) + .btn { border-color: #334155; background: transparent; color: #cbd5e1; }
[data-bs-theme="dark"] .tp-seg .btn-check:not(:checked) + .btn:hover { border-color: #818cf8; color: #a5b4fc; }

/* ===== Đồng bộ BM — popup tiến trình (light, hợp giao diện) ===== */
.bms-log {
  height: 240px;
  overflow-y: auto;
  background: var(--bg-body, #f8fafc);
  border: 1px solid var(--border-light, rgba(0, 0, 0, 0.05));
  border-radius: var(--radius-md, 10px);
  padding: 8px 10px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-secondary, #64748b);
  word-break: break-word;
}
.bms-line { padding: 1px 0; }
.bms-line .bms-time { color: var(--text-muted, #94a3b8); margin-right: 4px; }
.bms-line.is-ok { color: #047857; }
.bms-line.is-err { color: #dc2626; }
.bms-line.is-warn { color: #b45309; }
.bms-line.is-run { color: var(--text-secondary, #64748b); }
.bms-line.is-done { color: #7c3aed; font-weight: 600; }

[data-bs-theme="dark"] .bms-log { background: #1b2433; border-color: rgba(255, 255, 255, 0.08); color: #cbd5e1; }
[data-bs-theme="dark"] .bms-line.is-ok { color: #34d399; }
[data-bs-theme="dark"] .bms-line.is-err { color: #f87171; }
[data-bs-theme="dark"] .bms-line.is-warn { color: #fbbf24; }
[data-bs-theme="dark"] .bms-line.is-run { color: #cbd5e1; }
[data-bs-theme="dark"] .bms-line.is-done { color: #a78bfa; }

/* ===== Đổi thông tin Page — mỗi mục là 1 HỘP VIỀN riêng, ô nhập nằm TRONG hộp
   và ngăn bằng đường kẻ (đúng khuôn thẻ chức năng lớn bên ngoài). ===== */
.cpi-item {
  border: 1px solid var(--border-color, #e5e7eb); border-radius: 8px;
  background: #fff; margin-bottom: 8px; overflow: hidden;
}
.cpi-item:last-child { margin-bottom: 0; }
.cpi-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; margin: 0; cursor: pointer;
}
.cpi-row .form-check-input {
  width: 34px; height: 18px; margin: 0; flex-shrink: 0; cursor: pointer;
}
.cpi-head { display: flex; align-items: center; gap: 10px; margin: 0; }
.cpi-ic { color: #0ea5e9; font-size: 18px; flex-shrink: 0; }
.cpi-panel {
  padding: 10px 12px;
  border-top: 1px solid var(--border-color, #e5e7eb);
}
[data-bs-theme="dark"] .cpi-item { background: #262f3c; border-color: #2e3a4b; }
[data-bs-theme="dark"] .cpi-panel { border-top-color: #2e3a4b; }

/* Nút "Huỷ" liên kết Zalo/Telegram — pill đỏ nhạt bo tròn (mềm, đồng bộ nút danger).
   Tự khai báo đủ shape vì setting.html link style.css KHÔNG có ?v= (cache cũ không chắc có). */
.st-zalo-unlink-head {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.st-zalo-unlink-head:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}
[data-bs-theme="dark"] .st-zalo-unlink-head {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.32);
}


/* ===== Nút hỗ trợ nổi ở màn đăng nhập/đăng ký ===== */
.au-sup { position: fixed; right: 22px; bottom: 22px; z-index: 9998; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.au-sup-fab { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border: none; border-radius: 50px; background: linear-gradient(135deg, var(--primary-end, #8b5cf6), #06b6d4); color: #fff; font-weight: 700; font-size: 14px; cursor: pointer; box-shadow: 0 8px 24px rgba(var(--primary-end-rgb, 139, 92, 246),.45); transition: transform .2s, box-shadow .2s; }
.au-sup-fab i { font-size: 20px; }
.au-sup-fab:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(var(--primary-end-rgb, 139, 92, 246),.55); }
.au-sup-panel { width: 290px; background: #0f172a; border: 1px solid rgba(255,255,255,.1); border-radius: 16px; padding: 16px; box-shadow: 0 16px 44px rgba(0,0,0,.4); opacity: 0; transform: translateY(12px) scale(.96); transform-origin: bottom right; pointer-events: none; transition: .2s; }
.au-sup.open .au-sup-panel { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.au-sup-head { font-size: 15px; font-weight: 800; color: #fff; display: flex; align-items: center; gap: 8px; }
.au-sup-head i { color: #a5b4fc; }
.au-sup-desc { font-size: 12px; color: #94a3b8; margin: 6px 0 12px; line-height: 1.5; }
.au-sup-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 11px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06); text-decoration: none; margin-bottom: 8px; transition: .15s; }
.au-sup-item:last-child { margin-bottom: 0; }
.au-sup-item:hover { background: rgba(var(--primary-end-rgb, 139, 92, 246),.15); border-color: rgba(var(--primary-end-rgb, 139, 92, 246),.4); }
.au-sup-item i { font-size: 22px; color: #38bdf8; flex: 0 0 auto; }
.au-sup-item b { display: block; font-size: 13px; color: #fff; font-weight: 700; }
.au-sup-item span { font-size: 11px; color: #94a3b8; }
@media (max-width: 640px) { .au-sup { right: 14px; bottom: 14px; } .au-sup-panel { width: min(290px, 86vw); } }

/* ===== Popup Khuyến mãi nạp tiền (mẫu 29 + aura xoay) ===== */
@property --dppAng { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.dpp-overlay { position: fixed; inset: 0; z-index: 4000; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(2,6,23,.55); backdrop-filter: blur(3px); animation: dppFade .2s ease; }
@keyframes dppFade { from { opacity: 0; } to { opacity: 1; } }
.dpp-wrap { position: relative; animation: dppPop .28s cubic-bezier(.34,1.56,.64,1); }
@keyframes dppPop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
/* Vòng sáng gradient xoay mờ (aura nổi khối) */
.dpp-wrap::before {
  content: ""; position: absolute; inset: -6px; border-radius: 28px; z-index: 1;
  background: conic-gradient(from var(--dppAng), #7c3aed, #22d3ee, #ec4899, #f59e0b, #7c3aed);
  filter: blur(13px); opacity: .85; animation: dppSpin 5s linear infinite;
}
@keyframes dppSpin { to { --dppAng: 360deg; } }
.dpp-pop { position: relative; z-index: 2; width: 320px; max-width: 88vw; border-radius: 22px; overflow: hidden; background: #faf5ff; box-shadow: 0 24px 60px rgba(0,0,0,.55); }
.dpp-pop::before { content: ""; position: absolute; width: 180px; height: 180px; background: radial-gradient(circle, #c4b5fd, transparent 70%); top: -40px; left: -40px; }
.dpp-pop::after  { content: ""; position: absolute; width: 180px; height: 180px; background: radial-gradient(circle, #a5f3fc, transparent 70%); bottom: -40px; right: -40px; }
.dpp-body { position: relative; z-index: 2; padding: 26px 24px 22px; text-align: center; }
.dpp-ic { font-size: 36px; color: #7c3aed; line-height: 1; }
.dpp-body h2 { color: #4c1d95; font-size: 19px; margin: 6px 0 0; }
.dpp-big { background: linear-gradient(135deg,#7c3aed,#0891b2); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 42px; font-weight: 900; margin: 6px 0; line-height: 1.05; }
.dpp-body p { color: #6b7280; font-size: 13px; line-height: 1.55; margin: 0; }
.dpp-min { display: inline-flex; align-items: center; gap: 5px; margin-top: 12px; padding: 4px 12px; border-radius: 20px; background: rgba(124,58,237,.1); color: #7c3aed; font-size: 12px; font-weight: 700; }
.dpp-cta { display: block; width: 100%; border: none; border-radius: 12px; padding: 12px; font-size: 14.5px; font-weight: 800; color: #fff; cursor: pointer; margin-top: 16px; background: linear-gradient(135deg,#7c3aed,#0891b2); transition: filter .15s ease; }
.dpp-cta:hover { filter: brightness(1.07); }
.dpp-skip { display: block; width: 100%; text-align: center; background: none; border: none; font-size: 12.5px; color: #a78bfa; cursor: pointer; margin-top: 10px; }
.dpp-skip:hover { color: #7c3aed; }
.dpp-close { position: absolute; top: 12px; right: 12px; z-index: 5; width: 26px; height: 26px; border-radius: 50%; border: none; background: #ede9fe; color: #7c3aed; display: grid; place-items: center; cursor: pointer; font-size: 15px; }
.dpp-close:hover { background: #ddd6fe; }
@media (prefers-reduced-motion: reduce) { .dpp-wrap::before { animation: none; } }
/* Dark mode: giữ popup sáng (thiết kế mẫu 29 nền sáng) — chỉ chỉnh overlay đậm hơn chút */
[data-bs-theme="dark"] .dpp-overlay { background: rgba(0,0,0,.66); }

/* Banner KM ở tab Nạp tiền — viền gradient xoay nhẹ (đồng bộ mẫu 29) */
.dpb { display: flex; flex-shrink: 0; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; margin-bottom: 18px; position: relative; overflow: hidden; background: linear-gradient(135deg, rgba(124,58,237,.10), rgba(6,182,212,.08)); border: 1px solid rgba(124,58,237,.22); }
.dpb::before { content: ""; position: absolute; inset: 0; border-radius: 14px; padding: 1.5px; background: conic-gradient(from var(--dppAng), #7c3aed, #22d3ee, #ec4899, #7c3aed); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: dppSpin 5s linear infinite; opacity: .7; pointer-events: none; }
.dpb-ic { font-size: 26px; color: #7c3aed; flex: 0 0 auto; line-height: 1; }
.dpb-main { flex: 1 1 auto; min-width: 0; }
.dpb-title { font-weight: 800; color: #4c1d95; font-size: 15px; }
.dpb-desc { font-size: 12.5px; color: #6b7280; margin-top: 2px; line-height: 1.4; }
.dpb-min { font-size: 11.5px; font-weight: 700; color: #7c3aed; margin-top: 4px; }
[data-bs-theme="dark"] .dpb-min { color: #c4b5fd; }
.dpb-reward { flex: 0 0 auto; font-weight: 900; font-size: 22px; background: linear-gradient(135deg,#7c3aed,#0891b2); -webkit-background-clip: text; background-clip: text; color: transparent; white-space: nowrap; }
[data-bs-theme="dark"] .dpb { background: linear-gradient(135deg, rgba(124,58,237,.18), rgba(6,182,212,.12)); border-color: rgba(var(--primary-end-rgb, 139, 92, 246),.4); }
[data-bs-theme="dark"] .dpb-title { color: #c4b5fd; }
[data-bs-theme="dark"] .dpb-desc { color: #94a3b8; }
[data-bs-theme="dark"] .dpb-reward { background: linear-gradient(135deg,#a78bfa,#22d3ee); -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (prefers-reduced-motion: reduce) { .dpb::before { animation: none; } }

/* ===== Hộp thư & Thống kê tin nhắn Page (page-inbox.js) ===== */
/* Messenger mode (F5 trên /messenger): ẩn grid Pages NGAY (msngr-mode set ở đầu <head>) để KHÔNG
   nháy grid trước khi inbox overlay mount. Nền trắng/tối cho tới khi inbox hiện. */
.msngr-mode #app[data="page"] .account-wrapper > *:not(.pmb-overlay) { visibility: hidden !important; }
.msngr-mode #app[data="page"] #adPanel { display: none !important; }
.msngr-mode #app[data="page"] .account-wrapper { background: #fff; }
[data-bs-theme="dark"].msngr-mode #app[data="page"] .account-wrapper { background: #1a212b; }
/* Mount ĐÈ KÍN .account-wrapper (không phải popup nổi) — z-index 100 để phủ cả #adPanel(10)+footer(20) */
.pmb-overlay { position: absolute; inset: 0; z-index: 100; background: #fff; animation: lcwOvIn .16s ease; }
.pmb-modal { background: #fff; width: 100%; height: 100%; display: flex; flex-direction: column; overflow: hidden; position: relative; animation: pmbSlideIn .24s cubic-bezier(.16,1,.3,1); }
@keyframes pmbSlideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
/* Header */
.pmb-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #eef2f7; flex-shrink: 0; }
.pmb-title { font-weight: 700; font-size: 16px; color: #111827; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.pmb-title i { color: var(--primary-start, #6366f1); font-size: 20px; }
.pmb-back { display: inline-flex; align-items: center; gap: 5px; border: 1px solid #e2e8f0; background: #fff; border-radius: 9px; padding: 7px 11px 7px 9px; font-size: 13px; font-weight: 600; color: #475569; cursor: pointer; white-space: nowrap; transition: all .15s; }
.pmb-back:hover { background: #f5f3ff; border-color: #c4b5fd; color: var(--primary-start, #6366f1); }
.pmb-back i { font-size: 17px; }
.pmb-pagesel { border: 1px solid #e2e8f0; border-radius: 9px; padding: 7px 11px; font-size: 13px; color: #334155; background: #fff; max-width: 220px; outline: none; }
.pmb-pagesel:focus { border-color: var(--primary-end, #8b5cf6); }
.pmb-tabs { display: inline-flex; background: #f1f5f9; border-radius: 10px; padding: 3px; gap: 2px; }
.pmb-tab-btn { border: none; background: none; border-radius: 8px; padding: 6px 14px; font-size: 13px; font-weight: 600; color: #64748b; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; transition: all .15s; }
.pmb-tab-btn.on { background: #fff; color: var(--primary-start, #6366f1); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.pmb-head-sp { flex: 1; }
.pmb-icon { border: 1px solid #e2e8f0; background: #fff; width: 34px; height: 34px; border-radius: 9px; color: #64748b; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; transition: all .15s; }
.pmb-icon:hover { background: #f8fafc; color: #334155; }
.pmb-close:hover { background: #fee2e2; color: #ef4444; border-color: #fecaca; }
/* Body layout */
.pmb-body { flex: 1; min-height: 0; overflow: hidden; }
.pmb-tab-inbox { display: grid; grid-template-columns: 320px 1fr 268px; height: 100%; }
/* Cột danh sách */
.pmb-col-list { border-right: 1px solid #eef2f7; display: flex; flex-direction: column; min-height: 0; }
.pmb-list-top { padding: 11px 12px 8px; display: flex; flex-direction: column; gap: 8px; }
.pmb-search-box { display: flex; align-items: center; gap: 7px; background: #f1f5f9; border-radius: 9px; padding: 8px 11px; }
.pmb-search-box i { color: #94a3b8; }
.pmb-search { border: none; background: none; outline: none; font-size: 13px; color: #1e293b; width: 100%; }
.pmb-list-count { font-size: 11px; color: #94a3b8; font-weight: 600; }
.pmb-filters { display: flex; gap: 6px; padding: 0 12px 8px; overflow-x: auto; flex-wrap: nowrap; }
.pmb-chip { border: 1px solid #e2e8f0; background: #fff; border-radius: 20px; padding: 4px 12px; font-size: 12px; color: #475569; cursor: pointer; white-space: nowrap; transition: all .15s; }
.pmb-chip:hover { border-color: #c4b5fd; }
.pmb-chip.on { background: #eef2ff; border-color: #818cf8; color: #4f46e5; font-weight: 600; }
.pmb-conv-list { flex: 1; overflow-y: auto; min-height: 0; }
.pmb-conv { display: flex; gap: 10px; padding: 11px 12px; cursor: pointer; border-bottom: 1px solid #f5f7fa; transition: background .12s; }
.pmb-conv:hover { background: #f8fafc; }
.pmb-conv.active { background: #eff6ff; }
.pmb-conv-mid { flex: 1; min-width: 0; }
.pmb-conv-top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.pmb-conv-name { font-weight: 600; font-size: 13.5px; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pmb-conv-time { font-size: 11px; color: #94a3b8; flex-shrink: 0; }
.pmb-conv-snip { font-size: 12.5px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.pmb-conv-page { font-size: 11px; color: #94a3b8; margin-top: 3px; display: inline-flex; align-items: center; gap: 3px; }
.pmb-conv-tags { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.pmb-conv-end { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; }
.pmb-unread { background: #ef4444; color: #fff; border-radius: 20px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.pmb-av { width: 42px; height: 42px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; position: relative; overflow: hidden; }
.pmb-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pmb-av-sm { width: 36px; height: 36px; font-size: 13px; }
.pmb-av-lg { width: 64px; height: 64px; font-size: 22px; }
.pmb-tag { display: inline-block; border: 1px solid; border-radius: 20px; padding: 1px 8px; font-size: 10.5px; font-weight: 600; line-height: 1.5; }
.pmb-loadmore { padding: 10px 12px; text-align: center; }
.pmb-sentinel i { font-size: 20px; color: #94a3b8; }
/* Cột luồng tin nhắn */
.pmb-col-thread { display: flex; flex-direction: column; min-height: 0; background: #fbfcfe; }
.pmb-thread-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid #eef2f7; background: #fff; flex-shrink: 0; min-height: 60px; }
.pmb-thread-hi { flex: 1; min-width: 0; }
.pmb-thread-name { font-weight: 700; font-size: 14.5px; color: #1e293b; }
.pmb-thread-sub { font-size: 12px; color: #94a3b8; display: inline-flex; align-items: center; gap: 4px; }
.pmb-thread-open { color: #94a3b8; font-size: 18px; text-decoration: none; }
.pmb-thread-open:hover { color: var(--primary-start, #6366f1); }
.pmb-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 2px; min-height: 0; }
/* Kiểu Messenger: mỗi tin 1 HÀNG; khách có avatar bên trái (chỉ tin cuối cụm); tin mình bên phải. */
.pmb-msg { display: flex; align-items: flex-end; gap: 7px; max-width: 100%; }
.pmb-msg.in { justify-content: flex-start; }
.pmb-msg.out { justify-content: flex-end; }
.pmb-msg.grp-last { margin-bottom: 9px; } /* dãn cách giữa các cụm */
.pmb-msg-av { width: 28px; height: 28px; border-radius: 50%; overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 700; }
.pmb-msg-av.empty { background: none !important; } /* spacer giữ bubble thẳng hàng khi không có avatar */
.pmb-msg-av img { width: 100%; height: 100%; object-fit: cover; }
.pmb-bubble { padding: 8px 12px; border-radius: 16px; font-size: 13.5px; line-height: 1.45; word-break: break-word; max-width: 68%; }
.pmb-msg.in .pmb-bubble { background: #f0f2f5; color: #1e293b; }
.pmb-msg.out .pmb-bubble { background: var(--primary-gradient, linear-gradient(135deg,#6366f1,#8b5cf6)); color: #fff; }
.pmb-msg-pend, .pmb-msg-err { font-size: 12px; align-self: flex-end; margin-bottom: 3px; }
.pmb-msg-txt { white-space: pre-wrap; }
.pmb-msg-img { max-width: 200px; max-height: 200px; border-radius: 10px; display: block; margin-top: 2px; }
.pmb-msg-file { display: inline-flex; align-items: center; gap: 5px; color: inherit; text-decoration: underline; font-size: 13px; }
.pmb-msg-meta { font-size: 10.5px; color: #b0bac9; margin-top: 3px; padding: 0 4px; }
.pmb-msg-pend { color: #f59e0b; }
.pmb-msg-err { color: #ef4444; }
.pmb-seen { width: 16px; height: 16px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 1px rgba(0,0,0,.06); flex-shrink: 0; }
.pmb-seen img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pmb-seen-row { display: flex; align-items: center; justify-content: flex-end; gap: 5px; margin: 1px 2px 4px; }
.pmb-seen-t { font-size: 10.5px; color: #94a3b8; }
[data-bs-theme="dark"] .pmb-seen-t { color: #64748b; }
/* Composer */
.pmb-composer { border-top: 1px solid #eef2f7; background: #fff; padding: 8px 12px 10px; flex-shrink: 0; }
.pmb-noreply { background: #fffbeb; border: 1px solid #fde68a; color: #b45309; font-size: 12px; padding: 6px 10px; border-radius: 8px; margin-bottom: 7px; }
.pmb-comp-tools { display: flex; gap: 3px; margin-bottom: 5px; }
.pmb-ct { border: none; background: none; width: 32px; height: 32px; border-radius: 8px; color: #64748b; cursor: pointer; font-size: 18px; display: inline-flex; align-items: center; justify-content: center; transition: all .15s; }
.pmb-ct:hover { background: #f1f5f9; color: var(--primary-start, #6366f1); }
.pmb-comp-row { display: flex; align-items: flex-end; gap: 8px; }
.pmb-input { flex: 1; border: 1px solid #e2e8f0; border-radius: 12px; padding: 9px 13px; font-size: 13.5px; color: #1e293b; outline: none; resize: none; max-height: 120px; line-height: 1.4; font-family: inherit; }
.pmb-input:focus { border-color: var(--primary-end, #8b5cf6); box-shadow: 0 0 0 3px rgba(var(--primary-end-rgb, 139, 92, 246),.12); }
.pmb-send { border: none; background: var(--primary-gradient, linear-gradient(135deg,#6366f1,#8b5cf6)); color: #fff; width: 40px; height: 40px; border-radius: 12px; cursor: pointer; font-size: 18px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all .15s; }
.pmb-send:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(var(--primary-rgb, 99, 102, 241),.4); }
.pmb-send:active { transform: scale(.95); }
/* Cột thông tin */
.pmb-col-info { border-left: 1px solid #eef2f7; overflow-y: auto; }
.pmb-info { padding: 16px 14px; }
.pmb-info-cust { text-align: center; padding-bottom: 14px; border-bottom: 1px solid #f1f5f9; }
.pmb-av-lg { margin: 0 auto 9px; }
.pmb-info-name { font-weight: 700; font-size: 15px; color: #1e293b; }
.pmb-info-page { font-size: 12px; color: #94a3b8; margin-top: 2px; display: inline-flex; align-items: center; gap: 4px; }
.pmb-info-stat { font-size: 11.5px; color: #94a3b8; margin-top: 4px; }
.pmb-info-sec { padding: 14px 0; border-bottom: 1px solid #f1f5f9; }
.pmb-info-lbl { font-size: 12px; font-weight: 700; color: #475569; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .3px; }
.pmb-cur-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 9px; }
.pmb-muted { color: #94a3b8; font-size: 12px; }
.pmb-tagopts { display: flex; flex-wrap: wrap; gap: 6px; }
.pmb-tagopt { border: 1px solid #e2e8f0; background: #fff; border-radius: 8px; padding: 4px 10px; font-size: 12px; color: #475569; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; transition: all .15s; }
.pmb-tagopt:hover { border-color: var(--tc,#c4b5fd); }
.pmb-tagopt.on { background: color-mix(in srgb, var(--tc,#6366f1) 12%, #fff); border-color: var(--tc,#6366f1); color: var(--tc,#4f46e5); font-weight: 600; }
.pmb-tagnew { border: 1px dashed #cbd5e1; background: none; border-radius: 8px; padding: 4px 10px; font-size: 12px; color: var(--primary-start, #6366f1); cursor: pointer; display: inline-flex; align-items: center; gap: 3px; }
.pmb-tagnew:hover { border-color: var(--primary-end, #8b5cf6); background: #faf5ff; }
.pmb-note { width: 100%; border: 1px solid #e2e8f0; border-radius: 10px; padding: 9px 11px; font-size: 13px; color: #1e293b; outline: none; resize: vertical; font-family: inherit; }
.pmb-note:focus { border-color: var(--primary-end, #8b5cf6); box-shadow: 0 0 0 3px rgba(var(--primary-end-rgb, 139, 92, 246),.1); }
/* Empty / loading */
.pmb-empty { padding: 20px; text-align: center; color: #94a3b8; font-size: 13px; }
.pmb-empty-big { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; height: 100%; }
.pmb-empty-big i { font-size: 40px; opacity: .5; }
/* Chưa đăng nhập FB (trang /messenger) — phủ kín modal, canh giữa; nội dung dùng .fx-grid-empty* cho ĐỒNG BỘ với grid */
.pmb-nologin { position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: #fff; }
[data-bs-theme="dark"] .pmb-nologin { background: #1e2530; }
.pmb-spin { animation: pmbSpin 1s linear infinite; display: inline-block; }
@keyframes pmbSpin { to { transform: rotate(360deg); } }
/* Popover (emoji / quick / tag) */
.pmb-pop { position: absolute; z-index: 5; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: 0 12px 34px rgba(15,23,42,.2); padding: 8px; }
.pmb-pop-emoji { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; width: 292px; max-height: 210px; overflow-y: auto; }
.pmb-emo { border: none; background: none; font-size: 20px; cursor: pointer; border-radius: 7px; padding: 4px; line-height: 1; }
.pmb-emo:hover { background: #f1f5f9; }
.pmb-pop-quick { width: 300px; }
.pmb-pop-hd { font-weight: 700; font-size: 13px; color: #334155; padding: 4px 6px 8px; }
.pmb-quick-list { max-height: 200px; overflow-y: auto; }
.pmb-quick-item { display: flex; align-items: center; gap: 6px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.pmb-quick-item:hover { background: #f5f3ff; }
.pmb-quick-t { flex: 1; font-size: 13px; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pmb-quick-x { color: #cbd5e1; cursor: pointer; }
.pmb-quick-x:hover { color: #ef4444; }
.pmb-quick-add { border-top: 1px solid #f1f5f9; margin-top: 6px; padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.pmb-quick-title, .pmb-quick-text, .pmb-tag-name { border: 1px solid #e2e8f0; border-radius: 8px; padding: 7px 10px; font-size: 13px; outline: none; font-family: inherit; resize: none; }
.pmb-quick-title:focus, .pmb-quick-text:focus, .pmb-tag-name:focus { border-color: var(--primary-end, #8b5cf6); }
.pmb-btn-primary { border: none; background: var(--primary-gradient, linear-gradient(135deg,#6366f1,#8b5cf6)); color: #fff; border-radius: 9px; padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
.pmb-btn-primary:hover { filter: brightness(1.05); }
.pmb-btn-ghost { border: 1px solid #e2e8f0; background: #fff; border-radius: 9px; padding: 7px 14px; font-size: 13px; color: #475569; cursor: pointer; }
.pmb-btn-ghost:hover { background: #f8fafc; border-color: #c4b5fd; }
.pmb-pop-tag { width: 230px; display: flex; flex-direction: column; gap: 8px; }
.pmb-tag-colors { display: flex; gap: 6px; flex-wrap: wrap; }
.pmb-cdot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.pmb-cdot.on { border-color: #1e293b; box-shadow: 0 0 0 2px #fff inset; }
/* Bộ chọn Trang cho Messenger */
.pmb-picker-ov { position: absolute; inset: 0; z-index: 20; background: rgba(15,23,42,.35); display: flex; align-items: center; justify-content: center; padding: 24px; }
.pmb-picker { background: #fff; border-radius: 16px; width: 560px; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(15,23,42,.35); overflow: hidden; animation: pmbSlideIn .24s cubic-bezier(.16,1,.3,1); }
.pmb-picker-hd { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid #eef2f7; }
.pmb-picker-ic { width: 42px; height: 42px; border-radius: 12px; background: var(--primary-gradient, linear-gradient(135deg,#6366f1,#8b5cf6)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.pmb-picker-hi { flex: 1; }
.pmb-picker-title { font-weight: 800; font-size: 16px; color: #1e293b; }
.pmb-picker-sub { font-size: 12.5px; color: #64748b; margin-top: 2px; line-height: 1.45; }
.pmb-picker-x { flex-shrink: 0; }
.pmb-picker-tools { display: flex; align-items: center; gap: 8px; padding: 12px 20px; }
.pmb-picker-sb { flex: 1; }
.pmb-picker-search { border: none; background: none; outline: none; font-size: 13px; color: #1e293b; width: 100%; }
.pmb-picker-list { flex: 1; overflow-y: auto; padding: 0 12px; min-height: 120px; }
.pmb-pick { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.pmb-pick:hover { background: #f5f3ff; }
.pmb-pick-name { flex: 1; font-size: 13.5px; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pmb-pick input { width: 18px; height: 18px; accent-color: var(--primary-start, #6366f1); cursor: pointer; flex-shrink: 0; }
.pmb-picker-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid #eef2f7; }
.pmb-picker-count { font-size: 13px; color: #64748b; font-weight: 600; }
.pmb-picker-save { padding: 9px 22px; font-size: 14px; }
[data-bs-theme="dark"] .pmb-picker { background: #1e2530; }
[data-bs-theme="dark"] .pmb-picker-hd, [data-bs-theme="dark"] .pmb-picker-foot { border-color: #2e3947; }
[data-bs-theme="dark"] .pmb-picker-title { color: #e5e9f0; }
[data-bs-theme="dark"] .pmb-pick:hover { background: #262f3c; }
[data-bs-theme="dark"] .pmb-pick-name, [data-bs-theme="dark"] .pmb-picker-search { color: #e5e9f0; }
/* Thống kê */
.pmb-tab-stats { height: 100%; overflow-y: auto; padding: 18px 22px; }
.pmb-stats-scope { font-size: 13px; color: #475569; margin-bottom: 14px; }
.pmb-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 18px; }
.pmb-kpi { border: 1px solid #eef2f7; border-radius: 13px; padding: 14px; display: flex; align-items: center; gap: 11px; background: #fff; }
.pmb-kpi-ic { width: 42px; height: 42px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-size: 21px; flex-shrink: 0; }
.pmb-kpi-val { font-size: 22px; font-weight: 800; color: #1e293b; line-height: 1; }
.pmb-kpi-lbl { font-size: 12px; color: #64748b; margin-top: 4px; }
.pmb-stats-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pmb-stats-card { border: 1px solid #eef2f7; border-radius: 13px; padding: 16px; }
.pmb-stats-h { font-weight: 700; font-size: 14px; color: #334155; margin-bottom: 13px; }
.pmb-bars { display: flex; flex-direction: column; gap: 9px; }
.pmb-bar-row { display: flex; align-items: center; gap: 10px; }
.pmb-bar-lbl { width: 120px; font-size: 12.5px; color: #475569; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.pmb-bar-track { flex: 1; height: 9px; background: #f1f5f9; border-radius: 20px; overflow: hidden; }
.pmb-bar-fill { height: 100%; background: linear-gradient(90deg,var(--primary-start, #6366f1),var(--primary-end, #8b5cf6)); border-radius: 20px; }
.pmb-bar-val { width: 36px; text-align: right; font-size: 12.5px; font-weight: 700; color: #334155; }
.pmb-table-wrap { overflow-x: auto; }
.pmb-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.pmb-table th { text-align: left; color: #94a3b8; font-weight: 600; padding: 6px 8px; border-bottom: 1px solid #eef2f7; white-space: nowrap; }
.pmb-table td { padding: 7px 8px; border-bottom: 1px solid #f5f7fa; color: #334155; }
.pmb-table tr:last-child td { border-bottom: none; }
@media (max-width: 900px) {
  .pmb-tab-inbox { grid-template-columns: 1fr; }
  .pmb-col-info { display: none; }
  .pmb-kpis { grid-template-columns: repeat(2, 1fr); }
  .pmb-stats-2col { grid-template-columns: 1fr; }
}
/* Dark mode */
[data-bs-theme="dark"] .pmb-overlay { background: #1a212b; }
[data-bs-theme="dark"] .pmb-modal { background: #1e2530; }
[data-bs-theme="dark"] .pmb-back { background: #262f3c; border-color: #384354; color: #cbd5e1; }
[data-bs-theme="dark"] .pmb-back:hover { background: #303b4a; color: #a5b4fc; }
[data-bs-theme="dark"] .pmb-head { border-color: #2e3947; }
[data-bs-theme="dark"] .pmb-title { color: #e5e9f0; }
[data-bs-theme="dark"] .pmb-pagesel { background: #262f3c; border-color: #384354; color: #cbd5e1; }
[data-bs-theme="dark"] .pmb-tabs { background: #262f3c; }
[data-bs-theme="dark"] .pmb-tab-btn.on { background: #1e2530; color: #a5b4fc; }
[data-bs-theme="dark"] .pmb-icon { background: #262f3c; border-color: #384354; color: #94a3b8; }
[data-bs-theme="dark"] .pmb-icon:hover { background: #303b4a; }
[data-bs-theme="dark"] .pmb-col-list, [data-bs-theme="dark"] .pmb-col-info { border-color: #2e3947; }
[data-bs-theme="dark"] .pmb-search-box { background: #262f3c; }
[data-bs-theme="dark"] .pmb-search { color: #e5e9f0; }
[data-bs-theme="dark"] .pmb-chip { background: #262f3c; border-color: #384354; color: #94a3b8; }
[data-bs-theme="dark"] .pmb-chip.on { background: #312e81; border-color: var(--primary-start, #6366f1); color: #c7d2fe; }
[data-bs-theme="dark"] .pmb-conv { border-color: #262f3c; }
[data-bs-theme="dark"] .pmb-conv:hover { background: #262f3c; }
[data-bs-theme="dark"] .pmb-conv.active { background: #23324a; }
[data-bs-theme="dark"] .pmb-conv-name, [data-bs-theme="dark"] .pmb-thread-name, [data-bs-theme="dark"] .pmb-info-name { color: #e5e9f0; }
[data-bs-theme="dark"] .pmb-conv-snip { color: #94a3b8; }
[data-bs-theme="dark"] .pmb-col-thread { background: #1a212b; }
[data-bs-theme="dark"] .pmb-thread-head { background: #1e2530; border-color: #2e3947; }
[data-bs-theme="dark"] .pmb-msg.in .pmb-bubble { background: #262f3c; border-color: #333e4d; color: #e5e9f0; }
[data-bs-theme="dark"] .pmb-composer { background: #1e2530; border-color: #2e3947; }
[data-bs-theme="dark"] .pmb-input { background: #262f3c; border-color: #384354; color: #e5e9f0; }
[data-bs-theme="dark"] .pmb-ct:hover { background: #303b4a; }
[data-bs-theme="dark"] .pmb-info-sec, [data-bs-theme="dark"] .pmb-info-cust { border-color: #2e3947; }
[data-bs-theme="dark"] .pmb-tagopt { background: #262f3c; border-color: #384354; color: #cbd5e1; }
[data-bs-theme="dark"] .pmb-note { background: #262f3c; border-color: #384354; color: #e5e9f0; }
[data-bs-theme="dark"] .pmb-pop, [data-bs-theme="dark"] .pmb-kpi, [data-bs-theme="dark"] .pmb-stats-card { background: #1e2530; border-color: #2e3947; }
[data-bs-theme="dark"] .pmb-emo:hover, [data-bs-theme="dark"] .pmb-quick-item:hover { background: #262f3c; }
[data-bs-theme="dark"] .pmb-quick-title, [data-bs-theme="dark"] .pmb-quick-text, [data-bs-theme="dark"] .pmb-tag-name { background: #262f3c; border-color: #384354; color: #e5e9f0; }
[data-bs-theme="dark"] .pmb-btn-ghost { background: #262f3c; border-color: #384354; color: #cbd5e1; }
[data-bs-theme="dark"] .pmb-kpi-val { color: #e5e9f0; }
[data-bs-theme="dark"] .pmb-stats-h { color: #cbd5e1; }
[data-bs-theme="dark"] .pmb-bar-track { background: #262f3c; }
[data-bs-theme="dark"] .pmb-table th { border-color: #2e3947; }
[data-bs-theme="dark"] .pmb-table td { border-color: #262f3c; color: #cbd5e1; }
[data-bs-theme="dark"] .pmb-thread-sub, [data-bs-theme="dark"] .pmb-info-page, [data-bs-theme="dark"] .pmb-info-stat, [data-bs-theme="dark"] .pmb-list-count, [data-bs-theme="dark"] .pmb-conv-time, [data-bs-theme="dark"] .pmb-conv-page { color: #64748b; }
[data-bs-theme="dark"] .pmb-info-lbl { color: #94a3b8; }

/* ===== Bình luận (tab .pmb-tab-comments) — reuse .pmb-* cho bubble/avatar/composer, phần riêng bên dưới ===== */
.pmb-tab-comments { display: grid; grid-template-columns: 320px 1fr 268px; height: 100%; }
.pmb-snip-ic { font-size: 12px; color: #94a3b8; }
/* Thẻ bài viết ghim đầu luồng bình luận */
.pmb-post-card { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 1px solid #eef2f7; border-radius: 12px; padding: 10px; margin: 0 0 12px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.pmb-post-thumb { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.pmb-post-noimg { display: flex; align-items: center; justify-content: center; background: #f1f5f9; color: #94a3b8; font-size: 20px; }
.pmb-post-body { min-width: 0; flex: 1; }
.pmb-post-lbl { font-size: 11px; font-weight: 700; color: var(--primary-start, #6366f1); text-transform: uppercase; letter-spacing: .3px; margin-bottom: 2px; }
.pmb-post-txt { font-size: 13px; color: #334155; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pmb-post-link { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--primary-start, #6366f1); text-decoration: none; margin-top: 4px; }
.pmb-post-link:hover { text-decoration: underline; }
/* Toggle chế độ trả lời (công khai / nhắn riêng) */
.pmb-mode { display: inline-flex; gap: 4px; background: #f1f5f9; border-radius: 8px; padding: 3px; margin-bottom: 8px; }
.pmb-mode-btn { border: none; background: none; border-radius: 6px; padding: 4px 10px; font-size: 12px; font-weight: 600; color: #64748b; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; transition: all .15s; }
.pmb-mode-btn.on { background: #fff; color: var(--primary-start, #6366f1); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
/* Hàng thao tác trên mỗi bình luận (hiện khi hover) */
.pmb-tab-comments .pmb-msg { position: relative; }
.pmb-cmt-acts { display: flex; gap: 2px; align-self: center; opacity: .5; transition: opacity .12s; }
.pmb-msg:hover .pmb-cmt-acts { opacity: 1; }
.pmb-cmt-act { width: 26px; height: 26px; border: none; border-radius: 50%; background: #f1f5f9; color: #64748b; cursor: pointer; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; transition: all .12s; }
.pmb-cmt-act:hover { background: #e2e8f0; color: #334155; }
.pmb-cmt-del:hover { background: #fee2e2; color: #dc2626; }
/* Chân bong bóng bình luận (đã ẩn / nhắn riêng / lượt thích) */
.pmb-cmt-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; font-size: 11px; opacity: .9; }
.pmb-cmt-pvt, .pmb-cmt-likes { display: inline-flex; align-items: center; gap: 3px; }
.pmb-cmt-hidden { display: inline-flex; align-items: center; gap: 3px; background: #fef3c7; color: #b45309; padding: 1px 8px; border-radius: 10px; font-weight: 700; font-size: 10.5px; }
.pmb-cmt-pvt { color: var(--primary-end, #8b5cf6); }
.pmb-msg.out .pmb-cmt-foot { color: #e9e5ff; }
/* Loading + kết quả hiện NGAY tại bình luận đang thao tác */
.pmb-cmt-loading { display: inline-flex; align-items: center; gap: 3px; color: #d97706; font-weight: 600; }
.pmb-cmt-flash { display: inline-flex; align-items: center; gap: 3px; color: #16a34a; font-weight: 700; }
.pmb-msg.out .pmb-cmt-loading, .pmb-msg.out .pmb-cmt-flash { color: #fff; }
.pmb-cmt-act-load { pointer-events: none; }
/* Trạng thái ẩn: viền đứt cam + mờ nhẹ → thấy ngay khi ẩn/hiện thành công */
.pmb-bubble-hidden { opacity: .72; border: 1px dashed #f59e0b !important; }
.pmb-msg.hidden .pmb-msg-av { opacity: .5; }
/* Info: preview bài viết */
.pmb-info-post { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 6px; }
.pmb-info-post img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.pmb-info-post-txt { font-size: 12px; color: #64748b; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 900px) { .pmb-tab-comments { grid-template-columns: 1fr; } }
/* Dark mode — Bình luận */
[data-bs-theme="dark"] .pmb-post-card { background: #1e2530; border-color: #2e3947; }
[data-bs-theme="dark"] .pmb-post-noimg { background: #262f3c; }
[data-bs-theme="dark"] .pmb-post-txt { color: #cbd5e1; }
[data-bs-theme="dark"] .pmb-mode { background: #262f3c; }
[data-bs-theme="dark"] .pmb-mode-btn.on { background: #1e2530; color: #a5b4fc; }
[data-bs-theme="dark"] .pmb-cmt-act { background: #262f3c; color: #94a3b8; }
[data-bs-theme="dark"] .pmb-cmt-act:hover { background: #303b4a; color: #cbd5e1; }
[data-bs-theme="dark"] .pmb-cmt-del:hover { background: #4c1d1d; color: #f87171; }
[data-bs-theme="dark"] .pmb-info-post-txt { color: #94a3b8; }
[data-bs-theme="dark"] .pmb-cmt-hidden { background: #3a2e12; color: #fbbf24; }

/* ===== Trả lời 1 tin nhắn (Hộp thư) ===== */
.pmb-tab-inbox .pmb-msg { position: relative; }
.pmb-msg-reply { align-self: center; width: 26px; height: 26px; border: none; border-radius: 50%; background: #f1f5f9; color: #64748b; cursor: pointer; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .12s, background .12s; flex-shrink: 0; }
.pmb-msg:hover .pmb-msg-reply { opacity: .65; }
.pmb-msg-reply:hover { opacity: 1; background: #e2e8f0; color: #334155; }
.pmb-msg-quote { font-size: 11.5px; opacity: .8; border-left: 2px solid currentColor; padding: 1px 0 1px 6px; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pmb-msg.out .pmb-msg-quote { color: #e9e5ff; }
.pmb-reply-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #f8fafc; border-left: 3px solid var(--primary-start, #6366f1); border-radius: 6px; padding: 5px 9px; margin-bottom: 7px; }
.pmb-reply-info { display: flex; align-items: center; gap: 7px; min-width: 0; }
.pmb-reply-info > i { font-size: 15px; flex-shrink: 0; color: var(--primary-start, #6366f1); }
.pmb-reply-txt { min-width: 0; }
.pmb-reply-to { font-size: 11px; font-weight: 700; color: var(--primary-start, #6366f1); }
.pmb-reply-snip { font-size: 12px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pmb-reply-x { border: none; background: none; color: #94a3b8; cursor: pointer; font-size: 16px; padding: 2px; flex-shrink: 0; display: inline-flex; }
.pmb-reply-x:hover { color: #ef4444; }
[data-bs-theme="dark"] .pmb-msg-reply { background: #262f3c; color: #94a3b8; }
[data-bs-theme="dark"] .pmb-msg-reply:hover { background: #303b4a; color: #cbd5e1; }
[data-bs-theme="dark"] .pmb-reply-bar { background: #262f3c; }
[data-bs-theme="dark"] .pmb-reply-snip { color: #94a3b8; }

/* ===== Password input eye toggle (fx-pwd-wrap + fx-pwd-toggle) ===== */
.fx-pwd-wrap { position: relative; display: block; }
.fx-pwd-wrap > .form-control,
.fx-pwd-wrap > input[type="password"],
.fx-pwd-wrap > input[type="text"] { padding-right: 36px; }
.fx-pwd-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 17px;
  color: #6b7280;
  cursor: pointer;
  user-select: none;
  transition: color .15s;
  line-height: 1;
}
.fx-pwd-toggle:hover { color: #374151; }
[data-bs-theme="dark"] .fx-pwd-toggle { color: #9ca3af; }
[data-bs-theme="dark"] .fx-pwd-toggle:hover { color: #e5e7eb; }

/* ===== Password input eye toggle (fx-pwd-wrap + fx-pwd-toggle) ===== */
.fx-pwd-wrap { position: relative; display: block; }
.fx-pwd-wrap > .form-control { padding-right: 36px; }
.fx-pwd-wrap > input[type="password"], .fx-pwd-wrap > input[type="text"] { padding-right: 36px; }

/* ===== HẾT HẠN GÓI: banner nhắc gia hạn + khoá feature card ===== */
:root { --fiox-exp-bar-h: 52px; }
.fiox-expired-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 99990;
  height: var(--fiox-exp-bar-h); box-sizing: border-box;
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(90deg, #b45309, #d97706);
  color: #fff; padding: 9px 16px; font-size: 13.5px;
  box-shadow: 0 -2px 14px rgba(0,0,0,.22);
}
.fiox-expired-bar > i { font-size: 18px; flex-shrink: 0; }
.fiox-expired-bar > span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fiox-expired-bar b { font-weight: 800; }
.fiox-expired-btn {
  border: none; background: #fff; color: #b45309; font-weight: 700;
  padding: 6px 16px; border-radius: 8px; cursor: pointer; white-space: nowrap;
  font-size: 13px; transition: background .15s;
}
.fiox-expired-btn:hover { background: #fffbeb; }
/* Hết hạn: chừa đúng chiều cao banner ở đáy để KHÔNG che chân trang.
   Phải giảm CẢ .account-wrapper (chứa footer, cao calc(100vh - 48px))
   VÀ #adPanel (absolute, neo theo viewport, cao calc(100% - 153px)) —
   giảm 1 cái thì cái kia vẫn thò xuống che footer vừa đẩy lên. */
body.fiox-has-expired-bar .account-wrapper {
  height: calc(100vh - 48px - var(--fiox-exp-bar-h));
}
body.fiox-has-expired-bar #adPanel {
  height: calc(100% - 153px - var(--fiox-exp-bar-h)) !important;
}
/* Feature card đã khoá: xám + overlay bắt click + badge ổ khoá */
.fiox-locked { position: relative; }
.fiox-locked > * { filter: grayscale(.5); opacity: .68; }
.fiox-locked::after {
  content: ""; position: absolute; inset: 0; z-index: 5;
  background: rgba(148,163,184,.1); border-radius: 12px; cursor: not-allowed;
}
.fiox-locked::before {
  content: "🔒 Đã khoá"; position: absolute; top: 8px; right: 10px; z-index: 6;
  background: #b45309; color: #fff; font-size: 10.5px; font-weight: 700;
  padding: 2px 8px; border-radius: 8px; pointer-events: none; letter-spacing: .2px;
}

/* ===== Cột Message: icon trạng thái theo dòng (đang chạy / thành công / lỗi) =====
   Text màu tươi (#ef4444, #16a34a) trên white contrast thấp → chữ mờ/lóa.
   Đổi sang shade đậm hơn (đạt WCAG AA) + font-weight 500 + antialias cho nét. */
.ag-cell[col-id="message"] { cursor: pointer; }
.fxmsg {
  display: inline-flex; align-items: center; gap: 5px;
  min-width: 0; max-width: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}
.fxmsg-ic { flex-shrink: 0; font-size: 15px; line-height: 1; }
.fxmsg-err { color: #dc2626; }
.fxmsg-ok { color: #15803d; }
.fxmsg-run { color: #4f46e5; display: inline-block; animation: spin 0.8s linear infinite; }
.fxmsg-info { color: #64748b; }
.fxmsg-txt {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.fxmsg-t-err .fxmsg-txt { color: #b91c1c; }
.fxmsg-t-ok .fxmsg-txt { color: #15803d; }
[data-bs-theme="dark"] .fxmsg-err { color: #f87171; }
[data-bs-theme="dark"] .fxmsg-t-err .fxmsg-txt { color: #fca5a5; }
[data-bs-theme="dark"] .fxmsg-ok, [data-bs-theme="dark"] .fxmsg-t-ok .fxmsg-txt { color: #86efac; }
[data-bs-theme="dark"] .fxmsg-run { color: #a5b4fc; }
[data-bs-theme="dark"] .fxmsg-info { color: #94a3b8; }
/* ===== Popup tiến trình (bấm ô Message) — overlay timeline khớp modal app ===== */
.fxlog-ov { position: fixed; inset: 0; z-index: 20001; background: rgba(15,23,42,.55); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; padding: 20px; }
.fxlog-modal { width: 100%; max-width: 520px; max-height: 82vh; background: #fff; border-radius: 16px; box-shadow: 0 24px 60px -12px rgba(15,23,42,.45); display: flex; flex-direction: column; overflow: hidden; }
.fxlog-head { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-bottom: 1px solid #eef0f3; flex-shrink: 0; }
.fxlog-h-icon { flex-shrink: 0; width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary-end, #8b5cf6), var(--primary-start, #6366f1)); color: #fff; font-size: 19px; }
.fxlog-h-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fxlog-h-title { font-size: 16px; font-weight: 700; color: #0f172a; line-height: 1.2; }
.fxlog-h-sub { font-size: 12.5px; color: #94a3b8; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fxlog-close { flex-shrink: 0; width: 30px; height: 30px; border: none; border-radius: 50%; background: #f1f5f9; color: #64748b; font-size: 19px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s, color .15s; }
.fxlog-close:hover { background: #e2e8f0; color: #0f172a; }
.fxlog-body { padding: 18px; overflow-y: auto; }
.fxlog-item { display: flex; gap: 12px; position: relative; padding-bottom: 16px; }
.fxlog-item:last-child { padding-bottom: 0; }
.fxlog-item::before { content: ""; position: absolute; left: 12px; top: 27px; bottom: -1px; width: 2px; background: #e5e7eb; }
.fxlog-item:last-child::before { display: none; }
.fxlog-dot { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; z-index: 1; background: #f1f5f9; color: #94a3b8; }
.fxlog-dot.fxmsg-err { background: #fee2e2; color: #ef4444; }
.fxlog-dot.fxmsg-ok { background: #dcfce7; color: #16a34a; }
.fxlog-dot.fxmsg-run { background: #e0e7ff; color: #6366f1; }
.fxlog-dot.fxmsg-run i { display: inline-block; animation: spin 0.8s linear infinite; }
.fxlog-msg { flex: 1; min-width: 0; font-size: 13px; line-height: 1.5; color: #334155; padding-top: 3px; word-break: break-word; }
[data-bs-theme="dark"] .fxlog-modal { background: #1e2530; }
[data-bs-theme="dark"] .fxlog-head { border-bottom-color: #2e3a4b; }
[data-bs-theme="dark"] .fxlog-h-title { color: #e2e8f0; }
[data-bs-theme="dark"] .fxlog-close { background: #2e3a4b; color: #94a3b8; }
[data-bs-theme="dark"] .fxlog-close:hover { background: #3a475a; color: #e2e8f0; }
[data-bs-theme="dark"] .fxlog-item::before { background: #2e3a4b; }
[data-bs-theme="dark"] .fxlog-msg { color: #cbd5e1; }

/* ============================================================
   POPUP HƯỚNG DẪN SỬ DỤNG — 3 PHẦN cố định header/footer, content cuộn
   ------------------------------------------------------------
   CHUẨN: mọi popup hướng dẫn dùng bộ class này.
   • .fx-guide-modal = flex column + max-height + overflow:hidden  (khung)
   • .fx-guide-head  = flex-shrink:0   → HEADER ĐỨNG YÊN khi cuộn
   • .fx-guide-body  = flex:1 + min-height:0 + overflow-y:auto → CHỈ PHẦN NÀY CUỘN
   • .fx-guide-foot  = flex-shrink:0   → FOOTER ĐỨNG YÊN khi cuộn
   (min-height:0 trên body BẮT BUỘC — thiếu nó flex-child không co, không cuộn được)
   ============================================================ */
.fx-guide-ov { position: fixed; inset: 0; z-index: 20001; background: rgba(15,23,42,.55); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; padding: 20px; }
.fx-guide-modal { width: 100%; max-width: 560px; max-height: 85vh; background: #fff; border-radius: 16px; box-shadow: 0 24px 60px -12px rgba(15,23,42,.45); display: flex; flex-direction: column; overflow: hidden; }

/* 1) HEADER — cố định */
.fx-guide-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid #eef0f3; flex-shrink: 0; }
.fx-guide-h-icon { flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary-end, #8b5cf6), var(--primary-start, #6366f1)); color: #fff; font-size: 20px; }
.fx-guide-h-text { flex: 1; min-width: 0; }
.fx-guide-h-title { font-size: 16.5px; font-weight: 700; color: #0f172a; line-height: 1.25; }
.fx-guide-h-sub { font-size: 12.5px; color: #94a3b8; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-guide-close { flex-shrink: 0; width: 32px; height: 32px; border: none; border-radius: 50%; background: #f1f5f9; color: #64748b; font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s, color .15s; }
.fx-guide-close:hover { background: #e2e8f0; color: #0f172a; }

/* 2) CONTENT — CUỘN (chỉ phần này) */
.fx-guide-body { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 20px; font-size: 14px; line-height: 1.65; color: #334155; }
.fx-guide-body h4 { font-size: 14.5px; font-weight: 700; color: #0f172a; margin: 18px 0 8px; }
.fx-guide-body h4:first-child { margin-top: 0; }
.fx-guide-body p { margin: 0 0 10px; }
.fx-guide-body ol, .fx-guide-body ul { margin: 0 0 12px; padding-left: 22px; }
.fx-guide-body li { margin-bottom: 6px; }

/* 3) FOOTER — cố định */
.fx-guide-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid #eef0f3; flex-shrink: 0; }

/* Dark mode */
[data-bs-theme="dark"] .fx-guide-modal { background: #1e2530; }
[data-bs-theme="dark"] .fx-guide-head { border-bottom-color: #2e3a4b; }
[data-bs-theme="dark"] .fx-guide-h-title, [data-bs-theme="dark"] .fx-guide-body h4 { color: #e2e8f0; }
[data-bs-theme="dark"] .fx-guide-body { color: #cbd5e1; }
[data-bs-theme="dark"] .fx-guide-close { background: #2e3a4b; color: #94a3b8; }
[data-bs-theme="dark"] .fx-guide-close:hover { background: #3a475a; color: #e2e8f0; }
[data-bs-theme="dark"] .fx-guide-foot { border-top-color: #2e3a4b; }
[data-bs-theme="dark"] .fxlog-dot { background: #262f3c; }
[data-bs-theme="dark"] .fxlog-dot.fxmsg-err { background: rgba(239,68,68,.18); color: #f87171; }
[data-bs-theme="dark"] .fxlog-dot.fxmsg-ok { background: rgba(22,163,74,.2); color: #4ade80; }
[data-bs-theme="dark"] .fxlog-dot.fxmsg-run { background: rgba(99,102,241,.22); color: #a5b4fc; }

/* ===== Ô tìm nhanh tính năng ở sidebar (TKQC / BM / Pages / Clone) =====
   Hàng dính ngay DƯỚI header "Chức năng" — header cao đúng 40px nên top: 40px. */
/* padding ngang 16px = px-3 của header + p-3 của danh sách card → thẳng mép.
   top: 45px = chiều cao header (đệm 10+11 + nội dung 24) để hàng này dính đúng
   ngay dưới header khi cuộn — đổi đệm header thì phải đổi số này theo. */
.fx-fsearch {
  position: sticky; top: 45px; z-index: 19;
  padding: 0 16px 11px; background: #f8f9fa;
  border-bottom: 1px solid #e5e7eb;
}
/* Icon căn theo VÙNG Ô NHẬP, không theo cả hàng: hàng còn 11px đệm dưới nên
   top:50% của hàng nằm thấp hơn tâm ô nhập. Trừ đúng phần đệm đó rồi flex-center. */
.fx-fsearch-ic {
  position: absolute; left: 26px; top: 0; bottom: 11px;
  display: flex; align-items: center;
  color: #9ca3af; font-size: 14px; pointer-events: none;
}
.fx-fsearch-input {
  width: 100%; height: 30px; padding: 0 30px 0 32px;
  border: 1.5px solid #e5e7eb; border-radius: 8px;
  background: #fff; color: #374151; font-size: 12px;
  outline: none; box-sizing: border-box;
}
.fx-fsearch-input:focus { border-color: #a5b4fc; }
/* type="search" → ẩn nút X mặc định của trình duyệt (đã có nút ✕ riêng .fx-fsearch-clear) */
.fx-fsearch-input::-webkit-search-cancel-button,
.fx-fsearch-input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.fx-fsearch-clear {
  position: absolute; right: 26px; top: 0; bottom: 11px;
  align-items: center;
  color: #9ca3af; font-size: 15px; cursor: pointer; display: none;
}
.fx-fsearch.has-value .fx-fsearch-clear { display: flex; }
.fx-fsearch-clear:hover { color: #ef4444; }
/* Card bị lọc: dùng CLASS riêng, KHÔNG đụng style.display — nút X ẩn feature
   ghi thẳng inline display:none, xoá ô tìm kiếm không được làm nó hiện lại. */
.fx-fsearch-hide { display: none !important; }
.fx-fsearch-empty {
  padding: 18px 12px; text-align: center; color: #9ca3af; font-size: 12.5px;
}
[data-bs-theme="dark"] .fx-fsearch { background: #1e2530; border-bottom-color: #2e3a4b; }
[data-bs-theme="dark"] .fx-fsearch-input { background: #262f3c; border-color: #2e3a4b; color: #e2e8f0; }

/* ===== Popup chọn khoảng thời gian của "Tải hóa đơn" (ads-tai-hoa-don) =====
   Hộp nổi GIỮA màn hình; phần lịch bên trong dùng lại nguyên CSS .drp-* của
   bộ lọc ngày trên thanh công cụ (kể cả bản dark) → chỉ cần style lớp vỏ. */
.ivd-ov {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, .45); padding: 16px;
}
/* width theo NỘI DUNG (lịch 2 tháng = 7 ô 30px + preset + nút điều hướng);
   đặt cứng 660px thì bảng rộng hơn hộp → cuộn ngang dù màn còn thừa chỗ. */
.ivd-pop {
  background: #fff; border-radius: 12px; font-size: 13px;
  width: max-content; max-width: 96vw; max-height: 92vh; overflow: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .22), 0 2px 8px rgba(0, 0, 0, .12);
}
/* Nhãn ngày trong card hẹp (2 cột) → cắt bớt bằng "…" thay vì đẩy tràn nút.
   height 40px = đúng chiều cao select2 bên cạnh (.select2-selection--single). */
#invoiceDlDateBtn {
  overflow: hidden; height: 40px; border-radius: var(--radius-md);
}
#invoiceDlDateBtn > span {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ivd-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 18px; border-bottom: 1px solid #f0f0f0;
  font-weight: 600; font-size: 14px;
}
.ivd-x {
  border: none; background: none; color: #94a3b8; font-size: 19px;
  line-height: 1; padding: 0; cursor: pointer; transition: color .15s;
}
.ivd-x:hover { color: #ef4444; }
[data-bs-theme="dark"] .ivd-pop { background: #1e2530; color: #e2e8f0; }
[data-bs-theme="dark"] .ivd-head { border-bottom-color: #2e3a4b; }
