/* ==========================================================================
   BUFFTRAFFIC - NHIỆM VỤ SEO (MISSION EXCHANGE) STYLESHEET
   Hỗ trợ đồng bộ Light Mode, Dark Mode (.feed-page.is-dark) & Admin Panel
   ========================================================================== */

/* Ghi đè display:none !important của .feed-topbar-center trong stylesheet chính */
.feed-page .feed-shell-topbar {
  grid-template-columns: auto minmax(260px, 1fr) auto !important;
  align-items: center !important;
}

.feed-page .feed-shell-topbar .feed-topbar-center {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  grid-column: 2 !important;
  min-width: 0 !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* --- Topbar Center Menu Switcher (Trang chủ /feed) --- */
.bt-center-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border-radius: 16px;
  background: #eef4fc;
  border: 1px solid #d5e2f5;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.bt-center-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #334155;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.bt-center-nav-btn:hover {
  color: #0362b9;
  background: rgba(255, 255, 255, 0.72);
}

.bt-center-nav-btn.is-active {
  background: linear-gradient(135deg, #0362b9 0%, #0ea5e9 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(3, 98, 185, 0.25);
}

.bt-center-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  background: #22c55e;
  color: #fff;
}

.bt-center-nav-btn.is-active .bt-center-nav-badge {
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
}

/* Dark mode for center menu */
.feed-page.is-dark .bt-center-nav {
  background: #162238;
  border-color: #293954;
}

.feed-page.is-dark .bt-center-nav-btn {
  color: #cbd5e1;
}

.feed-page.is-dark .bt-center-nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.feed-page.is-dark .bt-center-nav-btn.is-active {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #fff;
}

/* --- Cross Task Root Container inside .feed-main --- */
#bt-cross-task-root {
  display: grid;
  gap: 16px;
  animation: btCtFadeIn 0.2s ease-out;
}

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

/* Sub-tabs inside Cross-Task */
.bt-ct-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #dbe6f5;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.bt-ct-subtab {
  flex: 1;
  min-width: 150px;
  min-height: 40px;
  padding: 8px 14px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #475569;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.16s ease;
}

.bt-ct-subtab:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.bt-ct-subtab.is-active {
  background: #0f172a;
  color: #fff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.16);
}

/* Score & Summary Card — Tối giản: box trắng, chữ đen, nhỏ gọn */
.bt-ct-score-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  padding: 10px 6px;
  border-radius: 14px;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  box-shadow: none;
}

.bt-ct-score-box {
  padding: 2px 14px;
  border-right: 1px solid #e2e8f0;
  background: transparent;
  border-radius: 0;
}

.bt-ct-score-box:last-child {
  border-right: 0;
}

.bt-ct-score-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 2px;
}

.bt-ct-score-val {
  display: block;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  color: #0f172a;
}

.bt-ct-score-sub {
  display: none;
}

/* Quick Action Bar (matches .feed-composer) */
.bt-ct-action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #dbe6f5;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
}

.bt-ct-action-copy strong {
  display: block;
  font-size: 15px;
  color: #0f172a;
}

.bt-ct-action-copy span {
  display: block;
  font-size: 12.5px;
  color: #64748b;
  margin-top: 2px;
}

.bt-ct-action-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Reusable Buttons */
.bt-ct-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 15px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.16s ease;
  text-decoration: none;
  font-family: inherit;
}

.bt-ct-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.bt-ct-btn-sm {
  min-height: 34px;
  padding: 0 11px;
  font-size: 12.5px;
  border-radius: 9px;
}

.bt-ct-btn-primary {
  background: linear-gradient(135deg, #0362b9 0%, #0ea5e9 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(3, 98, 185, 0.22);
}

.bt-ct-btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(3, 98, 185, 0.3);
}

