
#summary-bm, #summary-ads, #summary-page {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.summary-total {
  color: var(--primary);
  font-weight: 700;
}
.summary-live {
  color: var(--status-live);
  font-weight: 700;
}
.summary-die {
  color: var(--status-die);
  font-weight: 700;
}

:root {
  /* Ná»n tá»•ng thá»ƒ */
  --bg-body: #f5f6f8; /* dá»‹u nháº¹ hÆ¡n #6587d6 */
  --bg-white: #ffffff;

  /* MÃ u chÃ­nh */
  --primary: #2563eb; /* xanh dÆ°Æ¡ng tÆ°Æ¡i hiá»‡n Ä‘áº¡i */
  --primary-hover: #1d4ed8;

  /* MÃ u chá»¯ */
  --text-primary: #111827; /* Ä‘áº­m vá»«a pháº£i, khÃ´ng quÃ¡ Ä‘en */
  --text-secondary: #6b7280;

  /* Tráº¡ng thÃ¡i há»‡ thá»‘ng */
  --danger: #dc2626;
  --success: #16a34a;

  /* Border vÃ  shadow */
  --border-color: #d1d5db;
  --shadow-soft: 0 4px 16px rgba(0, 0, 0, 0.06);

  /* HÃ ng Ä‘Æ°á»£c chá»n */
  --row-select: #dbeafe; /* nháº¡t hÆ¡n, dá»‹u hÆ¡n */

  /* Font */
  --font-main: 'Open Sans', sans-serif;
  --table-bg: #ffffff;
  --table-header-bg: #f3f4f6;
  --table-border: #d1d5db;
  --table-text: #111827;
  --table-muted: #6b7280;
  --row-hover: #f1f5f9;
  --row-selected: #dbeafe;
  --status-live: #16a34a;
  --status-die: #dc2626;
  --status-warn: #ea580c;
  --status-muted: #94a3b8;
}


* { box-sizing: border-box; outline: none; }

html, body {
  margin: 0 !important;
  padding: 0 !important;
  width: 100vw;
  height: 100vh;
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-primary);
  overflow: hidden;
  font-size: 11px;
  font-weight: 600;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app-shell {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.main-content-full {
  width: auto;
  height: 102vh;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  flex: 1 1 auto;
  min-width: 0;
}

.table-area {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  gap: 8px;
}


.subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}
.title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-icon-only {
  padding: 8px 10px;
  min-width: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-only i {
  margin: 0 !important;
}

.tool-hidden {
  display: none !important;
}


#ads-search {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  background-color: #fff;
  margin-left: 6px;
}

#ads-search:focus {
  border-color: #3182ce;
}

#global-search {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  background-color: #fff;
  margin-left: 6px;
}

#global-search:focus {
  border-color: #3182ce;
}

#page-search {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  background-color: #fff;
  margin-left: 6px;
}

#page-search:focus {
  border-color: #3182ce;
}
.custom-select {
  padding: 6px 10px;
  border: 1px solid var(--table-border);
  border-radius: 6px;
  font-size: 13px;
  background-color: #fff;
  margin-left: 0;
}

/* Hide legacy selects (replaced by filter icon dropdowns) */
#filter-status,
#filter-verify,
#ads-filter-status,
#ads-filter-type,
#page-filter-status {
  display: none !important;
}

.filter-icon-group {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.filter-icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--table-border);
  border-radius: 10px;
  background: #fff;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.filter-icon-btn:hover {
  background: #f8f9fb;
  color: var(--text-primary);
}

.filter-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 260px;
  max-width: 340px;
  background: #fff;
  border: 1px solid var(--table-border);
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.12);
  padding: 10px;
  z-index: 10000;
}

.filter-dropdown-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
}

.filter-option:hover {
  background: #f8fafc;
}

.filter-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
}

.filter-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.filter-option-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

.filter-count {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: #2563eb;
  color: #fff;
}

.dot-live { background: var(--status-live); }
.dot-die { background: var(--status-die); }
.dot-warn { background: var(--status-warn); }
.dot-muted { background: var(--status-muted); }
.dot-info { background: var(--primary); }

.search-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  min-width: 180px;
}

.search-box i {
  color: var(--table-muted);
  font-size: 12px;
}

.search-box input {
  border: none;
  padding: 0;
  margin: 0;
  font-size: 13px;
  background: transparent;
  min-width: 0;
  line-height: 1.2;
  flex: 1;
}

.search-box input:focus {
  outline: none;
}

.search-box #global-search,
.search-box #ads-search,
.search-box #page-search {
  border: none;
  font-size: 13px;
}

