/* ===== Công cụ BM bằng Token — panel overlay trên #accounts (.bmt-*) ===== */
.bmt-overlay {
  position: absolute; inset: 0; z-index: 15;
  background: #f6f7f9; color: #111827; font-size: 13px; text-align: left;
  display: flex; flex-direction: column; overflow: hidden;
}
[data-bs-theme="dark"] .bmt-overlay { background: #0f1319; color: #e5e7eb; }

/* Header */
.bmt-hd { display: flex; align-items: center; gap: 11px; padding: 11px 16px; background: #fff; border-bottom: 1px solid #ececf1; flex-shrink: 0; }
[data-bs-theme="dark"] .bmt-hd { background: #171c24; border-color: #262c36; }
.bmt-back { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: none; border-radius: 8px; background: #e0f2fe; color: #0369a1; font-size: 12.5px; font-weight: 650; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.bmt-back i { font-size: 16px; }
.bmt-back:hover { background: #bae6fd; }
[data-bs-theme="dark"] .bmt-back { background: #0e3a52; color: #7dd3fc; }
.bmt-hd-ic { width: 34px; height: 34px; border-radius: 10px; background: #ede9fe; color: #6366f1; display: flex; align-items: center; justify-content: center; font-size: 19px; flex-shrink: 0; }
[data-bs-theme="dark"] .bmt-hd-ic { background: #241a3d; color: #a78bfa; }
.bmt-hd-t { flex: 1; min-width: 0; }
.bmt-hd-ti { font-size: 15px; font-weight: 700; color: #111827; }
[data-bs-theme="dark"] .bmt-hd-ti { color: #f3f4f6; }
.bmt-hd-sub { font-size: 12px; color: #6b7280; margin-top: 1px; }

/* Scroll body — nội dung căn giữa, tối đa 760px */
.bmt-scroll { flex: 1; min-height: 0; overflow: auto; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.bmt-scroll > * { width: 100%; max-width: 760px; }

/* Card */
.bmt-card { background: #fff; border: 1px solid #e8eaf1; border-radius: 14px; padding: 16px 18px; }
[data-bs-theme="dark"] .bmt-card { background: #171c24; border-color: #262c36; }

.bmt-field { display: flex; flex-direction: column; gap: 6px; }
.bmt-lb { font-size: 12px; font-weight: 600; color: #64748b; margin: 0; }
[data-bs-theme="dark"] .bmt-lb { color: #94a3b8; }
.bmt-row2 { display: flex; gap: 12px; align-items: flex-end; }
.bmt-row2 .bmt-bmid { flex: 0 0 200px; }
.bmt-row2 .bmt-verify { flex: 0 0 120px; }
.bmt-row3 { display: flex; gap: 12px; align-items: flex-end; }
.bmt-row3 .bmt-field { flex: 1; min-width: 0; }
.bmt-grow { flex: 1; min-width: 0; }
.bmt-overlay textarea.form-control { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }

/* Control fixes — modern-theme đặt .btn{border:none} (nút outline mất viền) và
   .form-select padding hẹp (chữ chạm mũi tên ▾). Khôi phục trong phạm vi panel. */
.bmt-overlay .form-control,
.bmt-overlay .form-select { border-radius: 9px; min-height: 40px; }
.bmt-overlay .form-select { padding-right: 36px; background-position: right 12px center; }
.bmt-overlay .btn { border-radius: 9px; }
.bmt-overlay .btn-outline-primary { border: 1.5px solid #6366f1; color: #4f46e5; }
.bmt-overlay .btn-outline-primary:hover { background: #6366f1; border-color: #6366f1; color: #fff; }
.bmt-overlay .btn-outline-danger { border: 1.5px solid #ef4444; color: #dc2626; }
.bmt-overlay .btn-outline-danger:hover { background: #ef4444; border-color: #ef4444; color: #fff; }
[data-bs-theme="dark"] .bmt-overlay .btn-outline-primary { color: #a5b4fc; }
[data-bs-theme="dark"] .bmt-overlay .btn-outline-danger { color: #f87171; }

.bmt-bminfo { margin-top: 12px; padding: 9px 12px; border-radius: 10px; font-size: 13px; display: flex; align-items: center; gap: 8px; background: rgba(16, 185, 129, 0.1); color: #047857; border: 1px solid rgba(16, 185, 129, 0.25); }
.bmt-bminfo.is-err { background: rgba(239, 68, 68, 0.1); color: #b91c1c; border-color: rgba(239, 68, 68, 0.25); }

/* Tabs */
.bmt-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; background: #eef0f4; border: 1px solid #e8eaf1; border-radius: 12px; padding: 5px; }
[data-bs-theme="dark"] .bmt-tabs { background: #12161d; border-color: #262c36; }
.bmt-tab { border: 0; background: transparent; border-radius: 8px; padding: 9px 6px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: #64748b; cursor: pointer; transition: all 0.15s ease; }
.bmt-tab i { font-size: 18px; }
.bmt-tab:hover { color: #111827; }
[data-bs-theme="dark"] .bmt-tab:hover { color: #e5e7eb; }
.bmt-tab.is-active { background: #fff; color: #4f46e5; box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08); }
[data-bs-theme="dark"] .bmt-tab.is-active { background: #0f1319; color: #a5b4fc; }

/* Panel section */
.bmt-panel-sec { display: none; }
.bmt-panel-sec.is-active { display: block; animation: bmtFade 0.18s ease; }
@keyframes bmtFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.bmt-panel-hd { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.bmt-panel-hd i { color: #6366f1; font-size: 19px; }
.bmt-desc { font-size: 12.5px; color: #64748b; margin: 0 0 14px; line-height: 1.5; }
[data-bs-theme="dark"] .bmt-desc { color: #94a3b8; }
.bmt-run { margin-top: 14px; }
.bmt-panel-actions { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.bmt-count { font-size: 12.5px; color: #64748b; }

/* Kết quả backup */
.bmt-result { margin-top: 16px; }
.bmt-copybox { position: relative; }
.bmt-copybox .form-control { padding-right: 44px; font-size: 12.5px; }
.bmt-copybtn { position: absolute; top: 0; right: 0; height: 100%; width: 40px; border: 0; background: transparent; color: #64748b; cursor: pointer; border-left: 1px solid #e2e8f0; border-radius: 0 6px 6px 0; }
.bmt-copybtn:hover { color: #4f46e5; }
.bmt-sub { font-size: 12px; color: #94a3b8; margin-top: 6px; }

/* Bảng */
.bmt-tablewrap { margin-top: 14px; overflow-x: auto; }
.bmt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.bmt-table th, .bmt-table td { padding: 9px 10px; text-align: left; border-bottom: 1px solid #e8eaf1; }
[data-bs-theme="dark"] .bmt-table th, [data-bs-theme="dark"] .bmt-table td { border-color: #262c36; }
.bmt-table th { font-size: 11.5px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.3px; }
.bmt-table tbody tr:hover { background: #f8fafc; }
[data-bs-theme="dark"] .bmt-table tbody tr:hover { background: #12161d; }
.bmt-table td.bmt-id { font-family: ui-monospace, monospace; font-size: 12px; color: #64748b; }
.bmt-th-act, .bmt-td-act { text-align: right; white-space: nowrap; }
.bmt-badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; background: rgba(99, 102, 241, 0.12); color: #4f46e5; }
[data-bs-theme="dark"] .bmt-badge { background: #1e2140; color: #a5b4fc; }
.bmt-empty { margin-top: 14px; padding: 20px; text-align: center; font-size: 13px; color: #94a3b8; }

/* Log */
.bmt-log-card { background: #fff; border: 1px solid #e8eaf1; border-radius: 14px; overflow: hidden; }
[data-bs-theme="dark"] .bmt-log-card { background: #171c24; border-color: #262c36; }
.bmt-log-hd { display: flex; align-items: center; gap: 8px; padding: 10px 16px; font-size: 12.5px; font-weight: 700; color: #64748b; border-bottom: 1px solid #e8eaf1; }
[data-bs-theme="dark"] .bmt-log-hd { border-color: #262c36; }
.bmt-log-clear { margin-left: auto; font-size: 11.5px; font-weight: 600; color: #ef4444; cursor: pointer; border: 1px solid rgba(239, 68, 68, 0.4); border-radius: 20px; padding: 1px 10px; }
.bmt-log { max-height: 220px; overflow-y: auto; padding: 10px 16px; font-family: ui-monospace, monospace; font-size: 12px; line-height: 1.7; }
.bmt-log:empty::before { content: "Chưa có hoạt động."; color: #94a3b8; font-family: inherit; }
/* Chữ do CSS sinh ra (::before) KHÔNG phải text node nên lớp dịch không với tới. Bám vào dấu
   data-i18n-lang mà server đã đóng sẵn lên <html> để đổi theo ngôn ngữ. */
:root[data-i18n-lang="en"] .bmt-log:empty::before { content: "No activity yet."; }
.bmt-log-line { display: flex; gap: 8px; }
.bmt-log-line .t { color: #94a3b8; flex-shrink: 0; }
.bmt-log-line.ok .m { color: #059669; }
.bmt-log-line.err .m { color: #dc2626; }
[data-bs-theme="dark"] .bmt-log-line.ok .m { color: #4ade80; }
[data-bs-theme="dark"] .bmt-log-line.err .m { color: #f87171; }

@media (max-width: 620px) {
  .bmt-row2, .bmt-row3 { flex-direction: column; align-items: stretch; }
  .bmt-row2 .bmt-field { flex: none; width: 100%; }
  .bmt-tab span { display: none; }
  .bmt-tab { padding: 10px 4px; }
  .bmt-hd-sub { display: none; }
}