.bt-ct-btn-success {
  background: linear-gradient(135deg, #16a34a 0%, #10b981 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(22, 163, 74, 0.24);
}

.bt-ct-btn-success:hover:not(:disabled) {
  transform: translateY(-1px);
}

.bt-ct-btn-secondary {
  background: #f1f5f9;
  color: #1e293b;
  border-color: #d6e0ee;
}

.bt-ct-btn-secondary:hover:not(:disabled) {
  background: #e2e8f0;
}

.bt-ct-btn-danger {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}

.bt-ct-btn-danger:hover:not(:disabled) {
  background: #fecaca;
}

.bt-ct-btn-warn {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

/* Active Mission Runner Card — Clean Verification Layout (chuẩn theo mẫu) */
.bt-ct-runner {
  border-radius: 20px;
  background: #fff;
  border: 1.5px solid #cbd5e1;
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  padding: 22px 24px 24px;
}

.bt-ct-runner-topmeta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.bt-ct-runner-heading {
  margin: 0 0 14px;
  text-align: center;
  font-size: 21px;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.bt-ct-verify-top-form {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}

.bt-ct-verify-top-input {
  flex: 1;
  min-width: 180px;
  height: 46px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.bt-ct-verify-top-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.bt-ct-verify-top-input::placeholder {
  color: #94a3b8;
  font-weight: 500;
  letter-spacing: 0;
}

.bt-ct-verify-top-btn {
  min-width: 126px;
  height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: 10px;
  background: #2563eb;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s ease, transform 0.15s ease;
}

.bt-ct-verify-top-btn:hover:not(:disabled) {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.bt-ct-verify-top-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Clean Step Rows with Hairline Dividers */
.bt-ct-clean-steps {
  border-top: 1px solid #e2e8f0;
}

.bt-ct-clean-step {
  padding: 14px 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 15px;
  line-height: 1.6;
  color: #1e293b;
}

.bt-ct-clean-step:last-child {
  border-bottom: 0;
  padding-bottom: 4px;
}

.bt-ct-clean-step-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.bt-ct-clean-step-label {
  font-weight: 800;
  color: #0f172a;
}

.bt-ct-kw-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 8px;
  background: #f0f6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 15px;
  font-weight: 800;
}

.bt-ct-copy-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  border-radius: 8px;
  border: 0;
  background: #e0e7ff;
  color: #3730a3;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bt-ct-copy-pill:hover {
  background: #c7d2fe;
}

.bt-ct-website-line {
  margin-top: 4px;
  font-size: 15.5px;
  font-weight: 700;
  color: #0f172a;
  word-break: break-all;
}

.bt-ct-guide-img-block {
  margin-top: 12px;
}

.bt-ct-guide-img-label {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 10px;
}

.bt-ct-guide-img-frame {
  display: flex;
  justify-content: center;
}

.bt-ct-guide-img {
  max-width: 100%;
  max-height: 460px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
  cursor: zoom-in;
  display: block;
  object-fit: contain;
  background: #fff;
}

.bt-ct-step-code-callout {
  margin-top: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  font-size: 13.5px;
  font-weight: 600;
}

/* Legacy / compact step items */
.bt-ct-steps-list {
  display: grid;
  gap: 12px;
}

.bt-ct-step-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.bt-ct-step-item.is-code-step {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfeff 100%);
  border-color: #86efac;
}

.bt-ct-step-num {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0362b9;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  flex-shrink: 0;
}

.bt-ct-step-item.is-code-step .bt-ct-step-num {
  background: #16a34a;
}

.bt-ct-step-title {
  font-size: 14.5px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
}

.bt-ct-step-desc {
  font-size: 13.5px;
  line-height: 1.55;
  color: #334155;
  white-space: pre-line;
}

.bt-ct-step-img-wrap {
  margin-top: 10px;
}

.bt-ct-step-img {
  max-width: 100%;
  max-height: 260px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  cursor: zoom-in;
  display: block;
  object-fit: contain;
  background: #fff;
}

/* Feed Task Cards (matching .feed-post-card feel) */
.bt-ct-feed-list {
  display: grid;
  gap: 14px;
}

.bt-ct-card {
  border-radius: 18px;
  background: #fff;
  border: 1px solid #dbe6f5;
  padding: 16px 18px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.bt-ct-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

.bt-ct-card.is-priority-top {
  border-color: #38bdf8;
  box-shadow: 0 8px 26px rgba(14, 165, 233, 0.1);
}

.bt-ct-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.bt-ct-author {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.bt-ct-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0362b9, #0ea5e9);
  color: #fff;
  font-weight: 900;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  object-fit: cover;
  flex-shrink: 0;
}

.bt-ct-author-name {
  font-size: 14.5px;
  font-weight: 800;
  color: #0f172a;
}

.bt-ct-author-meta {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.bt-ct-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.bt-ct-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}

.bt-ct-badge-prio { background: #e0f2fe; color: #0369a1; }
.bt-ct-badge-reward { background: #dcfce7; color: #15803d; }
.bt-ct-badge-active { background: #dcfce7; color: #15803d; }
.bt-ct-badge-paused { background: #fef3c7; color: #92400e; }
.bt-ct-badge-completed { background: #e2e8f0; color: #475569; }
.bt-ct-badge-blocked { background: #fee2e2; color: #b91c1c; }
.bt-ct-badge-mine { background: #ede9fe; color: #6d28d9; }

.bt-ct-card-title {
  font-size: 16.5px;
  font-weight: 900;
  color: #0f172a;
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bt-ct-card-url {
  display: inline-block;
  font-size: 12.5px;
  color: #0284c7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #f0f9ff;
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 8px;
  word-break: break-all;
}

.bt-ct-card-desc {
  margin: 0 0 12px;
  font-size: 13.5px;
  line-height: 1.55;
  color: #475569;
}

.bt-ct-steps-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.bt-ct-step-chip {
  padding: 9px 11px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 12px;
}

.bt-ct-step-chip strong {
  display: block;
  color: #0f172a;
  margin-bottom: 2px;
}

.bt-ct-step-chip span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #64748b;
  line-height: 1.4;
}

.bt-ct-step-thumb {
  margin-top: 6px;
  width: 100%;
  height: 76px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  cursor: zoom-in;
}

.bt-ct-progress-wrap {
  margin-bottom: 12px;
}

.bt-ct-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 5px;
}

.bt-ct-progress-bar {
  height: 7px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.bt-ct-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9, #22c55e);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.bt-ct-card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

/* Modal & Lightbox */
.bt-ct-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: none;
  place-items: center;
  padding: 18px;
}

.bt-ct-modal-backdrop.is-open {
  display: grid;
}

.bt-ct-modal {
  width: min(100%, 740px);
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 22px;
  background: #fff;
  color: #0f172a;
  padding: 24px;
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.32);
  border: 1px solid #dbe6f5;
}

.bt-ct-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.bt-ct-modal-head h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  color: #0f172a;
}

.bt-ct-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 0;
  background: #f1f5f9;
  color: #334155;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.bt-ct-form-grid {
  display: grid;
  gap: 14px;
}

.bt-ct-form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.bt-ct-field label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 5px;
}

.bt-ct-field input,
.bt-ct-field textarea,
.bt-ct-field select {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  font-size: 14px;
  font-family: inherit;
}

.bt-ct-field textarea {
  min-height: 76px;
  resize: vertical;
}

.bt-ct-hint {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
  line-height: 1.45;
}

.bt-ct-step-editor {
  padding: 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  display: grid;
  gap: 10px;
}

.bt-ct-step-editor.is-step-3 {
  background: #f0fdf4;
  border-color: #86efac;
}

.bt-ct-step-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  font-size: 13.5px;
  color: #0f172a;
}

.bt-ct-upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.bt-ct-img-preview {
  max-height: 110px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #fff;
}

.bt-ct-cost-banner {
  padding: 13px 16px;
  border-radius: 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13.5px;
  color: #1e3a8a;
}

.bt-ct-cost-banner.is-insufficient {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.bt-ct-code-block {
  background: #0f172a;
  color: #38bdf8;
  padding: 14px 16px;
  border-radius: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  user-select: all;
}

.bt-ct-toast {
  position: fixed;
  top: 78px;
  right: 22px;
  z-index: 10090;
  max-width: 420px;
  padding: 13px 16px;
  border-radius: 14px;
  background: #0f172a;
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.28);
  border-left: 4px solid #22c55e;
  animation: btCtFadeIn 0.2s ease;
}

.bt-ct-toast.is-error {
  border-left-color: #ef4444;
  background: #7f1d1d;
}

.bt-ct-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10100;
  background: rgba(2, 6, 23, 0.88);
  display: none;
  place-items: center;
  padding: 20px;
  cursor: zoom-out;
}

.bt-ct-lightbox.is-open {
  display: grid;
}

.bt-ct-lightbox img {
  max-width: 94vw;
  max-height: 90vh;
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

/* Table Styles (History & Admin) */
.bt-ct-table-wrap {
  overflow-x: auto;
}

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

.bt-ct-table th {
  text-align: left;
  padding: 10px 12px;
  background: #f8fafc;
  color: #475569;
  font-weight: 800;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

.bt-ct-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

.bt-ct-empty {
  text-align: center;
  padding: 36px 20px;
  border-radius: 18px;
  background: #fff;
  border: 1px dashed #cbd5e1;
  color: #64748b;
  font-size: 14px;
}

/* --- Admin Tổng Panel (#bt-cross-admin-panel) & Enterprise /admin Redesign --- */
body.bt-super-admin-mode {
  background: #f1f5f9 !important;
  overflow-x: hidden;
}

#bt-adm-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 62px;
  z-index: 1010;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 28px;
  background: #0b1528;
  color: #f8fafc;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 4px 18px rgba(2, 6, 23, 0.16);
}

body.bt-super-admin-mode #bt-adm-topbar {
  display: flex;
}

.bt-adm-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bt-adm-badge-pill {
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bt-adm-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bt-adm-top-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 13px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease;
}

.bt-adm-top-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.bt-adm-top-btn.is-primary {
  background: #0284c7;
  border-color: #0284c7;
  color: #fff;
}

.bt-adm-top-btn.is-primary:hover {
  background: #0369a1;
}

/* Toàn bộ .admin-page đồng bộ chuẩn Enterprise Admin */
body.bt-super-admin-mode .admin-page {
  background: #f1f5f9 !important;
  padding: 82px 24px 48px !important;
  min-height: 100vh !important;
}

body.bt-super-admin-mode .admin-container {
  width: 100% !important;
  max-width: 1440px !important;
  margin: 0 auto !important;
  padding: 0 !important;
}

body.bt-super-admin-mode .admin-page .app-topbar {
  display: none !important;
}

/* Thanh Tab Admin Tổng chuyên nghiệp, gọn gàng */
body.bt-super-admin-mode .admin-tabs {
  display: flex !important;
  gap: 6px !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  margin: 0 0 20px !important;
  padding: 6px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 14px !important;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04) !important;
}

body.bt-super-admin-mode .admin-tabs button {
  min-height: 38px !important;
  padding: 0 15px !important;
  border-radius: 10px !important;
  border: 0 !important;
  background: transparent !important;
  color: #475569 !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  box-shadow: none !important;
  transform: none !important;
  transition: background 0.15s ease, color 0.15s ease !important;
}

body.bt-super-admin-mode .admin-tabs button:hover:not(:disabled) {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  transform: none !important;
}

body.bt-super-admin-mode .admin-tabs button.active {
  background: #0f172a !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16) !important;
}

/* Thẻ & Bảng trong tất cả các tab của Admin Tổng */
body.bt-super-admin-mode .admin-section,
body.bt-super-admin-mode .admin-metric,
body.bt-super-admin-mode .admin-permission-card,
body.bt-super-admin-mode .bt-section-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 14px !important;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04) !important;
}