.search-box #global-search:focus,
.search-box #ads-search:focus,
.search-box #page-search:focus {
  border: none;
  box-shadow: none;
}




.status-badge {
  background: white;
  padding: 3px 8px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow-soft);
}

/* Prevent the status badge from growing and shifting header/layout when content changes */
.status-badge {
  max-width: 1080px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.avatar-circle {
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

/* Control Panel (Lá»c & NÃºt) */
.control-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-white);
  padding: 6px 8px;
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.control-panel.header-bar {
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 420px;
  min-width: 0;
  flex-wrap: nowrap;
  overflow: visible;
}

.header-home-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.header-separator {
  width: 1px;
  height: 28px;
  background: #E0E5F2;
  flex: 0 0 auto;
}

.header-right {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  margin-left: auto;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.header-right > * {
  flex-shrink: 0;
}

.header-quick-tools {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
}
.quick-tools-slot {
  display: flex;
  align-items: center;
  gap: 6px;
}
.quick-tool-btn {
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1;
  cursor: grab;
  transition: opacity 0.2s, transform 0.2s;
}
.quick-tool-btn:active {
  cursor: grabbing;
}
.quick-tool-btn.dragging {
  opacity: 0.5;
  cursor: grabbing;
}
.quick-tool-btn.disabled,
.quick-tool-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.tools-group > button[id] {
  cursor: grab;
  transition: opacity 0.2s, transform 0.2s;
}
.tools-group > button[id]:active {
  cursor: grabbing;
}
.tools-group > button[id].dragging {
  opacity: 0.5;
  cursor: grabbing;
}
.quick-tools-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  padding: 6px;
  min-width: 220px;
  max-height: 300px;
  overflow: auto;
  display: none;
  z-index: 1000;
}
.quick-tools-menu.open {
  display: block;
}
.quick-tools-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 6px;
  font-size: 12px;
}
.quick-tools-item:hover {
  background: #f1f5f9;
}
.quick-tools-item.selected {
  background: #e8ebf5;
}
.quick-tools-item-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.quick-tools-item-action {
  font-weight: 700;
  color: var(--primary);
}
.quick-tools-empty {
  padding: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.tab-switch {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Reorder filter bar items: Lọc -> ID -> Tìm kiếm */
.filters-inline .filter-icon-group { order: 1; }
.filters-inline .btn-modal-icon { order: 2; }
.filters-inline .search-box { order: 3; }
.filters-inline .btn-clear-filter { order: 4; }

.tools-panel {
  width: 300px;
  flex: 0 0 300px;
  flex-shrink: 0;
  background: var(--bg-white);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: width 0.2s ease, flex-basis 0.2s ease;
  overflow: visible;
  height: 100%;
  position: relative;
}
.tools-panel.collapsed {
  width: 0;
  flex: 0 0 0;
  border-left: 0;
}
.tools-panel.collapsed .tools-panel-header,
.tools-panel.collapsed .tools-panel-content {
  display: none;
}
.tools-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  background: #f8f9fb;
}
.tools-panel.collapsed .tools-panel-header {
  justify-content: center;
}
.tools-panel-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.tools-panel-toggle {
  border: 1px solid var(--border-color);
  background: #fff;
  color: var(--text-secondary);
  width: 36px;
  height: 56px;
  border-radius: 14px;
  cursor: pointer;
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  box-shadow: var(--shadow-soft);
  z-index: 10;
}
.tools-panel-toggle i {
  transition: transform 0.2s ease;
}
.tools-panel.collapsed .tools-panel-toggle i {
  transform: rotate(180deg);
}
.tools-panel-content {
  padding: 12px;
  overflow: auto;
}
.tools-panel.collapsed .tools-panel-content {
  opacity: 0;
  pointer-events: none;
}
.tools-panel.collapsed .tools-panel-title {
  display: none;
}
.tools-panel .button-group {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.tools-panel .button-group .btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  font-size: 14px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  justify-content: flex-start;
  text-align: left;
  width: 100%;
}
.tools-panel .button-group .btn:hover {
  background: #e5e7eb;
}
.tools-panel .button-group .btn i {
  width: 18px;
  text-align: center;
}
.tools-panel .v-divider {
  display: none;
}

/* Bottom summary bar (12px, simple like screenshot 3) */
.bottom-summary-bar {
  background: var(--bg-white);
  border-top: 0px solid var(--border-color);
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  flex-wrap: nowrap;
}

.bottom-summary-left,
.bottom-summary-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.bottom-summary-left {
  padding: 0;
  border: 0;
  background: transparent;
}

.summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: #111827;
}

.bottom-summary-left .summary-chip + .summary-chip {
  border-left: 1px solid #e5e7eb;
  padding-left: 12px;
  margin-left: 12px;
}

