/* Bieu do xu ly van ban.
   Node la div absolute (de style/gan event de), canh la SVG nam duoi lop node. */

.bdxl-wrap { display: flex; flex-direction: column; gap: .5rem; }

.bdxl-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; flex-wrap: wrap;
}
.bdxl-toolbar-right { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }

.bdxl-legend { display: flex; align-items: center; gap: .85rem; flex-wrap: wrap; font-size: .78rem; color: #566a7f; }
.bdxl-lg { display: inline-flex; align-items: center; gap: .35rem; }
.bdxl-lg i { width: 14px; height: 14px; border-radius: 3px; border: 1.5px solid; display: inline-block; }
.bdxl-lg b { width: 22px; height: 3px; border-radius: 2px; display: inline-block; }

.bdxl-view { min-height: 200px; }

.bdxl-canvas {
  position: relative; overflow: auto; background: #fafbfc;
  border: 1px solid #e7eaee; border-radius: 8px;
  height: 62vh; min-height: 380px; cursor: grab;
}
.bdxl-canvas.dang-keo { cursor: grabbing; user-select: none; }
.bdxl-canvas:focus-visible { outline: 2px solid #0d6efd; outline-offset: -2px; }

.bdxl-scale { position: relative; }
.bdxl-svg { position: absolute; inset: 0; pointer-events: none; }
.bdxl-nodes { position: absolute; inset: 0; }

.bdxl-node {
  position: absolute; border: 1.5px solid; border-radius: 8px;
  padding: .4rem .5rem; box-sizing: border-box; cursor: pointer;
  box-shadow: 0 1px 3px rgba(67, 89, 113, .12);
  transition: box-shadow .15s ease, transform .15s ease;
}
.bdxl-node:hover { box-shadow: 0 3px 10px rgba(67, 89, 113, .22); transform: translateY(-1px); z-index: 5; }
.bdxl-node:focus-visible { outline: 2px solid #0d6efd; outline-offset: 2px; }

.bdxl-node-head { display: flex; align-items: center; gap: .3rem; font-size: .8rem; font-weight: 600; line-height: 1.25; }
.bdxl-node-ten { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.bdxl-node-phu { font-size: .68rem; opacity: .82; line-height: 1.2; margin-top: .1rem;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bdxl-node-time { font-size: .66rem; opacity: .7; margin-top: .15rem; }

.bdxl-star { color: #f0ad00; font-size: .9rem; }

.bdxl-badge-ykien, .bdxl-badge-traloi {
  position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px;
  border-radius: 9px; background: #566a7f; color: #fff;
  font-size: .64rem; font-weight: 700; line-height: 18px; text-align: center;
  padding: 0 4px; display: inline-flex; align-items: center; gap: 1px;
}
.bdxl-badge-traloi { right: auto; left: -7px; background: #ff3e1d; }

@keyframes bdxl-nhay {
  0%, 100% { box-shadow: 0 1px 3px rgba(67, 89, 113, .12); }
  50% { box-shadow: 0 0 0 5px rgba(13, 110, 253, .35); }
}
.bdxl-node.bdxl-nhay { animation: bdxl-nhay .8s ease-in-out 2; z-index: 6; }

.bdxl-hint { font-size: .74rem; margin-top: .25rem; }

@media (max-width: 767.98px) {
  .bdxl-canvas { height: 52vh; }
  .bdxl-toolbar { align-items: flex-start; flex-direction: column; }
}