body.bt-super-admin-mode .admin-metrics-grid {
  gap: 14px !important;
  margin-bottom: 18px !important;
}

body.bt-super-admin-mode .admin-metric {
  padding: 18px 20px !important;
}

body.bt-super-admin-mode .admin-metric:before {
  height: 3px !important;
}

body.bt-super-admin-mode .admin-metric:after {
  display: none !important;
}

body.bt-super-admin-mode .admin-metric-value {
  font-size: 28px !important;
  margin-top: 6px !important;
  color: #0f172a !important;
}

body.bt-super-admin-mode .admin-section {
  padding: 20px 22px !important;
  margin-bottom: 18px !important;
}

body.bt-super-admin-mode .admin-section h2 {
  font-size: 17px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
}

body.bt-super-admin-mode .admin-table {
  border-collapse: collapse !important;
  font-size: 13px !important;
}

body.bt-super-admin-mode .admin-table th {
  background: #f8fafc !important;
  color: #475569 !important;
  font-weight: 800 !important;
  font-size: 12px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
  border-bottom: 1px solid #e2e8f0 !important;
  padding: 11px 12px !important;
}

body.bt-super-admin-mode .admin-table td {
  padding: 11px 12px !important;
  border-bottom: 1px solid #f1f5f9 !important;
  color: #1e293b !important;
}

