#orgChartApp,
#orgChartApp * {
  font-family: "Vazirmatn", sans-serif;
  box-sizing: border-box;
}

#orgChartApp {
  background: #3c5f7e;
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 25px 10px 50px;
}

#orgChartApp .title {
  color: #e2e8f0;
  font-weight: 800;
  font-size: 1.3rem;
  margin: 0 0 40px;
  text-align: center;
}
#orgChartApp .title i {
  color: #38bdf8;
  margin-left: 6px;
}

#orgChartApp #chart-stage {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
#orgChartApp #chart {
  position: relative;
  display: inline-block;
  transform-origin: top center;
}
#orgChartApp #svg-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

#orgChartApp .col-c {
  display: flex;
  flex-direction: column;
  align-items: center;
}
#orgChartApp .row-c {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

#orgChartApp .n {
  border-radius: 13px;
  padding: 10px 7px;
  text-align: center;
  color: #fff;
  font-weight: 700;
  white-space: normal;
  transition:
    transform 0.25s,
    box-shadow 0.25s;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  position: relative;
  z-index: 2;
  opacity: 0;
  cursor: default;
}
#orgChartApp .n:hover {
  transform: translateY(-4px) scale(1.06);
  z-index: 20;
}
#orgChartApp .n .ic {
  display: block;
  margin-bottom: 5px;
}
#orgChartApp .n .en {
  font-weight: 400;
  opacity: 0.5;
  margin-top: 3px;
  letter-spacing: 0.3px;
}

#orgChartApp .n[data-person] .person-name {
  display: block;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    max-height 0.3s ease,
    opacity 0.3s ease,
    margin 0.3s ease,
    padding 0.3s ease;
  color: #fbbf24;
  font-size: 0.6rem;
  font-weight: 600;
  margin-top: 0;
  white-space: normal;
  line-height: 1.45;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  padding: 0 5px;
  text-align: center;
  max-width: 100%;
}
#orgChartApp .n[data-person]:hover .person-name {
  max-height: 64px;
  opacity: 1;
  margin-top: 5px;
  padding: 4px 5px;
}

#orgChartApp .l0 {
  background: linear-gradient(145deg, #1a365d, #2563eb);
  border-color: #60a5fa;
  box-shadow: 0 0 25px rgba(37, 99, 235, 0.5);
  font-size: 1.08rem;
  padding: 17px 34px;
  white-space: nowrap;
  animation: orgChartPulse 3s ease-in-out infinite;
}
#orgChartApp .l0 .ic {
  font-size: 1.65rem;
}
#orgChartApp .l0 .en {
  font-size: 0.6rem;
}
@keyframes orgChartPulse {
  0%,
  100% {
    box-shadow: 0 0 25px rgba(37, 99, 235, 0.5);
  }
  50% {
    box-shadow: 0 0 50px rgba(96, 165, 250, 0.7);
  }
}

#orgChartApp .l1 {
  background: linear-gradient(145deg, #065f46, #059669);
  border-color: #34d399;
  box-shadow: 0 0 18px rgba(5, 150, 105, 0.4);
  font-size: 0.86rem;
  padding: 12px 18px;
  white-space: nowrap;
}
#orgChartApp .l1 .ic {
  font-size: 1.32rem;
}
#orgChartApp .l1 .en {
  font-size: 0.58rem;
}

#orgChartApp .l2 {
  background: linear-gradient(145deg, #5b21b6, #7c3aed);
  border-color: #a78bfa;
  box-shadow: 0 0 16px rgba(124, 58, 237, 0.35);
  width: 82px;
  font-size: 0.68rem;
  padding: 10px 6px;
}
#orgChartApp .l2 .ic {
  font-size: 1.08rem;
}
#orgChartApp .l2 .en {
  font-size: 0.5rem;
}

#orgChartApp .l3 {
  background: linear-gradient(145deg, #b45309, #d97706);
  border-color: #fcd34d;
  box-shadow: 0 0 16px rgba(217, 119, 6, 0.35);
  width: 78px;
  font-size: 0.64rem;
  padding: 9px 6px;
}
#orgChartApp .l3 .ic {
  font-size: 1.02rem;
}
#orgChartApp .l3 .en {
  font-size: 0.48rem;
}

#orgChartApp .l4 {
  background: linear-gradient(145deg, #0e7490, #06b6d4);
  border-color: #67e8f9;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.35);
  width: 76px;
  font-size: 0.62rem;
  padding: 9px 6px;
}
#orgChartApp .l4 .ic {
  font-size: 0.98rem;
}
#orgChartApp .l4 .en {
  font-size: 0.48rem;
}

#orgChartApp .vl-line {
  width: 2px;
  background: #22d3ee;
  opacity: 0.9;
  border-radius: 2px;
  flex-shrink: 0;
}

#orgChartApp svg path {
  fill: none;
  stroke-linecap: round;
}

#orgChartApp .legend {
  margin-top: 50px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}
#orgChartApp .legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #94a3b8;
  font-size: 0.62rem;
}
#orgChartApp .legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
}

@media (max-width: 1199.98px) {
  #orgChartApp {
    padding: 20px 8px 36px;
  }
  #orgChartApp .title {
    font-size: 1.15rem;
    margin: 0 0 28px;
  }
}

@media (max-width: 991.98px) {
  #orgChartApp .n:hover {
    transform: translateY(-2px) scale(1.03);
  }
  #orgChartApp .legend {
    margin-top: 30px;
    gap: 10px;
  }
  #orgChartApp .legend-item {
    font-size: 0.58rem;
  }
}

@media (max-width: 575.98px) {
  #orgChartApp {
    padding: 16px 6px 24px;
  }
  #orgChartApp .title {
    font-size: 1rem;
  }
  #orgChartApp .legend {
    gap: 8px;
  }
  #orgChartApp .legend-dot {
    width: 10px;
    height: 10px;
  }
}
