.tree ul {
  position: relative;
  padding: 1em 0;
  white-space: nowrap;
  margin: 0 auto;
  text-align: center;
}

.tree ul::after {
  content: "";
  display: table;
  clear: both;
}

.tree ul.tree-end > li > a {
  border-radius: 50%;
}

.tree .header-diagram-box {
  padding: 0.3rem 0.3rem 0.3rem 0.3rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #f7f7f7;
}

.tree .header-diagram-box i {
  cursor: pointer;
}

.tree .header-diagram-box i:hover {
  color: #048ba8;
}

.tree li {
  display: inline-block;
  vertical-align: top;
  text-align: center;
  list-style-type: none;
  position: relative;
  padding: 1em 0.5em 0 0.5em;
}

.tree li::before,
.tree li::after {
  content: "";
  position: absolute;
  top: 0;
  right: 50%;
  border-top: 1px solid #00386d;
  width: 50%;
  height: 1em;
}

.tree li::after {
  right: auto;
  left: 50%;
  border-left: 1px solid #00386d;
}

.tree li:only-child::after,
.tree li:only-child::before {
  display: none;
}

.tree li:only-child {
  padding-top: 0;
}

.tree li:first-child::before,
.tree li:last-child::after {
  border: 0 none;
}

.tree li:last-child::before {
  border-right: 1px solid #00386d;
  border-radius: 0 5px 0 0;
}

.tree li:first-child::after {
  border-radius: 5px 0 0 0;
}

.tree ul ul::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  border-left: 1px solid #00386d;
  width: 0;
  height: 1em;
}

.tree li a {
  border: 1px solid #00386d;
  padding: 0.5em 0.75em;
  text-decoration: none;
  display: inline-block;
  border-radius: 10px;
  color: #333;
  position: relative;
  top: 1px;
}

.tree li a:hover {
  box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
}

.tree li a:hover + ul li::after,
.tree li a:hover + ul li::before,
.tree li a:hover + ul::before,
.tree li a:hover + ul ul::before {
  border-color: #048ba8;
}

.no-tree-action {
  cursor: not-allowed;
}

/* Para el nodo */
.nodo-rojo {
  background-color: #dc3545 !important;
  color: white !important;
  border-color: #dc3545 !important;
}

/* Para la línea (si la agregaste) */
.linea-roja path,
.linea-roja line {
  stroke: #dc3545 !important;
  stroke-width: 2px !important;
}

/* Para la flecha */
.linea-roja marker path,
.linea-roja marker polygon {
  fill: #dc3545 !important;
}