body.bt-super-admin-mode .admin-table tr:hover td {
  background: #f8fafc !important;
}

body.bt-super-admin-mode .admin-inline-search input,
body.bt-super-admin-mode .admin-user-form input,
body.bt-super-admin-mode .admin-user-form select {
  min-height: 40px !important;
  border-radius: 10px !important;
  border: 1px solid #cbd5e1 !important;
  background: #fff !important;
  font-size: 13.5px !important;
}

body.bt-super-admin-mode .admin-inline-search button,
body.bt-super-admin-mode .admin-user-form button,
body.bt-super-admin-mode .admin-row-actions button,
body.bt-super-admin-mode .admin-permission-head button {
  min-height: 36px !important;
  border-radius: 9px !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}

/* Panel Nhiệm vụ SEO trong Admin Tổng — Tối giản, phẳng, sắc nét */
#bt-cross-admin-panel {
  margin-top: 0;
  display: none;
  animation: btCtFadeIn 0.18s ease;
}

#bt-cross-admin-panel.is-visible {
  display: block;
}

.bt-ct-admin-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 18px 22px;
  margin-bottom: 16px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}

.bt-ct-admin-header-bar h2 {
  margin: 0 0 3px;
  font-size: 19px;
  font-weight: 900;
  color: #0f172a;
}

.bt-ct-admin-header-bar p {
  margin: 0;
  font-size: 13px;
  color: #64748b;
}

.bt-ct-admin-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.bt-ct-admin-metric {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 15px 18px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.bt-ct-admin-metric small {
  display: block;
  color: #64748b;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 5px;
}

.bt-ct-admin-metric strong {
  font-size: 24px;
  font-weight: 900;
  color: #0f172a;
}

.bt-ct-admin-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}

@media (max-width: 768px) {
  #bt-adm-topbar {
    padding: 0 14px;
  }
  body.bt-super-admin-mode .admin-page {
    padding: 76px 12px 32px !important;
  }
  .bt-adm-top-btn span.bt-hide-xs {
    display: none;
  }
}

/* --- Dark Mode overrides for .feed-page.is-dark --- */
.feed-page.is-dark .bt-ct-score-card,
.feed-page.is-dark .bt-ct-subtabs,
.feed-page.is-dark .bt-ct-action-bar,
.feed-page.is-dark .bt-ct-card,
.feed-page.is-dark .bt-ct-runner,
.feed-page.is-dark .bt-ct-empty {
  background: #111a2b;
  border-color: #24324a;
  color: #e5edf8;
}

.feed-page.is-dark .bt-ct-score-box {
  border-right-color: #24324a;
}

.feed-page.is-dark .bt-ct-score-label {
  color: #9fb0c7;
}

.feed-page.is-dark .bt-ct-score-val {
  color: #f8fbff;
}

.feed-page.is-dark .bt-ct-subtab {
  color: #9fb0c7;
}

.feed-page.is-dark .bt-ct-subtab:hover {
  background: #1b2942;
  color: #fff;
}

.feed-page.is-dark .bt-ct-subtab.is-active {
  background: #0ea5e9;
  color: #fff;
}

.feed-page.is-dark .bt-ct-action-copy strong,
.feed-page.is-dark .bt-ct-author-name,
.feed-page.is-dark .bt-ct-card-title,
.feed-page.is-dark .bt-ct-step-title,
.feed-page.is-dark .bt-ct-step-chip strong {
  color: #f8fbff;
}

.feed-page.is-dark .bt-ct-action-copy span,
.feed-page.is-dark .bt-ct-author-meta,
.feed-page.is-dark .bt-ct-card-desc,
.feed-page.is-dark .bt-ct-step-desc,
.feed-page.is-dark .bt-ct-step-chip span,
.feed-page.is-dark .bt-ct-progress-meta {
  color: #9fb0c7;
}

.feed-page.is-dark .bt-ct-step-item,
.feed-page.is-dark .bt-ct-step-chip {
  background: #172338;
  border-color: #273752;
}

.feed-page.is-dark .bt-ct-step-item.is-code-step {
  background: rgba(22, 163, 74, 0.14);
  border-color: rgba(74, 222, 128, 0.35);
}