.summary-chip-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 1px 8px;
  border-radius: 6px;
  background: #6b7280;
  color: #ffffff;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.3;
}

.bottom-right-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: #111827; /* label black */
}

.summary-pill span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 1px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.3;
}

/* count colors (apply to number only) */
.pill-live span { background: #16a34a; color: #ffffff; }
.pill-die span { background: #dc2626; color: #ffffff; }
.pill-warn span { background: #f59e0b; color: #111827; }
.pill-muted span { background: #6b7280; color: #ffffff; }
.pill-info span { background: #0ea5e9; color: #ffffff; }
.pill-live-soft span { background: #22c55e; color: #ffffff; }
.pill-die-soft span { background: #e11d48; color: #ffffff; }

.tools-fab {
  position: fixed;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-white);
  box-shadow: var(--shadow-soft);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
}

.tools-fab:hover {
  background: #f8f9fb;
}

.tools-fab i {
  font-size: 18px;
  color: var(--text-secondary);
}
.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-grow: 1;
  flex-wrap: nowrap; /* prevent wrapping when switching tabs */
}

#tab-filters-slot {
  display: contents;
}

#tab-tables-slot {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
}

#tab-tables-slot .table-card {
  flex: 1 1 auto;
  min-height: 0;
}
.button-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.v-divider {
  width: 1px;
  height: 20px;
  background: #E0E5F2;
  margin: 0 4px;
}

/* TABLE CARD */
.table-card {
  background: var(--bg-white);
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  flex-grow: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--table-border);
  margin-bottom: 0;
}

.card-header {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  align-items: center;
  background: #f8f9fb;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.card-header h3 {
  font-size: 13px;
  font-weight: 700;
  margin: 0;
}

/* Badges tÃ³m táº¯t */
/* Removed badges related to summary */

/* Delay input */
.delay-input-group {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
}
.delay-input-group label { color: var(--text-primary); }
.delay-input-group input {
  width: 44px;
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  text-align: center;
  font-weight: 700;
  font-family: var(--font-main);
  background: #F4F7FE;
  font-size: 10px;
  height: 24px;
}
.delay-input-group input:focus {
  background: white;
  border-color: var(--primary);
}

/* Scroll area */
.table-responsive {
  width: 100%;
  overflow: auto;
  padding: 0;
  box-sizing: border-box;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

.page-name-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.column-label-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 12px;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.column-label-bar span {
  font-weight: 600;
  white-space: nowrap;
  color: #1f2937;
}

/* Show scrollbars inside table area and keep header/body aligned */
.table-responsive {
  scrollbar-gutter: stable;
}

#auto-claim-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
}

.auto-claim-card {
  background: #ffffff;
  padding: 20px;
  border-radius: 12px;
  width: 95%;
  max-width: 400px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auto-claim-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.processing-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  margin-bottom: 4px;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #ccc;
  border-top-color: #28a745; /* mÃ u xoay */
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
#modal-rename-input, .auto-claim-input, #modal-invite-email, #auto-claim-email {
  width: 100%;
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#modal-rename-input::placeholder {
  color: #9aa0a6;
}

#modal-rename-input:focus {
  border-color: #28a745;
  box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.15);
}

.auto-claim-subtitle {
  font-weight: 600;
  font-size: 14px;
  color: #374151;
}

.bm-close-btn {
  font-size: 20px;
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
}

.bm-close-btn:hover {
  color: #1f2937;
}

.auto-claim-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auto-claim-label {
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
}



.auto-claim-value {
  font-size: 13px;
  font-weight: 700;
  color: #2563eb;
}

/* NÃºt máº·c Ä‘á»‹nh */
.btn-auto-claim {
  position: relative;
  transition: background 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}

/* Cháº¥m tráº¡ng thÃ¡i */
.btn-auto-claim .auto-claim-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #999;
  display: inline-block;
  margin-right: 6px;
}

/* ================== ÄANG HOáº T Äá»˜NG ================== */
.btn-auto-claim.is-running {
  background: #28a745 !important;     /* xanh hoáº¡t Ä‘á»™ng */
  color: #fff;
  box-shadow: 0 0 0 0 rgba(40,167,69,0.7);
  animation: autoClaimPulse 1.5s infinite;
}

.btn-auto-claim.is-running .auto-claim-dot {
  background: #00ff6a;
  box-shadow: 0 0 8px #00ff6a;
  animation: autoClaimBlink 1s infinite;
}
.email-per-bm-row {
  display: flex;
  align-items: center;   /* âœ… cÄƒn giá»¯a theo chiá»u dá»c */
  gap: 10px;
  margin-top: 12px;
}

