:root{
  --accent: #F68B1E;
  --accent-bg: #FDE8D2;
  --line: #cfe7d1;
  --card-border: rgba(47,140,87,0.12);
  --text: #222;
  --muted: #7b7b7b;
  --radius: 12px;
}

/* Container & RTL */
.org-chart {
  direction: rtl;
  text-align: center;
  padding: 36px 16px;
  font-family: "Cairo", "Noto Sans Arabic", system-ui, sans-serif;
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
  position: relative;
}

/* Main Node */
.main-node {
  display: flex;
  justify-content: center;
  position: relative;
  margin-bottom: 0;
}

.node-box {
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  padding: 20px 28px;
  min-width: 260px;
  box-shadow: 0 6px 18px rgba(9, 30, 15, 0.06);
  border: 1px solid var(--card-border);
  transition: transform .22s ease, box-shadow .22s ease;
  text-align: center;
}

.node-box.main{
  min-width: 680px;
  max-width: 95%;
  padding: 26px 36px;
  border: 1px solid rgba(47,140,87,0.12);
}

/* Icon */
.node-box .icon{
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 30px;
  color: var(--accent);
  border: 2px solid rgba(47,140,87,0.08);
}

.node-title{
  font-weight: 700;
  font-size: 22px;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.1;
}

.node-desc{
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  max-width: 860px;
  margin: 0 auto;
}

.node-box:hover{
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(9,30,15,0.09);
}

/* Main connector */
.node-box.main::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 100%;
  width: 3px;
  height: 40px;
  background: var(--line);
  z-index: 0;
}

.children {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between; /* first child at start, last child at end */
  margin-top: 40px;
  position: relative;
  width: 100%;
}

/* Horizontal connector only between first and last child */
.children::before {
  content: "";
  position: absolute;
  top: 0;
  left: 145px; 
  right: 145px;
  height: 3px;
  background: var(--line);
  z-index: 0;
  border-radius: 2px;
}

/* Child nodes */
.child {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 40px; /* vertical spacing */
  flex: 1 1 0; /* auto width for equal spacing */
}

/* Vertical connector from horizontal line to child */
.child::before {
  content: "";
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 40px;
  background: var(--line);
  z-index: 0;
}


.child .node-box {
  min-width: 220px;
  max-width: 260px;
  padding: 18px 16px;
  text-align: center;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 6px 18px rgba(9,30,15,0.06);
  border: 1px solid var(--card-border);
  transition: transform .22s ease, box-shadow .22s ease;
  z-index: 0;
}

.child .node-box:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(9,30,15,0.09);
}

.child .node-title { font-size: 18px; }
.child .node-desc  { font-size: 13px; }

/* Responsive */
@media (max-width: 860px) {
  .node-box.main { min-width: 95%; }
  .children { gap: 14px; margin-top: 30px; }
  .child::before { top: -30px; height: 30px; }
}

@media (max-width: 600px) {
  .children {
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
  }
  .children::before { display: none; }
  .child::before { display: none; }
  .node-box.main { padding: 18px 16px; }
  .node-box { padding: 14px 12px; }
  .node-box .icon { width: 60px; height: 60px; font-size: 24px; }
}