.feed-page.is-dark .bt-ct-runner-heading,
.feed-page.is-dark .bt-ct-clean-step-label,
.feed-page.is-dark .bt-ct-website-line,
.feed-page.is-dark .bt-ct-guide-img-label {
  color: #f8fbff;
}

.feed-page.is-dark .bt-ct-clean-steps,
.feed-page.is-dark .bt-ct-clean-step {
  border-color: #24324a;
  color: #cbd5e1;
}

.feed-page.is-dark .bt-ct-verify-top-input {
  background: #0b1220;
  border-color: #334155;
  color: #f8fbff;
}

.feed-page.is-dark .bt-ct-kw-chip {
  background: #172554;
  border-color: #1d4ed8;
  color: #93c5fd;
}

.feed-page.is-dark .bt-ct-copy-pill {
  background: #1e293b;
  color: #a5b4fc;
}

.feed-page.is-dark .bt-ct-step-code-callout {
  background: rgba(22, 163, 74, 0.14);
  border-color: rgba(74, 222, 128, 0.32);
  color: #86efac;
}

.feed-page.is-dark .bt-ct-card-url {
  background: #16253c;
  color: #7dd3fc;
}

.feed-page.is-dark .bt-ct-card-footer {
  border-top-color: #24324a;
}

.feed-page.is-dark .bt-ct-progress-bar {
  background: #24324a;
}

.feed-page.is-dark .bt-ct-btn-secondary {
  background: #1e2d45;
  color: #e5edf8;
  border-color: #304566;
}

.feed-page.is-dark .bt-ct-table th {
  background: #172338;
  color: #cbd5e1;
  border-bottom-color: #273752;
}

.feed-page.is-dark .bt-ct-table td {
  color: #e5edf8;
  border-bottom-color: #1e2d45;
}

/* ==========================================================================
   USER ADMIN PORTAL — MODERN SAAS LIGHT MODE (/dashboard, /tasks, /tasks/create)
   Design System: #F8FAFC canvas · #FFFFFF cards · 1px #E2E8F0 · 10px radius
   Primary: #2563EB / #1D4ED8 (Traffic) · Accent: #0D9488 (SEO)
   App Shell: Collapsible Left Sidebar (240px / 68px) + Sticky Top Header (60px)
   ========================================================================== */
:root {
  --bt-ua-sidebar-w: 240px;
  --bt-ua-header-h: 60px;
  --bt-saas-bg: #F8FAFC;
  --bt-saas-card: #FFFFFF;
  --bt-saas-border: #E2E8F0;
  --bt-saas-primary: #2563EB;
  --bt-saas-primary-hover: #1D4ED8;
  --bt-saas-seo: #0D9488;
  --bt-saas-text: #0F172A;
  --bt-saas-muted: #64748B;
}

body.bt-user-admin-mode.bt-ua-collapsed {
  --bt-ua-sidebar-w: 68px;
}

body.bt-user-admin-mode {
  background: var(--bt-saas-bg) !important;
  color: var(--bt-saas-text);
  overflow-x: hidden;
}

body.bt-user-admin-mode .app-page:not(.admin-page) {
  padding: calc(var(--bt-ua-header-h) + 24px) 28px 48px calc(var(--bt-ua-sidebar-w) + 28px) !important;
  background: var(--bt-saas-bg) !important;
  min-height: 100vh !important;
  box-sizing: border-box !important;
  transition: padding-left 0.18s ease;
}

body.bt-user-admin-mode .app-page:not(.admin-page) .app-container {
  max-width: 1280px !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding: 0 !important;
}

/* Ẩn topbar cũ đơn điệu vì đã có App Shell chuẩn SaaS */
body.bt-user-admin-mode .app-page:not(.admin-page) .app-topbar {
  display: none !important;
}

/* Đồng bộ card React gốc (/tasks Traffic, /tasks/create) với Design System */
body.bt-user-admin-mode .tasks-card,
body.bt-user-admin-mode .app-card {
  background: var(--bt-saas-card) !important;
  border: 1px solid var(--bt-saas-border) !important;
  border-radius: 10px !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03) !important;
}

body.bt-user-admin-mode .tasks-card {
  padding: 18px 20px !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.bt-user-admin-mode .tasks-card:hover {
  border-color: #CBD5E1 !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05) !important;
}

body.bt-user-admin-mode .tasks-badge {
  border-radius: 999px !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  padding: 4px 10px !important;
}

/* --- Left Sidebar (240px, collapsible to 68px, Light Mode SaaS) --- */
#bt-ua-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--bt-ua-sidebar-w);
  z-index: 1015;
  display: none;
  flex-direction: column;
  background: #FFFFFF;
  color: #0F172A;
  border-right: 1px solid #E2E8F0;
  transition: width 0.18s ease, transform 0.2s ease;
  font-family: inherit;
}

body.bt-user-admin-mode #bt-ua-sidebar {
  display: flex;
}

.bt-ua-sb-head {
  height: var(--bt-ua-header-h);
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #E2E8F0;
  flex-shrink: 0;
}

.bt-ua-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #0F172A;
  min-width: 0;
  overflow: hidden;
}

.bt-ua-brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  padding: 2px;
  object-fit: cover;
  flex-shrink: 0;
}