.email-per-bm-input {
  width: 80px;
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* ================== ANIMATION ================== */
@keyframes autoClaimPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(40,167,69,0.6);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(40,167,69,0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(40,167,69,0);
  }
}

@keyframes autoClaimBlink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}


.auto-claim-actions {
  margin-top: 8px;
  display: flex;
  justify-content: center;
}

.auto-claim-actions-running {
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.auto-claim-running-buttons {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.btn {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}



.btn-light {
  background-color: #f8fafc;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  box-shadow: none;
}

.btn-light:hover {
  background-color: #e5e7eb;
}

.btn-danger-soft {
  background-color: #fee2e2;
  color: #b91c1c;
}

.btn-danger-soft:hover {
  background-color: #fecaca;
}

/* =========================
   TABLE (Excel-like)
========================= */
table {
  border-collapse: collapse;
}

/* Table inside scrollable container with auto-fit */
.table-responsive table {
  table-layout: auto;
  width: max-content;
  min-width: 100%;
  display: inline-table;
}


/* IMPORTANT: cursor normal inside table (no plus) */
table, thead, tbody, tr, th, td {
  cursor: default !important;
}
.yc-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:999999;
}

.yc-modal{
  width:420px;
  background:#fff;
  border-radius:10px;
  padding:16px;
  box-shadow:0 20px 40px rgba(0,0,0,.25);
}

.yc-modal h3{
  margin:0 0 12px;
  font-size:16px;
}

.yc-modal label{
  font-size:13px;
  font-weight:600;
  display:block;
  margin:8px 0 4px;
}

.yc-modal textarea{
  width:100%;
  border:1px solid #d1d5db;
  border-radius:6px;
  padding:8px;
  font-size:13px;
}

.yc-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  margin-top:12px;
}
.yc-spin {
  display:inline-block;
  width:12px;
  height:12px;
  border:2px solid #cbd5f5;
  border-top-color:#2563eb;
  border-radius:50%;
  animation: yc-spin 0.8s linear infinite;
  vertical-align:middle;
  margin-right:6px;
}

@keyframes yc-spin {
  to { transform: rotate(360deg); }
}

.yc-row {
  display:flex;
  align-items:center;
  gap:6px;
  margin-bottom:4px;
}

