.page-box {
  width: 100%;
  padding: 20px;
  box-sizing: border-box;
  /* background: #f2f2f2; */
}

/* ===== SCROLL WRAPPER ===== */
.orgchart-wrapper {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  /* background: #e6e6e6;
    border: 2px solid #aaa; */
  position: relative;
}

/* ===== ORGCHART CONTENT ===== */
.orgchart-container {
  position: relative;
  padding: 40px;
  width: max-content;
  height: auto;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 12px;
}

.orgchart-node {
  width: 250px;
  box-sizing: border-box;
  border: 2px solid #ccc;
  background: white;
  position: relative;
}

.orgchart-node-head-rank {
  text-align: center;
  border-bottom: 2px solid #ccc;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 25px;
}

.orgchart-node-head-rank-img {
  height: 20px;
}

.orgchart-node-content {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
}

.orgchart-node-department,
.orgchart-node-title {
  font-weight: bold;
}

.orgchart-node-avatar-img {
  height: 70px;
  object-fit: cover;
}

.orgchart-root {
  display: flex;
  justify-content: flex-start;
  width: max-content;
}

.orgchart-branch {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.orgchart-children {
  display: flex;
  gap: 40px;
  margin-top: 40px;
  width: max-content;
}

.orgchart-svg {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  overflow: visible;
}

.orgchart-node-avatar {
  position: relative;
  height: 70px;
  min-width: 70px;
}

.orgchart-img-actions {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: 0.2s;
}

.orgchart-node-avatar:hover .orgchart-img-actions {
  opacity: 1;
}

.orgchart-img-btn,
.orgchart-node-btn {
  width: 22px;
  height: 22px;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  cursor: pointer;
  padding: 2px;
}

.orgchart-img-btn img,
.orgchart-node-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.orgchart-node-actions {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: 0.2s;
}

.orgchart-node:hover .orgchart-node-actions {
  opacity: 1;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.modal {
  background: white;
  padding: 20px;
  border-radius: 8px;
  width: 300px;
}

.modal h3 {
  margin-top: 0;
  font-size: 16px;
  color: #00255D;
}

.modal input,
.modal select {
  width: 100%;
  padding: 6px;
  margin: 10px 0;
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-buttons button {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.save-btn {
  background: #00255D;
  color: white;
}

.cancel-btn {
  background: #ccc;
}

.orgchart-empty {
  width: 100%;
  height: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.orgchart-empty button {
  padding: 12px 20px;
  font-size: 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  background: #00255D;
  color: white;
}