.bt-ua-brand-name {
  font-size: 15.5px;
  font-weight: 900;
  letter-spacing: 0.03em;
  color: #0F172A;
  white-space: nowrap;
}

.bt-ua-collapse-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  color: #64748B;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.14s ease;
}

.bt-ua-collapse-btn:hover {
  background: #F1F5F9;
  color: #0F172A;
  border-color: #CBD5E1;
}

.bt-ua-sb-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bt-ua-sb-group-label {
  padding: 0 10px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94A3B8;
  white-space: nowrap;
}

.bt-ua-sb-list {
  display: grid;
  gap: 3px;
}

.bt-ua-sb-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: #475569;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background 0.14s ease, color 0.14s ease;
}

.bt-ua-sb-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.bt-ua-sb-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke-width: 2;
}

.bt-ua-sb-item:hover {
  background: #F1F5F9;
  color: #0F172A;
}

.bt-ua-sb-item.is-active {
  background: #EFF6FF;
  color: #1D4ED8;
  font-weight: 700;
}

.bt-ua-sb-item.is-seo-active {
  background: #F0FDFA;
  color: #0F766E;
  font-weight: 700;
}

.bt-ua-sb-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  background: #CCFBF1;
  color: #0F766E;
  font-variant-numeric: tabular-nums;
}

.bt-ua-sb-foot {
  padding: 12px 10px;
  border-top: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #FFFFFF;
  flex-shrink: 0;
}

.bt-ua-sb-user {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.bt-ua-sb-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #2563EB;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  object-fit: cover;
  flex-shrink: 0;
}

.bt-ua-sb-user-meta {
  min-width: 0;
}

.bt-ua-sb-user-meta strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #0F172A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bt-ua-sb-user-meta small {
  display: block;
  font-size: 11.5px;
  color: #64748B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bt-ua-logout-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
  color: #64748B;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.14s ease;
}

.bt-ua-logout-btn:hover {
  background: #FEF2F2;
  color: #DC2626;
  border-color: #FECACA;
}

/* Collapsed Sidebar State (68px) */
body.bt-user-admin-mode.bt-ua-collapsed .bt-ua-brand-name,
body.bt-user-admin-mode.bt-ua-collapsed .bt-ua-sb-group-label,
body.bt-user-admin-mode.bt-ua-collapsed .bt-ua-sb-label,
body.bt-user-admin-mode.bt-ua-collapsed .bt-ua-sb-badge,
body.bt-user-admin-mode.bt-ua-collapsed .bt-ua-sb-user-meta {
  display: none !important;
}

body.bt-user-admin-mode.bt-ua-collapsed .bt-ua-sb-head {
  justify-content: center;
  padding: 0 8px;
}

body.bt-user-admin-mode.bt-ua-collapsed .bt-ua-brand-link {
  display: none;
}

body.bt-user-admin-mode.bt-ua-collapsed .bt-ua-sb-item {
  justify-content: center;
  padding: 0;
}

body.bt-user-admin-mode.bt-ua-collapsed .bt-ua-sb-foot {
  flex-direction: column;
  padding: 10px 8px;
}

/* --- Sticky Top Header (60px, Light Mode SaaS) --- */
#bt-ua-header {
  position: fixed;
  top: 0;
  left: var(--bt-ua-sidebar-w);
  right: 0;
  height: var(--bt-ua-header-h);
  z-index: 1010;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #E2E8F0;
  transition: left 0.18s ease;
}

body.bt-user-admin-mode #bt-ua-header {
  display: flex;
}

.bt-ua-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.bt-ua-menu-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
  color: #0F172A;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.bt-ua-page-heading {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bt-ua-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Grouped Dual Wallet Pills in Top Header */
.bt-ua-wallet-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bt-ua-wallet-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.bt-ua-wallet-pill.is-traffic {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1E40AF;
}

.bt-ua-wallet-pill.is-traffic strong {
  color: #1D4ED8;
  font-weight: 800;
}

.bt-ua-wallet-pill.is-seo {
  background: #F0FDFA;
  border: 1px solid #99F6E4;
  color: #115E59;
}

.bt-ua-wallet-pill.is-seo strong {
  color: #0D9488;
  font-weight: 800;
}

.bt-ua-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  border: 0;
  background: #2563EB;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background 0.14s ease;
}

.bt-ua-cta-btn:hover {
  background: #1D4ED8;
}

#bt-ua-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1012;
  background: rgba(15, 23, 42, 0.45);
  display: none;
}

body.bt-ua-mobile-open #bt-ua-backdrop {
  display: block;
}

/* --- Unified SaaS KPI Cards (4 columns, 10px radius, #FFFFFF) --- */
.bt-saas-view {
  display: grid;
  gap: 20px;
  animation: btCtFadeIn 0.18s ease;
}

.bt-ua-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.bt-ua-kpi-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bt-ua-kpi-card:hover {
  border-color: #CBD5E1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.bt-ua-kpi-card.is-clickable {
  cursor: pointer;
}

.bt-ua-kpi-label {
  font-size: 12.5px;
  font-weight: 600;
  color: #64748B;
}

.bt-ua-kpi-val {
  margin-top: 8px;
  font-size: 26px;
  font-weight: 800;
  color: #0F172A;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.bt-ua-kpi-sub {
  margin-top: 6px;
  font-size: 12px;
  color: #64748B;
}