/* Header */
th {
  text-align: left;
  padding: 4px 3px;
  font-size: 9px;
  font-weight: 700;
  color: #1f2329;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;

  /* only horizontal line */
  border-bottom: 2px solid var(--border);

  position: sticky;
  top: 0;
  background: linear-gradient(to bottom, #f8f9fb, #f3f5f9);
  z-index: 5;

  user-select: none;
}
th.text-center { text-align: center; }

th.sortable {
  cursor: pointer;
  padding-right: 30px;
  min-width: 64px;
}

th.sortable i {
  display: none !important;
}

th.sortable.sort-asc::after,
th.sortable.sort-desc::after {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  opacity: 0.85;
  pointer-events: none;
}

th.sortable.sort-asc::after { content: '▲'; }
th.sortable.sort-desc::after { content: '▼'; }

/* hover header khÃ´ng Ä‘á»•i mÃ u lung tung */
th:hover { color: #1f2329; }
.table-header th.drag-over { outline: 2px dashed var(--primary); }
.table-header th.dragging { opacity: 0.6; }
body.col-dragging { user-select: none; }
body.col-dragging .table-header th { cursor: ew-resize !important; }

/* Cells */
td {
  padding: 4px 3px;
  font-size: 9px;
  color: #002c79;
  vertical-align: middle;
  font-weight: 400;
  overflow: hidden;
  white-space: nowrap;

  /* show thin vertical separators between columns */
  border-right: 1px solid #f0f2f7;

  /* chá»‰ giá»¯ viá»n ngang */
  border-bottom: 1px solid #f0f2f7;

  background: #ffffff;
}

/* Remove bold in table body content */
tbody td b,
tbody td strong {
  font-weight: 400 !important;
}
tbody td span[style*="font-weight"] {
  font-weight: 400 !important;
}

/* Scale tables up 135% for readability */
.table-card table th,
.table-card table td {
  font-size: 15px;
  padding: 8px 6px;
  min-width: 120px;
}

.table-card table th:first-child,
.table-card table td:first-child {
  min-width: 44px;
  width: 44px;
}

/* Keep STT and checkbox columns equal width */
.table-card .table-header th[data-col-key="stt"],
.table-card .table-header th[data-col-key="select"],
.table-card .table-responsive td[data-col-key="stt"],
.table-card .table-responsive td[data-col-key="select"],
.table-card .table-header thead tr > th:nth-child(1),
.table-card .table-header thead tr > th:nth-child(2),
.table-card .table-responsive tbody tr > td:nth-child(1),
.table-card .table-responsive tbody tr > td:nth-child(2) {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  text-align: center;
}

td.text-center { text-align: center; }

/* Zebra striping - alternating row colors */
tbody tr:nth-child(even) > td {
  background: #f8f9fc;
}

/* Hover effect - nÃ¢ng hÃ ng lÃªn */
tbody tr:hover > td {
  background: #e8ebf5;
}

/* Drag selection - Excel-like range select (per cell, not entire row) */
td.drag-selected {
  background: var(--row-select) !important;
  color: var(--text-primary);
}

/* =========================
   Elements within Table
========================= */
.bm-info-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.avatar-gradient {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #868CFF 0%, #4318FF 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.bm-text h4 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}
.bm-text span {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: monospace;
}
.bm-link {
  text-decoration: none;
  color: inherit;
}
.bm-link:hover { color: var(--primary); }

/* Badge tráº¡ng thÃ¡i */
.badge {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.badge-live { background: #E6FFFA; color: var(--success); }
.badge-die  { background: #FFF5F5; color: var(--danger); }
.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* Money/Number columns - right aligned, monospace font */
td.number-col {
  text-align: right;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  font-size: 12px;
  font-weight: 500;
}

/* Currency values - highlight with color */
.currency-value {
  font-weight: 600;
  color: #1f2329;
}

.currency-value.positive { color: #059669; } /* green */
.currency-value.negative { color: #dc2626; } /* red */
.currency-value.warning { color: #ea580c; }   /* orange */

/* XMDN badges (báº¡n Ä‘ang dÃ¹ng class khÃ¡c trong JS thÃ¬ giá»¯ nguyÃªn) */
.badge-verify-success { background: rgba(5, 205, 153, 0.12); color: var(--success); }
.badge-verify-pending { background: rgba(67, 24, 255, 0.10); color: var(--primary); }
.badge-verify-rejected { background: rgba(227, 26, 26, 0.12); color: var(--danger); }
.badge-verify-unknown { background: #F4F7FE; color: #7B8DB0; }

/* Role tag */
.role-tag {
  background: #F4F7FE;
  color: var(--text-primary);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

/* Custom Checkbox */
input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  border: 1.5px solid #E0E5F2;
  border-radius: 3px;
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-content: center;
  background: #fff;
}
input[type="checkbox"]::before {
  content: "";
  width: 9px;
  height: 9px;
  background: white;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}
input[type="checkbox"]:checked::before { transform: scale(1); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #E0E5F2; border-radius: 10px; }

/* --- MODAL STYLES (Invite/Rename) --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(2px);
}
.modal-content {
  background: var(--bg-white);
  padding: 24px 21px;
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  width: 90%;
  max-width: 510px;
}
.modal-content h3 {
  margin-top: 0;
  margin-bottom: 9px;
  font-size: 21px;
  font-weight: 700;
  color: var(--primary);
}
.modal-content p {
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 16.5px;
  margin-bottom: 15px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
}

/* ====== BACKUP BM MODAL ====== */
.backup-bm-card {
  max-width: 420px;
}
.backup-bm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.backup-bm-header h3 {
  margin: 0;
}
.backup-bm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  margin-bottom: 10px;
}
.backup-bm-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}
.backup-bm-input {
  border: 1px solid #d7dce6;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  background: #fff;
}
.backup-bm-input:focus {
  outline: none;
  border-color: #4f46e5;
}
.backup-bm-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 8px 0;
  font-size: 13px;
}
.backup-bm-selected {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}
.backup-bm-selected-ids {
  width: 100%;
  min-height: 46px;
  border: 1px solid #d7dce6;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  font-family: "Courier New", monospace;
  resize: vertical;
  background: #fff;
}
.backup-bm-label {
  font-weight: 700;
  color: var(--text-primary);
}
.backup-bm-count {
  min-width: 22px;
  height: 18px;
  border-radius: 999px;
  background: #22c55e;
  color: #fff;
  font-weight: 700;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.backup-bm-output {
  width: 100%;
  min-height: 160px;
  border: 1px solid #d7dce6;
  border-radius: 10px;
  padding: 10px;
  font-size: 12px;
  font-family: "Courier New", monospace;
  resize: vertical;
  background: #fff;
  white-space: pre;
  overflow-x: auto;
}

/* Tools subpanel */
.tool-subpanel {
  width: 100%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}
.tool-subpanel.is-open {
  display: flex;
}
.tool-subpanel.is-floating {
  position: fixed;
  z-index: 12000;
  width: auto;
  min-width: 240px;
  max-width: 360px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.18);
}
.tool-subpanel label {
  color: var(--text-secondary);
  font-weight: 600;
}
.tool-subpanel-select {
  border: 1px solid #d7dce6;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  background: #fff;
}
.tool-subpanel select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 32px 8px 12px;
  font-size: 13px;
  font-weight: 500;
  background: #ffffff;
  color: #1e293b;
  box-sizing: border-box;
  cursor: pointer;
  transition: all 0.2s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}
.tool-subpanel select:hover {
  border-color: #94a3b8;
  background-color: #f8fafc;
}
.tool-subpanel select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background-color: #ffffff;
}
.tool-subpanel textarea,
.tool-subpanel input {
  width: 100%;
  border: 1px solid #d7dce6;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  background: #fff;
  box-sizing: border-box;
}
.tool-subpanel-actions {
  display: flex;
  gap: 8px;
}
.tool-subpanel-actions .btn {
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.2;
  width: auto;
  min-width: 80px;
  opacity: 1;
}
.tool-subpanel-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tool-subpanel-label {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12px;
}
.tool-subpanel-count {
  padding: 2px 6px;
  border-radius: 999px;
  background: #e2e8f0;
  font-size: 11px;
  font-weight: 700;
}
.tool-subpanel-count.ok {
  background: #dcfce7;
  color: #166534;
}
.tool-subpanel-count.fail {
  background: #fee2e2;
  color: #991b1b;
}
.tool-subpanel-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.tool-subpanel-col textarea {
  min-height: 70px;
}
.btn-start-green {
  background: #0f9b8f;
  color: #fff;
  border: none;
}
.btn-start-green:hover {
  background: #0f9b8f;
}
.btn-close-red {
  background: #ef4444;
  color: #fff;
  border: none;
}
.btn-close-red:hover {
  background: #dc2626;
}
.tool-subpanel-log {
  margin-top: 6px;
}
.tool-subpanel-title {
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.tool-subpanel-loglist {
  max-height: 220px;
  overflow: auto;
  font-family: monospace;
  font-size: 11px;
  line-height: 1.4;
  padding: 6px;
  border: 1px dashed rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  background: #fff;
}

/* ====== BASIC CREATE BM PANEL ====== */
.bm-box {
  width: 690px;
  max-width: calc(100% - px);
  background: #ffffff;
  border-radius: 15px;
  padding: 18px 21px;
  box-shadow: 0 15px 45px rgba(15, 23, 42, 0.25);
  font-family: "Open Sans", system-ui, sans-serif;
  font-size: 18px;
}
.bm-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.bm-box-title { font-size: 19.5px; font-weight: 700; }
.bm-row { display: flex; gap: 9px; margin-bottom: 12px; }
.bm-row-top { align-items: center; }
.bm-label-inline { font-size: 16.5px; }
.bm-input {
  width: 105px;
  padding: 6px 9px;
  border-radius: 7.5px;
  border: 1px solid #d1d5db;
  font-size: 16.5px;
}
.bm-input:focus { border-color: #6366f1; }
.bm-btn-create {
  padding: 7.5px 15px;
  border-radius: 9px;
  border: none;
  background: #6366f1;
  color: #fff;
  font-size: 16.5px;
  font-weight: 600;
  cursor: pointer;
}
.bm-btn-create:hover { background: #4f46e5; }
.bm-success-inline { font-size: 16.5px; margin-left: auto; }
.bm-success-inline span { font-weight: 700; }
.bm-col-wide {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 16.5px;
}
.bm-col-wide textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border-radius: 9px;
  border: 1px solid #d1d5db;
  padding: 9px 12px;
  font-size: 16.5px;
  font-family: monospace;
}
.bm-col-wide textarea:focus { border-color: #6366f1; }
@media (max-width: 520px) {
  .bm-box { width: 100%; max-width: calc(100% - 16px); }
  .bm-row-top { flex-wrap: wrap; }
  .bm-success-inline { width: 100%; margin-left: 0; }
}



.control-panel{
  padding: 1px 2px !important;
  border-radius: 10px;
  gap: 6px;
  flex-wrap: nowrap; /* keep single row until breakpoint */
}

.filter-group{
  gap: 6px !important;
  flex-wrap: nowrap !important;      /* never split search/select into 2 lines */
  min-width: 0;                       /* allow children to shrink */
  overflow: visible;
}

.filters-inline{
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap !important;       /* keep 1 row */
  min-width: 0;
}



/* Tab switch */
.tab-switch{
  padding: 1px;
}

@media (max-width: 980px) {
  .control-panel {
    flex-wrap: wrap !important;
  }

  .filter-group {
    flex: 1 1 100%;
  }

  .button-group {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap; /* má»Ÿ wrap */
  }

  /* Khi nÃºt Bá»Ž xuáº¥t hiá»‡n thÃ¬ Ã©p nÃ³ náº±m cuá»‘i hÃ ng má»›i */
  .btn-clear-filter {
    order: 999; /* Ä‘áº©y nÃºt nÃ y xuá»‘ng cuá»‘i */
    margin-top: 8px; /* khÃ´ng cáº§n margin-left auto náº¿u dÃ¹ng order */
    margin-left: auto; /* Ä‘áº©y qua pháº£i */
    width: max-content; /* trÃ¡nh trÃ n */
  }
}



/* Fix Facebook verify code button visibility */
button:not(:disabled) {
  pointer-events: auto !important;
}

/* Global input/textarea/select optimization */
input, textarea, select {
  pointer-events: auto !important;
  will-change: auto;
  contain: layout style;
}

/* Avoid scroll jank in textareas */
textarea {
  contain: none;
  box-shadow: none !important;
}

.btn-modal-icon {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  background: linear-gradient(135deg, #2f67e0 0%, #2f61c8 100%);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(47, 103, 224, 0.15);
}

.btn-modal-icon:hover {
  background: linear-gradient(135deg, #2f61c8 0%, #2450b0 100%);
  box-shadow: 0 2px 6px rgba(13, 89, 253, 0.25);
}

.btn-modal-icon i {
  font-size: 14px;
}

.btn-clear-filter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(239, 68, 68, 0.15);
}

.btn-clear-filter:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.25);
}

.btn-clear-filter i {
  font-size: 14px;
}

/* ID Modal Styles */
.id-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 16px;
}
.id-modal-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fc 100%);
  border-radius: 24px;
  box-shadow: 0 37.5px 75px rgba(0, 0, 0, 0.2), inset 0 1.5px 0 rgba(255, 255, 255, 0.6);
  width: 90%;
  max-width: 750px;
  height: 80vh;
  max-height: 900px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, 0.8);
}

.id-modal-header {
  padding: 30px 36px;
  border-bottom: 1.5px solid rgba(229, 231, 235, 0.8);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(90deg, #2f67e0 0%, #2f61c8 100%);
}

.id-modal-header h3 {
  margin: 0;
  font-size: 27px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.45px;
}

.id-modal-close-btn {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.8);
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.id-modal-close-btn:hover {
  color: #ffffff;
}

.id-modal-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.id-modal-label {
  font-size: 14px;
  font-weight: 600;
  color: #1f2329;
  margin-bottom: 12px;
  display: block;
  letter-spacing: -0.2px;
}

.id-modal-textarea {
  flex: 1;
  min-height: 300px;
  padding: 14px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-family: 'Courier New', Menlo, monospace;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  background: #ffffff;
  color: #1f2329;
  will-change: border-color, box-shadow;
}

.id-modal-textarea::placeholder {
  color: #d1d5db;
  font-size: 18px;
}

.id-modal-textarea:focus {
  border-color: #2f67e0;
  box-shadow: 0 0 0 6px rgba(47, 103, 224, 0.15), inset 0 0 0 1.5px rgba(47, 103, 224, 0.1);
  background: #fafbff;
}

.id-modal-hint {
  font-size: 18px;
  color: #6b7280;
  margin-top: 15px;
  padding: 12px 18px;
  border-radius: 12px;
  border-left: 4.5px solid #2f67e0;
}

.id-modal-footer {
  padding: 30px 36px;
  border-top: 1.5px solid #e5e7eb;
  display: flex;
  gap: 18px;
  justify-content: flex-end;
  background: #fafbfc;
}

.id-modal-footer .btn {
  min-width: 135px;
  font-size: 21px;
}

.btn-success {
  background: linear-gradient(90deg, #10B981 0%, #059669 100%);
  color: white;
}

.btn-success:hover {
  background: linear-gradient(90deg, #059669 0%, #047857 100%);
}

/* Tab buttons - matching btn-modal-icon style */
.tab-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  color: #6b7280;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.tab-btn:hover {
  background: #e5e7eb;
  color: #374151;
}

.tab-btn.active {
  background: linear-gradient(135deg, #2f67e0 0%, #2f61c8 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(47, 103, 224, 0.3);
}

.tab-btn.active:hover {
  background: linear-gradient(135deg, #2f61c8 0%, #2450b0 100%);
  box-shadow: 0 4px 14px rgba(47, 103, 224, 0.4);
}

/* First open hint: point to the HOME button ("MEOFB Tools") */
.tab-btn.home-pointer {
  position: relative;
  z-index: 3;
  animation: homePointerPulse 1.1s ease-in-out infinite;
}

.tab-btn.home-pointer::before {
  content: "MEOFB TOOLS";
  position: absolute;
  left: 50%;
  top: calc(100% + 12px);
  transform: translateX(-50%);
  background: rgba(47, 103, 224, 0.95);
  color: #ffffff;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2px;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.tab-btn.home-pointer::after {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% + 4px);
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 9px solid rgba(47, 103, 224, 0.95);
}

@keyframes homePointerPulse {
  0% {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05), 0 0 0 0 rgba(47, 103, 224, 0.0);
    transform: translateY(0);
  }
  50% {
    box-shadow: 0 4px 14px rgba(47, 103, 224, 0.25), 0 0 0 6px rgba(47, 103, 224, 0.14);
    transform: translateY(-1px);
  }
  100% {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05), 0 0 0 0 rgba(47, 103, 224, 0.0);
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tab-btn.home-pointer {
    animation: none;
  }
}

/* Email history items styling */
.email-history-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: linear-gradient(135deg, #f0f4ff 0%, #e6ecff 100%);
  border: 1px solid #d0dbff;
  border-radius: 8px;
  font-size: 14px;
  color: #2f67e0;
  cursor: pointer;
  font-weight: 600;
  user-select: none;
}

.email-history-item:hover {
  background: linear-gradient(135deg, #2f67e0 0%, #2f61c8 100%);
  color: white;
  border-color: #2f67e0;
  box-shadow: 0 2px 8px rgba(47, 103, 224, 0.3);
}

.email-history-item i {
  font-size: 14px;
  opacity: 0.8;
}

/* Tool Accordion Sidebar */
.tool-accordion {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tool-item {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.tool-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  cursor: pointer;
  user-select: none;
}

.tool-header:hover {
  background: #f9fafb;
}

.tool-header i {
  font-size: 14px;
  color: #6b7280;
  width: 16px;
  text-align: center;
}

.tool-header span {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
}

.tool-content {
  padding: 12px;
  border-top: 1px solid #f3f4f6;
  background: #f9fafb;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #d1d5db;
  border-radius: 22px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #3b82f6;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(18px);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 16px;
}



.btn {
  padding: 8px 14px;
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  border: none;
}
.btn-primary-blue {
  background-color: #1e40af; /* Xanh dÆ°Æ¡ng Ä‘áº­m */
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.btn-primary-blue:hover {
  background-color: #1d4ed8; /* xanh hover sÃ¡ng hÆ¡n */
}

/* ADD CARD BOX */
.add-card-ads-box {
  margin: 10px 0 12px;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f9fafb;
  font-size: 13px;
}

.add-card-ads-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.add-card-ads-list {
  font-family: monospace;
  max-height: 90px;
  overflow: auto;
}

.card-row {
  display: flex;
  gap: 8px;
}

.card-row > div {
  flex: 1;
}

/* overlay + modal dÃ¹ng chung yc */
.yc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.yc-modal {
  width: 420px;
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,.25);
}

.yc-modal label {
  font-size: 13px;
  font-weight: 600;
  display: block;
  margin: 8px 0 4px;
}

.yc-modal input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 8px;
  font-size: 13px;
}
.btn-lights {
  background-color: #eef2f6;
  color: #475569;
  border: 1px solid #e5e7eb;
  padding: 6px 8px;
  border-radius: 8px;
  font-weight: 600;
}
.btn-lights:hover {
  background-color: #e6ebf1;
  border-color: #d9e0e8;
  color: #334155;
}
.btn-lights:active {
  background-color: #dde3ea;
}
.yc-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
#addcard-log .row {
  display:flex;
  align-items:center;
  gap:6px;
  margin-top:4px;
}
#addcard-log .spin {
  width:12px;
  height:12px;
  border:2px solid #ccc;
  border-top-color:#2563eb;
  border-radius:50%;
  animation:spin .8s linear infinite;
}
#addcard-log .ok { color:#059669;font-weight:700 }
#addcard-log .fail { color:#dc2626;font-weight:700 }


.btn-light {
  background-color: #0f9b8f;
  color: #fff;
}

.btn-light:hover {
  background-color: #0f9b8f;
}

.btn-danger-soft {
  background-color: #fed7d7;
  color: #c53030;
}

.btn-danger-soft:hover {
  background-color: #feb2b2;
}

/* === Close button (x) === */
.bm-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #a0aec0;
}

.bm-close-btn:hover {
  color: #718096;
}


.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  margin: 0 1px;
  width: 30px;
  height: 30px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  color: #333;
  text-decoration: none;
}

.btn-icon:hover {
  background: #e0e0e0;
  border-color: #bbb;
}
