/* === RED AGENCIAS - TREE GRAPH (ÁRBOL) === */

#ra-tree-graph-host{
  margin-top: 10px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  background: rgba(2, 6, 23, .55);
  overflow: hidden;
  position: relative;
  min-height: 360px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35) inset;
  touch-action: none;
  cursor: grab;
}

#ra-tree-graph-host.is-dragging{ cursor: grabbing; }

#ra-tree-graph-ui{
  position:absolute;
  top: 10px;
  right: 10px;
  display:flex;
  gap: 8px;
  z-index: 3;
}

#ra-tree-graph-ui .raT-btn{
  background: rgba(15, 23, 42, .85);
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.90);
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}

#ra-tree-graph-ui .raT-btn:hover{
  border-color: rgba(255,138,42,.55);
  box-shadow: 0 0 0 3px rgba(255,138,42,.08);
}

#ra-tree-graph-wrap{
  position:absolute;
  left:0; top:0;
  transform-origin: 0 0;
  will-change: transform;
}

#ra-tree-graph-wrap::before{
  content:"";
  position:absolute; inset:0;
  background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity:.55;
  pointer-events:none;
}

#ra-tree-graph-svg{
  position:absolute; inset:0;
  width:100%;
  height:100%;
  pointer-events:none;
}

#ra-tree-graph-nodes{
  position:absolute;
  inset:0;
}

.raT-node{
  position:absolute;
  width: 360px;
  min-height: 54px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(15, 23, 42, .92);
  color: rgba(255,255,255,.92);
  display:flex;
  align-items:flex-start;
  gap: 10px;
  padding: 10px 12px;
  box-shadow: 0 12px 25px rgba(0,0,0,.35);
  user-select:none;
  cursor: pointer;
}

.raT-node:hover{
  border-color: rgba(255,138,42,.55);
  box-shadow: 0 0 0 3px rgba(255,138,42,.08), 0 14px 30px rgba(0,0,0,.40);
}

.raT-node[data-selected="1"]{
  border-color: rgba(255,138,42,.85);
  box-shadow: 0 0 0 3px rgba(255,138,42,.12), 0 14px 30px rgba(0,0,0,.45);
}

.raT-badge{
  font-size: 11px;
  letter-spacing: .5px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.85);
  text-transform: uppercase;
  flex: 0 0 auto;
}

.raT-title{
  font-size: 13px;
  line-height: 1.25;
  font-weight: 700;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  max-width: 220px;
  word-break: break-word;
}

.raT-sub{
  margin-left:auto;
  font-size: 11px;
  color: rgba(255,255,255,.62);
  padding-left: 8px;
  max-width: 120px;
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.raT-node[data-tipo="negocio"]{ background: rgba(30, 41, 59, .92); }
.raT-node[data-tipo="grupo"]{ background: rgba(15, 23, 42, .92); }
.raT-node[data-tipo="agencia"]{ background: rgba(13, 18, 34, .92); }
.raT-node[data-tipo="vendedor"]{ background: rgba(10, 14, 26, .92); }
.raT-node[data-tipo="cliente"]{ background: rgba(10, 14, 26, .92); }
.raT-node[data-tipo="marca"]{ background: rgba(13, 18, 34, .92); }
.raT-node[data-tipo="modelo"]{ background: rgba(10, 14, 26, .92); }
.raT-node[data-tipo="staff"]{ background: rgba(10, 14, 26, .92); }

@keyframes raT-pulse{
  0%{ transform: translateZ(0) scale(1); }
  40%{ transform: translateZ(0) scale(1.02); }
  100%{ transform: translateZ(0) scale(1); }
}

.raT-pulse{
  animation: raT-pulse 520ms ease-out;
}