.bt-ua-kpi-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bt-ua-kpi-icon.is-blue { background: #EFF6FF; color: #2563EB; }
.bt-ua-kpi-icon.is-teal { background: #F0FDFA; color: #0D9488; }
.bt-ua-kpi-icon.is-purple { background: #F5F3FF; color: #7C3AED; }
.bt-ua-kpi-icon.is-green { background: #ECFDF5; color: #059669; }
.bt-ua-kpi-icon.is-red { background: #FEF2F2; color: #DC2626; }

/* --- SaaS Section Cards & 2-Column Grids --- */
.bt-saas-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.bt-saas-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  overflow: hidden;
}

.bt-saas-card-head {
  padding: 15px 20px;
  border-bottom: 1px solid #F1F5F9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bt-saas-card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #0F172A;
}

.bt-saas-card-body {
  padding: 18px 20px;
}

/* Account Info Grid */
.bt-saas-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}

.bt-saas-info-item small {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #64748B;
  margin-bottom: 3px;
}

.bt-saas-info-item strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: #0F172A;
  word-break: break-word;
}

/* Status Pill with Green Dot */
.bt-saas-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.bt-saas-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.bt-saas-status.is-active { background: #ECFDF5; color: #059669; }
.bt-saas-status.is-depleted { background: #FFFBEB; color: #D97706; }
.bt-saas-status.is-paused { background: #F1F5F9; color: #475569; }
.bt-saas-status.is-blocked { background: #FEF2F2; color: #DC2626; }

/* Activity Visual Progress Bars */
.bt-saas-activity-list {
  display: grid;
  gap: 15px;
}

.bt-saas-activity-row-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}

.bt-saas-activity-row-head span {
  color: #475569;
  font-weight: 600;
}

.bt-saas-activity-row-head strong {
  color: #0F172A;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.bt-saas-bar {
  height: 7px;
  border-radius: 999px;
  background: #F1F5F9;
  overflow: hidden;
}

.bt-saas-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.bt-saas-bar-fill.is-blue { background: #2563EB; }
.bt-saas-bar-fill.is-teal { background: #0D9488; }
.bt-saas-bar-fill.is-green { background: #10B981; }
.bt-saas-bar-fill.is-amber { background: #F59E0B; }

/* Subtle Empty State */
.bt-saas-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 16px;
}

.bt-saas-empty-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  color: #94A3B8;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.bt-saas-empty strong {
  font-size: 14px;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 4px;
}

.bt-saas-empty p {
  margin: 0 0 14px;
  font-size: 13px;
  color: #64748B;
  max-width: 300px;
  line-height: 1.45;
}

/* Filter Toolbar (Website SEO) */
.bt-ua-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
}

.bt-ua-toolbar-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 240px;
}

.bt-ua-search-wrap {
  position: relative;
  flex: 1;
  min-width: 210px;
  max-width: 320px;
}

.bt-ua-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: #94A3B8;
  pointer-events: none;
}

.bt-ua-search-input {
  width: 100%;
  box-sizing: border-box;
  height: 36px;
  padding: 0 12px 0 34px;
  border-radius: 8px;
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  color: #0F172A;
  font-size: 13px;
  outline: none;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.bt-ua-search-input:focus {
  background: #FFFFFF;
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.bt-ua-filter-pills {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 3px;
  border-radius: 8px;
  background: #F1F5F9;
}

.bt-ua-filter-pill {
  height: 30px;
  padding: 0 11px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: #475569;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
}

.bt-ua-filter-pill:hover {
  color: #0F172A;
}

.bt-ua-filter-pill.is-active {
  background: #FFFFFF;
  color: #0F172A;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

/* Modern SaaS Data Table (Website SEO & Lịch sử SEO) */
.bt-saas-table-wrap {
  overflow-x: auto;
}

.bt-saas-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.bt-saas-table th {
  text-align: left;
  padding: 11px 16px;
  background: #F8FAFC;
  color: #64748B;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #E2E8F0;
  white-space: nowrap;
}

.bt-saas-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #F1F5F9;
  color: #0F172A;
  vertical-align: middle;
}

.bt-saas-table tbody tr:last-child td {
  border-bottom: 0;
}

.bt-saas-table tbody tr:hover td {
  background: #F8FAFC;
}

.bt-num-col {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Point delta badges */
.bt-delta-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.bt-delta-badge.is-plus { background: #ECFDF5; color: #059669; }
.bt-delta-badge.is-minus { background: #FEF2F2; color: #DC2626; }

/* Monospace copyable code badge */
.bt-code-copy-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  color: #0F172A;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.14s ease;
}

.bt-code-copy-badge:hover {
  background: #EFF6FF;
  border-color: #BFDBFE;
  color: #1D4ED8;
}

/* Row Action Buttons & "..." Dropdown Menu */
.bt-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  position: relative;
}

.bt-saas-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 32px;
  padding: 0 11px;
  border-radius: 7px;
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
  color: #334155;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  text-decoration: none;
  transition: all 0.14s ease;
}

.bt-saas-btn:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
  color: #0F172A;
}

.bt-saas-btn.is-primary {
  background: #2563EB;
  border-color: #2563EB;
  color: #FFFFFF;
}

.bt-saas-btn.is-primary:hover {
  background: #1D4ED8;
  border-color: #1D4ED8;
}

.bt-saas-btn.is-teal {
  background: #F0FDFA;
  border-color: #99F6E4;
  color: #0F766E;
}

.bt-saas-btn.is-teal:hover {
  background: #CCFBF1;
}

.bt-more-wrap {
  position: relative;
  display: inline-block;
}

.bt-more-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 7px;
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
  color: #475569;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bt-more-btn:hover {
  background: #F1F5F9;
  color: #0F172A;
}

.bt-more-menu {
  position: fixed;
  min-width: 176px;
  z-index: 9999;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 5px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
  display: none;
  flex-direction: column;
  gap: 2px;
}

.bt-more-menu.is-open {
  display: flex;
}

.bt-more-menu button {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.bt-more-menu button:hover {
  background: #F1F5F9;
  color: #0F172A;
}

.bt-more-menu button.is-danger {
  color: #DC2626;
}

.bt-more-menu button.is-danger:hover {
  background: #FEF2F2;
}

/* Project Filter Bar & Active Project Strip */
.bt-proj-bar {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bt-proj-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  flex: 1;
}

.bt-proj-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  color: #334155;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
}

.bt-proj-pill:hover {
  background: #FFFFFF;
  border-color: #CBD5E1;
  color: #0F172A;
}

.bt-proj-pill.is-active {
  background: #EFF6FF;
  border-color: #2563EB;
  color: #1D4ED8;
  font-weight: 700;
}

.bt-proj-pill-domain {
  font-size: 11.5px;
  color: #64748B;
  font-weight: 500;
}

.bt-proj-pill.is-active .bt-proj-pill-domain {
  color: #3B82F6;
}

.bt-proj-pill-count {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #E2E8F0;
  color: #334155;
  font-variant-numeric: tabular-nums;
}

.bt-proj-pill.is-active .bt-proj-pill-count {
  background: #DBEAFE;
  color: #1D4ED8;
}

.bt-proj-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  display: inline-block;
  flex-shrink: 0;
}

.bt-proj-dot.is-ok { background: #10B981; }
.bt-proj-dot.is-wait { background: #F59E0B; }

.bt-proj-banner {
  background: #FFFFFF;
  border: 1px solid #BFDBFE;
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bt-proj-locked-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 9px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  font-size: 13px;
  color: #334155;
}

/* Quick List Row in Dashboard Recent / Liked */
.bt-mini-post-list {
  display: grid;
  gap: 0;
}

.bt-mini-post-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid #F1F5F9;
}

.bt-mini-post-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.bt-mini-post-row:first-child {
  padding-top: 0;
}

.bt-mini-post-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #0F172A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bt-mini-post-meta {
  font-size: 12px;
  color: #64748B;
  margin-top: 2px;
}

.bt-ct-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.bt-ct-quick-chip {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  color: #0F172A;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.bt-ct-quick-chip:hover {
  background: #EFF6FF;
  border-color: #93C5FD;
  color: #1D4ED8;
}

/* Responsive App Shell */
@media (max-width: 1120px) {
  .bt-ua-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .bt-saas-grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  body.bt-user-admin-mode .app-page:not(.admin-page) {
    padding: calc(var(--bt-ua-header-h) + 18px) 16px 36px 16px !important;
  }
  #bt-ua-header {
    left: 0 !important;
    padding: 0 14px;
  }
  .bt-ua-menu-toggle {
    display: inline-flex;
  }
  #bt-ua-sidebar {
    width: 240px !important;
    transform: translateX(-105%);
  }
  body.bt-ua-mobile-open #bt-ua-sidebar {
    transform: translateX(0);
  }
  .bt-ua-collapse-btn {
    display: none;
  }
  .bt-ua-wallet-pill.is-traffic {
    display: none;
  }
}

@media (max-width: 640px) {
  .bt-ua-kpi-grid {
    grid-template-columns: 1fr;
  }
  .bt-ua-wallet-group {
    display: none;
  }
  .bt-saas-info-grid {
    grid-template-columns: 1fr;
  }
}

/* Responsive */
@media (max-width: 980px) {
  .feed-page .feed-shell-topbar {
    grid-template-columns: auto 1fr !important;
    row-gap: 10px !important;
  }
  .feed-page .feed-shell-topbar .feed-topbar-actions {
    grid-column: 2 !important;
    justify-self: end !important;
  }
  .feed-page .feed-shell-topbar .feed-topbar-center {
    display: flex !important;
    grid-column: 1 / -1 !important;
    order: 3 !important;
    width: 100% !important;
  }
  .bt-center-nav {
    width: 100%;
    justify-content: center;
  }
  .bt-center-nav-btn {
    flex: 1;
    justify-content: center;
    padding: 0 10px;
    font-size: 13px;
  }
}

@media (max-width: 640px) {
  .bt-ct-score-card {
    padding: 8px 4px;
  }
  .bt-ct-score-box {
    padding: 2px 8px;
  }
  .bt-ct-score-val {
    font-size: 18px;
  }
  .bt-ct-form-row-2 {
    grid-template-columns: 1fr;
  }
  .bt-ct-verify-top-form {
    flex-direction: column;
    align-items: stretch;
  }
  .bt-ct-runner {
    padding: 16px;
  }
  .bt-ct-modal {
    padding: 16px;
  }
}
